Skip to content

Commit

Permalink
Add warning to deprecate disableCSI through CLI (#5918)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-koppuru authored May 26, 2023
1 parent 667124e commit b5f2b2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/providers/vsphere/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,17 @@ func (p *vsphereProvider) PostMoveManagementToBootstrap(_ context.Context, _ *ty
return nil
}

// TODO: Remove this field for v0.17.x, adding a warning as of v0.16.0
func warnIfCSIEnabled(disableCSI bool) {
if !disableCSI {
// Need to add spacing to make the log message look neat
logger.MarkWarning(" Warning: Installing CSI through EKS Anywhere is deprecated. Refer to the official documentation for more details on " +
"the disableCSI field in VSphereDatacenterConfig")
}
}

func (p *vsphereProvider) SetupAndValidateCreateCluster(ctx context.Context, clusterSpec *cluster.Spec) error {
warnIfCSIEnabled(clusterSpec.VSphereDatacenter.Spec.DisableCSI)
if err := p.validator.validateUpgradeRolloutStrategy(clusterSpec); err != nil {
return fmt.Errorf("failed setup and validations: %v", err)
}
Expand Down Expand Up @@ -352,6 +362,7 @@ func (p *vsphereProvider) SetupAndValidateCreateCluster(ctx context.Context, clu
}

func (p *vsphereProvider) SetupAndValidateUpgradeCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, _ *cluster.Spec) error {
warnIfCSIEnabled(clusterSpec.VSphereDatacenter.Spec.DisableCSI)
if err := p.validator.validateUpgradeRolloutStrategy(clusterSpec); err != nil {
return fmt.Errorf("failed setup and validations: %v", err)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/providers/vsphere/vsphere_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func givenEmptyClusterSpec() *cluster.Spec {
s.VersionsBundle.KubeVersion = "1.19"
s.VersionsBundle.EksD.Name = eksd119Release
s.Cluster.Namespace = "test-namespace"
s.VSphereDatacenter = &v1alpha1.VSphereDatacenterConfig{}
})
}

Expand Down

0 comments on commit b5f2b2e

Please sign in to comment.