Skip to content

Commit

Permalink
Enable the external-gc feature via annotation, featureGate bool
Browse files Browse the repository at this point in the history
* Bump aws templates to 0.1.3
* Remove testing around CCM features from hosted template
  until fixed

Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi committed Sep 12, 2024
1 parent 3530a70 commit 1292207
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ test: generate-all fmt vet envtest tidy external-crd ## Run tests.

# Utilize Kind or modify the e2e tests to load the image locally, enabling
# compatibility with other vendors.
# TODO: Support running test-e2e locally by mirroring some of the action
# workflow here and supporting pushing/using a desired REGISTRY_REPO.
.PHONY: test-e2e # Run the e2e tests using a Kind k8s instance as the management cluster.
test-e2e: cli-install
KIND_CLUSTER_NAME="hmc-test" KIND_VERSION=$(KIND_VERSION) go test ./test/e2e/ -v -ginkgo.v -timeout=2h
Expand Down
6 changes: 3 additions & 3 deletions config/dev/hmc_values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image:
repository: hmc/controller
tag: latest
repository: ghcr.io/mirantis/hmc/controller-ci
tag: v0.0.1-182-g1f17193
controller:
defaultRegistryURL: oci://hmc-local-registry:5000/charts
defaultRegistryURL: oci://ghcr.io/mirantis/hmc/charts-ci
insecureRegistry: true
createTemplates: false
6 changes: 3 additions & 3 deletions templates/cluster/aws-hosted-cp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: v2
name: aws-hosted-cp
description: |
description: |
An HMC template to deploy a k8s cluster on AWS with control plane components
within the management cluster.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.30.2+k0s.0"
appVersion: '1.30.2+k0s.0'
annotations:
hmc.mirantis.com/infrastructure-providers: aws
hmc.mirantis.com/controlplane-providers: k0smotron
Expand Down
1 change: 1 addition & 0 deletions templates/cluster/aws-hosted-cp/templates/awscluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "cluster.name" . }}
annotations:
cluster.x-k8s.io/managed-by: k0smotron
aws.cluster.x-k8s.io/external-resource-gc: "true"
spec:
region: {{ .Values.region }}
# identityRef:
Expand Down
4 changes: 2 additions & 2 deletions templates/cluster/aws-standalone-cp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.30.2+k0s.0"
appVersion: '1.30.2+k0s.0'
annotations:
hmc.mirantis.com/infrastructure-providers: aws
hmc.mirantis.com/controlplane-providers: k0s
Expand Down
2 changes: 2 additions & 0 deletions templates/cluster/aws-standalone-cp/templates/awscluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSCluster
metadata:
name: {{ include "cluster.name" . }}
annotations:
aws.cluster.x-k8s.io/external-resource-gc: "true"
spec:
region: {{ .Values.region }}
# identityRef:
Expand Down
4 changes: 2 additions & 2 deletions templates/provider/cluster-api-provider-aws/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.1.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.6.1"
appVersion: '2.6.1'
annotations:
hmc.mirantis.com/infrastructure-providers: aws
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ spec:
name: {{ .Values.configSecret.name }}
namespace: {{ .Values.configSecret.namespace | default .Release.Namespace | trunc 63 }}
{{- end }}
manager:
featureGates:
ExternalResourceGC: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: aws-hosted-cp
chartVersion: 0.1.2
chartVersion: 0.1.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: aws-standalone-cp
chartVersion: 0.1.2
chartVersion: 0.1.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: cluster-api-provider-aws
chartVersion: 0.1.1
chartVersion: 0.1.2
5 changes: 5 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ var _ = Describe("controller", Ordered, func() {
// Verify the hosted cluster is running/ready.
templateBy(managedcluster.TemplateAWSHostedCP, "waiting for infrastructure to deploy successfully")
resourcesToValidate = managedcluster.NewDeployedValidation()

// FIXME: Remove ccm and csi-driver from the resources to validate
// until #290 is resolved.
delete(resourcesToValidate, "ccm")
delete(resourcesToValidate, "csi-driver")
Eventually(func() error {
return managedcluster.VerifyProviderDeployed(
context.Background(), standaloneClient, hdName, resourcesToValidate,
Expand Down
3 changes: 0 additions & 3 deletions test/managedcluster/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package aws
import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"

Expand Down Expand Up @@ -109,8 +108,6 @@ func PopulateHostedTemplateVars(ctx context.Context, kc *kubeclient.KubeClient)
func PatchAWSClusterReady(ctx context.Context, kc *kubeclient.KubeClient, clusterName string) error {
GinkgoHelper()

_, _ = fmt.Fprintf(GinkgoWriter, "Patching AWS cluster %q to ready\n", clusterName)

c := getAWSClusterClient(kc)

trueStatus := map[string]interface{}{
Expand Down

0 comments on commit 1292207

Please sign in to comment.