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

Remove kindless upgrade feature flag for all the providers #6879

Merged
merged 1 commit into from
Oct 25, 2023
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
4 changes: 1 addition & 3 deletions cmd/eksctl-anywhere/cmd/upgradecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd/aflag"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/dependencies"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/kubeconfig"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
Expand Down Expand Up @@ -195,8 +194,7 @@

upgradeValidations := upgradevalidations.New(validationOpts)

if features.ExperimentalSelfManagedClusterUpgrade().IsActive() && clusterConfig.IsSelfManaged() {
logger.Info("Management kindless upgrade")
if clusterConfig.IsSelfManaged() {

Check warning on line 197 in cmd/eksctl-anywhere/cmd/upgradecluster.go

View check run for this annotation

Codecov / codecov/patch

cmd/eksctl-anywhere/cmd/upgradecluster.go#L197

Added line #L197 was not covered by tests
upgrade := management.NewUpgrade(
deps.Provider,
deps.CAPIManager,
Expand Down
7 changes: 1 addition & 6 deletions manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,9 @@ func setupReconcilers(ctx context.Context, setupLog logr.Logger, mgr ctrl.Manage
os.Exit(1)
}

expUpgrades := features.IsActive(features.ExperimentalSelfManagedClusterUpgrade())
if expUpgrades {
setupLog.Info("[EXPERIMENTAL] Self-managed cluster upgrades enabled. Proceed with caution, this is not intended for production scenarios.")
}

factory := controllers.NewFactory(ctrl.Log, mgr).
WithClusterReconciler(
providers, controllers.WithExperimentalSelfManagedClusterUpgrades(expUpgrades),
providers,
).
WithVSphereDatacenterReconciler().
WithSnowMachineConfigReconciler().
Expand Down
49 changes: 12 additions & 37 deletions pkg/api/v1alpha1/cluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/semver"
)

Expand Down Expand Up @@ -374,49 +373,25 @@ func validateImmutableFieldsCluster(new, old *Cluster) field.ErrorList {
}
}

if !old.IsSelfManaged() || features.IsActive(features.ExperimentalSelfManagedClusterUpgrade()) {
oldAWSIamConfig, newAWSIamConfig := &Ref{}, &Ref{}
for _, identityProvider := range new.Spec.IdentityProviderRefs {
if identityProvider.Kind == AWSIamConfigKind {
newAWSIamConfig = &identityProvider
break
}
}

for _, identityProvider := range old.Spec.IdentityProviderRefs {
if identityProvider.Kind == AWSIamConfigKind {
oldAWSIamConfig = &identityProvider
break
}
}

if !oldAWSIamConfig.Equal(newAWSIamConfig) {
allErrs = append(
allErrs,
field.Forbidden(specPath.Child("identityProviderRefs", AWSIamConfigKind), fmt.Sprintf("field is immutable %v", newAWSIamConfig.Kind)))
oldAWSIamConfig, newAWSIamConfig := &Ref{}, &Ref{}
for _, identityProvider := range new.Spec.IdentityProviderRefs {
if identityProvider.Kind == AWSIamConfigKind {
newAWSIamConfig = &identityProvider
break
}
return allErrs
}

clusterlog.Info("Cluster config is associated with management cluster", "name", old.Name)

if !RefSliceEqual(new.Spec.IdentityProviderRefs, old.Spec.IdentityProviderRefs) {
allErrs = append(
allErrs,
field.Forbidden(specPath.Child("IdentityProviderRefs"), fmt.Sprintf("field is immutable %v", new.Spec.IdentityProviderRefs)))
}

if old.Spec.KubernetesVersion != new.Spec.KubernetesVersion {
allErrs = append(
allErrs,
field.Forbidden(specPath.Child("kubernetesVersion"), fmt.Sprintf("field is immutable %v", new.Spec.KubernetesVersion)),
)
for _, identityProvider := range old.Spec.IdentityProviderRefs {
if identityProvider.Kind == AWSIamConfigKind {
oldAWSIamConfig = &identityProvider
break
}
}

if !old.Spec.ControlPlaneConfiguration.Equal(&new.Spec.ControlPlaneConfiguration) {
if !oldAWSIamConfig.Equal(newAWSIamConfig) {
allErrs = append(
allErrs,
field.Forbidden(specPath.Child("ControlPlaneConfiguration"), fmt.Sprintf("field is immutable %v", new.Spec.ControlPlaneConfiguration)))
field.Forbidden(specPath.Child("identityProviderRefs", AWSIamConfigKind), fmt.Sprintf("field is immutable %v", newAWSIamConfig.Kind)))
}

return allErrs
Expand Down
Loading