Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync snapd from k8sd and set meta.orb by default after bootstrap/join #444

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/k8s/pkg/k8sd/app/hooks_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/canonical/k8s/pkg/k8sd/types"
snaputil "github.com/canonical/k8s/pkg/snap/util"
"github.com/canonical/k8s/pkg/utils"
"github.com/canonical/k8s/pkg/utils/experimental/snapdconfig"
"github.com/canonical/microcluster/state"
)

Expand Down Expand Up @@ -334,6 +335,10 @@ func (a *App) onBootstrapControlPlane(s *state.State, bootstrapConfig apiv1.Boot
return fmt.Errorf("database transaction to update cluster configuration failed: %w", err)
}

if err := snapdconfig.SetSnapdFromK8sd(s.Context, cfg.ToUserFacing(), snap); err != nil {
return fmt.Errorf("failed to set snapd configuration from k8sd: %w", err)
}

// Start services
if err := startControlPlaneServices(s.Context, snap, cfg.Datastore.GetType()); err != nil {
return fmt.Errorf("failed to start services: %w", err)
Expand Down
5 changes: 5 additions & 0 deletions src/k8s/pkg/k8sd/app/hooks_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/canonical/k8s/pkg/k8sd/pki"
"github.com/canonical/k8s/pkg/k8sd/setup"
"github.com/canonical/k8s/pkg/utils"
"github.com/canonical/k8s/pkg/utils/experimental/snapdconfig"
"github.com/canonical/microcluster/state"
)

Expand Down Expand Up @@ -144,6 +145,10 @@ func (a *App) onPostJoin(s *state.State, initConfig map[string]string) error {
return fmt.Errorf("failed to configure services: %w", err)
}

if err := snapdconfig.SetSnapdFromK8sd(s.Context, cfg.ToUserFacing(), snap); err != nil {
return fmt.Errorf("failed to set snapd configuration from k8sd: %w", err)
}

// Start services
if err := startControlPlaneServices(s.Context, snap, cfg.Datastore.GetType()); err != nil {
return fmt.Errorf("failed to start services: %w", err)
Expand Down
Loading