Skip to content

Commit

Permalink
Update secrets for snow
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude committed Feb 15, 2024
1 parent 44d1394 commit a99f455
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/providers/snow/snow.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ func (p *SnowProvider) GenerateCAPISpecForUpgrade(ctx context.Context, bootstrap
return p.generateCAPISpec(ctx, bootstrapCluster, clusterSpec)
}

// PreCAPIInstallOnBootstrap runs the steps that are provider specific before CAPI is installed on the bootstrap cluster.
func (p *SnowProvider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error {
return nil
return p.UpdateSecrets(ctx, cluster, clusterSpec)
}

func (p *SnowProvider) PostBootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error {
Expand Down
11 changes: 11 additions & 0 deletions pkg/providers/snow/snow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,17 @@ func TestUpdateSecrets(t *testing.T) {
tt.Expect(tt.provider.UpdateSecrets(tt.ctx, tt.cluster, tt.clusterSpec)).To(Succeed())
}

func TestPreCAPIInstall(t *testing.T) {
tt := newSnowTest(t)
tt.kubeUnAuthClient.EXPECT().Apply(
tt.ctx,
tt.cluster.KubeconfigFile,
tt.clusterSpec.SnowCredentialsSecret,
).Return(nil)

tt.Expect(tt.provider.PreCAPIInstallOnBootstrap(tt.ctx, tt.cluster, tt.clusterSpec)).To(Succeed())
}

func TestUpdateSecretsApplyError(t *testing.T) {
tt := newSnowTest(t)
tt.kubeUnAuthClient.EXPECT().Apply(
Expand Down

0 comments on commit a99f455

Please sign in to comment.