From 9997df411e83fc9566c260508adc0521ea1545c5 Mon Sep 17 00:00:00 2001 From: Samuele Pedroni Date: Fri, 1 Dec 2023 13:28:03 +0100 Subject: [PATCH] Fix altenative providers support using the snapd version with the fix we need to use the non-nop version of SanitizePlugsSlots as well for this to work --- go.mod | 2 +- go.sum | 2 ++ internal/statemachine/snap_states.go | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d2a12b89..4bffbe9d 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require github.com/ulikunitz/xz v0.5.10 // indirect require ( github.com/snapcore/secboot v0.0.0-20230623151406-4d331d24f830 // indirect - github.com/snapcore/snapd v0.0.0-20231013073308-d6406abbd09d + github.com/snapcore/snapd v0.0.0-20231116194835-79ec92d41431 github.com/xanzy/ssh-agent v0.3.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect diff --git a/go.sum b/go.sum index 7e32b69b..a3308779 100644 --- a/go.sum +++ b/go.sum @@ -113,6 +113,8 @@ github.com/snapcore/secboot v0.0.0-20230623151406-4d331d24f830/go.mod h1:72paVOk github.com/snapcore/snapd v0.0.0-20201005140838-501d14ac146e/go.mod h1:3xrn7QDDKymcE5VO2rgWEQ5ZAUGb9htfwlXnoel6Io8= github.com/snapcore/snapd v0.0.0-20231013073308-d6406abbd09d h1:S0Awi6wSKUXNV5cBllpnOdgqON3+MkDV0f0lnOtBxms= github.com/snapcore/snapd v0.0.0-20231013073308-d6406abbd09d/go.mod h1:M+wSEB8eBfffw7I69nDtilqKfbdkmCNbtXY1wMJV1v0= +github.com/snapcore/snapd v0.0.0-20231116194835-79ec92d41431 h1:QalfTaOxPE/2hiaEl8z03MWbB6a56vN5Fx/uKkDmwuw= +github.com/snapcore/snapd v0.0.0-20231116194835-79ec92d41431/go.mod h1:M+wSEB8eBfffw7I69nDtilqKfbdkmCNbtXY1wMJV1v0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/internal/statemachine/snap_states.go b/internal/statemachine/snap_states.go index 0b85faee..94c5841d 100644 --- a/internal/statemachine/snap_states.go +++ b/internal/statemachine/snap_states.go @@ -7,6 +7,7 @@ import ( "path/filepath" "github.com/snapcore/snapd/image" + "github.com/snapcore/snapd/interfaces/builtin" "github.com/snapcore/snapd/seed/seedwriter" "github.com/snapcore/snapd/snap" ) @@ -59,8 +60,8 @@ func (stateMachine *StateMachine) prepareImage() error { customizations.Validation = stateMachine.commonFlags.Validation imageOpts.Customizations = customizations - // plug/slot sanitization not used by snap image.Prepare, make it no-op. - snap.SanitizePlugsSlots = func(snapInfo *snap.Info) {} + // plug/slot sanitization needed by provider handling + snap.SanitizePlugsSlots = builtin.SanitizePlugsSlots // image.Prepare automatically has some output that we only want for // verbose or greater logging