Skip to content

Commit

Permalink
Remove feature flag for kubernetes version 1.23 (#2891)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude authored Aug 5, 2022
1 parent 7d76eb9 commit 376f3c9
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 151 deletions.
3 changes: 3 additions & 0 deletions docs/content/en/docs/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ weight: 35
---

## Unreleased
### Added
- Add support for Kubernetes 1.23 [#2159](https://github.com/aws/eks-anywhere/issues/2159)


## [v0.10.1](https://github.com/aws/eks-anywhere/releases/tag/v0.10.1)

Expand Down
8 changes: 0 additions & 8 deletions pkg/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const (
FullLifecycleAPIEnvVar = "FULL_LIFECYCLE_API"
FullLifecycleGate = "FullLifecycleAPI"
CuratedPackagesEnvVar = "CURATED_PACKAGES_SUPPORT"
K8s123SupportEnvVar = "K8S_1_23_SUPPORT"
CheckpointEnabledEnvVar = "CHECKPOINT_ENABLED"
)

Expand Down Expand Up @@ -64,13 +63,6 @@ func CuratedPackagesSupport() Feature {
}
}

func K8s123Support() Feature {
return Feature{
Name: "Kubernetes version 1.23 support",
IsActive: globalFeatures.isActiveForEnvVar(K8s123SupportEnvVar),
}
}

func CheckpointEnabled() Feature {
return Feature{
Name: "Checkpoint to rerun commands enabled",
Expand Down
11 changes: 0 additions & 11 deletions pkg/validations/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package validations
import (
"fmt"

"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/logger"
)

Expand Down Expand Up @@ -42,12 +40,3 @@ func ValidateCertForRegistryMirror(clusterSpec *cluster.Spec, tlsValidator TlsVa

return nil
}

func ValidateK8s123Support(clusterSpec *cluster.Spec) error {
if !features.IsActive(features.K8s123Support()) {
if clusterSpec.Cluster.Spec.KubernetesVersion == v1alpha1.Kube123 {
return fmt.Errorf("kubernetes version %s is not enabled. Please set the env variable %v", v1alpha1.Kube123, features.K8s123SupportEnvVar)
}
}
return nil
}
7 changes: 0 additions & 7 deletions pkg/validations/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,3 @@ func TestValidateCertForRegistryMirrorInsecureSkip(t *testing.T) {

tt.Expect(validations.ValidateCertForRegistryMirror(tt.clusterSpec, tt.tlsValidator)).To(Succeed())
}

func TestValidateK8s123Support(t *testing.T) {
tt := newTlsTest(t)
tt.clusterSpec.Cluster.Spec.KubernetesVersion = anywherev1.Kube123
tt.Expect(validations.ValidateK8s123Support(tt.clusterSpec)).To(
MatchError(ContainSubstring("kubernetes version 1.23 is not enabled. Please set the env variable K8S_1_23_SUPPORT")))
}
7 changes: 0 additions & 7 deletions pkg/validations/createvalidations/preflightvalidations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/types"
"github.com/aws/eks-anywhere/pkg/validations"
)
Expand All @@ -24,12 +23,6 @@ func (u *CreateValidations) PreflightValidations(ctx context.Context) (err error
Remediation: fmt.Sprintf("provide a valid certificate for you registry endpoint using %s env var", anywherev1.RegistryMirrorCAKey),
Err: validations.ValidateCertForRegistryMirror(u.Opts.Spec, u.Opts.TlsValidator),
},
{
Name: "validate kubernetes version 1.23 support",
Remediation: fmt.Sprintf("ensure %v env variable is set", features.K8s123SupportEnvVar),
Err: validations.ValidateK8s123Support(u.Opts.Spec),
Silent: true,
},
}

if u.Opts.Spec.Cluster.IsManaged() {
Expand Down
7 changes: 0 additions & 7 deletions pkg/validations/upgradevalidations/preflightvalidations.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/types"
"github.com/aws/eks-anywhere/pkg/validations"
)
Expand All @@ -25,12 +24,6 @@ func (u *UpgradeValidations) PreflightValidations(ctx context.Context) (err erro
Remediation: fmt.Sprintf("provide a valid certificate for you registry endpoint using %s env var", anywherev1.RegistryMirrorCAKey),
Err: validations.ValidateCertForRegistryMirror(u.Opts.Spec, u.Opts.TlsValidator),
},
{
Name: "validate kubernetes version 1.23 support",
Remediation: fmt.Sprintf("ensure %v env variable is set", features.K8s123SupportEnvVar),
Err: validations.ValidateK8s123Support(u.Opts.Spec),
Silent: true,
},
{
Name: "control plane ready",
Remediation: fmt.Sprintf("ensure control plane nodes and pods for cluster %s are Ready", u.Opts.WorkloadCluster.Name),
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/awsiam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/test/framework"
)

Expand Down Expand Up @@ -63,7 +62,6 @@ func TestDockerKubernetes123AWSIamAuth(t *testing.T) {
framework.NewDocker(t),
framework.WithAWSIam(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runAWSIamAuthFlow(test)
}
Expand Down Expand Up @@ -104,7 +102,6 @@ func TestVSphereKubernetes123AWSIamAuth(t *testing.T) {
framework.NewVSphere(t, framework.WithUbuntu123()),
framework.WithAWSIam(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runAWSIamAuthFlow(test)
}
Expand Down Expand Up @@ -145,7 +142,6 @@ func TestVSphereKubernetes123BottleRocketAWSIamAuth(t *testing.T) {
framework.NewVSphere(t, framework.WithBottleRocket123()),
framework.WithAWSIam(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runAWSIamAuthFlow(test)
}
Expand All @@ -157,13 +153,11 @@ func TestVSphereKubernetes122To123AWSIamAuthUpgrade(t *testing.T) {
provider,
framework.WithAWSIam(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube122)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runUpgradeFlowWithAWSIamAuth(
test,
v1alpha1.Kube123,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube123)),
provider.WithProviderUpgrade(framework.UpdateUbuntuTemplate123Var()),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}
4 changes: 0 additions & 4 deletions test/e2e/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/test/framework"
)

Expand Down Expand Up @@ -67,7 +66,6 @@ func TestDockerKubernetes123ThreeWorkersConformanceFlow(t *testing.T) {
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runConformanceFlow(test)
}
Expand Down Expand Up @@ -108,7 +106,6 @@ func TestVSphereKubernetes123ThreeWorkersConformanceFlow(t *testing.T) {
framework.NewVSphere(t, framework.WithUbuntu123()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runConformanceFlow(test)
}
Expand Down Expand Up @@ -149,7 +146,6 @@ func TestVSphereKubernetes123BottleRocketThreeWorkersConformanceFlow(t *testing.
framework.NewVSphere(t, framework.WithBottleRocket123()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runConformanceFlow(test)
}
Expand Down
14 changes: 0 additions & 14 deletions test/e2e/flux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/test/framework"
)

Expand Down Expand Up @@ -50,7 +49,6 @@ func TestDockerKubernetes123GithubFlux(t *testing.T) {
framework.NewDocker(t),
framework.WithFluxGithub(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -60,7 +58,6 @@ func TestDockerKubernetes123GitFlux(t *testing.T) {
framework.NewDocker(t),
framework.WithFluxGit(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -79,7 +76,6 @@ func TestDockerKubernetes123FluxLegacy(t *testing.T) {
framework.NewDocker(t),
framework.WithFluxLegacy(),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand Down Expand Up @@ -116,7 +112,6 @@ func TestVSphereKubernetes123FluxLegacy(t *testing.T) {
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
framework.WithClusterFiller(api.WithControlPlaneCount(1)),
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -129,7 +124,6 @@ func TestVSphereKubernetes123GithubFlux(t *testing.T) {
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
framework.WithClusterFiller(api.WithControlPlaneCount(1)),
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -142,7 +136,6 @@ func TestVSphereKubernetes123GitFlux(t *testing.T) {
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
framework.WithClusterFiller(api.WithControlPlaneCount(1)),
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand Down Expand Up @@ -202,7 +195,6 @@ func TestVSphereKubernetes123ThreeReplicasThreeWorkersFluxLegacy(t *testing.T) {
framework.WithClusterFiller(api.WithControlPlaneCount(3)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
framework.WithFluxLegacy(),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -218,7 +210,6 @@ func TestDockerKubernetes123GitopsOptionsFluxLegacy(t *testing.T) {
api.WithFluxNamespace(fluxUserProvidedNamespace),
api.WithFluxConfigurationPath(fluxUserProvidedPath),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand All @@ -235,7 +226,6 @@ func TestVSphereKubernetes123GitopsOptionsFluxLegacy(t *testing.T) {
api.WithFluxNamespace(fluxUserProvidedNamespace),
api.WithFluxConfigurationPath(fluxUserProvidedPath),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runFluxFlow(test)
}
Expand Down Expand Up @@ -273,14 +263,12 @@ func TestVSphereKubernetes122To123FluxUpgradeLegacy(t *testing.T) {
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
framework.WithClusterFiller(api.WithControlPlaneCount(1)),
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runUpgradeFlowWithFlux(
test,
v1alpha1.Kube123,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube123)),
provider.WithProviderUpgrade(framework.UpdateUbuntuTemplate123Var()),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}

Expand All @@ -293,13 +281,11 @@ func TestVSphereKubernetes122To123GitFluxUpgrade(t *testing.T) {
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
framework.WithClusterFiller(api.WithControlPlaneCount(1)),
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
runUpgradeFlowWithFlux(
test,
v1alpha1.Kube123,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube123)),
provider.WithProviderUpgrade(framework.UpdateUbuntuTemplate123Var()),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}
9 changes: 0 additions & 9 deletions test/e2e/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/test/framework"
)

Expand Down Expand Up @@ -51,7 +50,6 @@ func TestDockerKubernetes123Labels(t *testing.T) {
api.WithWorkerNodeGroup(worker2, api.WithCount(1),
api.WithLabel(key2, val2)),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)

runLabelsUpgradeFlow(
Expand All @@ -63,7 +61,6 @@ func TestDockerKubernetes123Labels(t *testing.T) {
api.WithWorkerNodeGroup(worker2),
api.WithControlPlaneLabel(cpKey1, cpVal1),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}

Expand All @@ -79,7 +76,6 @@ func TestVSphereKubernetes123Labels(t *testing.T) {
api.WithControlPlaneCount(1),
api.RemoveAllWorkerNodeGroups(), // This gives us a blank slate
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)

runLabelsUpgradeFlow(
Expand All @@ -91,7 +87,6 @@ func TestVSphereKubernetes123Labels(t *testing.T) {
api.WithWorkerNodeGroup(worker2),
api.WithControlPlaneLabel(cpKey1, cpVal1),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}

Expand All @@ -107,7 +102,6 @@ func TestVSphereKubernetes123LabelsBottlerocket(t *testing.T) {
api.WithControlPlaneCount(1),
api.RemoveAllWorkerNodeGroups(), // This gives us a blank slate
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)

runLabelsUpgradeFlow(
Expand All @@ -119,7 +113,6 @@ func TestVSphereKubernetes123LabelsBottlerocket(t *testing.T) {
api.WithWorkerNodeGroup(worker2),
api.WithControlPlaneLabel(cpKey1, cpVal1),
),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}

Expand All @@ -145,7 +138,6 @@ func TestSnowKubernetes123LabelsUbuntu(t *testing.T) {
api.RemoveAllWorkerNodeGroups(),
),
framework.WithEnvVar("SNOW_PROVIDER", "true"),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)

runLabelsUpgradeFlow(
Expand All @@ -157,7 +149,6 @@ func TestSnowKubernetes123LabelsUbuntu(t *testing.T) {
api.WithControlPlaneLabel(cpKey1, cpVal1),
),
framework.WithEnvVar("SNOW_PROVIDER", "true"),
framework.WithEnvVar(features.K8s123SupportEnvVar, "true"),
)
}

Expand Down
Loading

0 comments on commit 376f3c9

Please sign in to comment.