Skip to content

Commit

Permalink
Pin CAAPF version to v0.3.0
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
  • Loading branch information
Danil-Grigorev committed Jul 24, 2024
1 parent 2cbdc02 commit bfcd9bc
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/rancher-turtles/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ questions:
group: "Rancher Turtles Features Settings"
- variable: rancherTurtles.features.addon-provider-fleet.enabled
default: false
description: "(Experimental) Enable Fleet Addon Provider functionality in Rancher Turtles"
description: "Enable Fleet Addon Provider functionality in Rancher Turtles"
type: boolean
label: Seamless integration with Fleet and CAPI
group: "Rancher Turtles Features Settings"
2 changes: 2 additions & 0 deletions charts/rancher-turtles/templates/addon-provider-fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ data:
spec:
clusterClass:
patchResource: true
setOwnerReferences: true
cluster:
patchResource: true
setOwnerReferences: true
selector:
matchLabels:
cluster-api.cattle.io/rancher-auto-import: "true"
Expand Down
2 changes: 1 addition & 1 deletion charts/rancher-turtles/templates/clusterctl-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ data:
# Addon providers
- name: "fleet"
url: "https://github.com/rancher-sandbox/cluster-api-addon-provider-fleet/releases/latest/addon-components.yaml"
url: "https://github.com/rancher-sandbox/cluster-api-addon-provider-fleet/releases/v0.3.0/addon-components.yaml"
type: "AddonProvider"
{{- end }}
4 changes: 3 additions & 1 deletion test/e2e/suites/import-gitops-v3/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ var _ = BeforeSuite(func() {
Image: fmt.Sprintf("ghcr.io/rancher/turtles-e2e-%s", runtime.GOARCH),
Tag: "v0.0.1",
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers"),
AdditionalValues: map[string]string{},
AdditionalValues: map[string]string{
"rancherTurtles.features.addon-provider-fleet.enabled": "true",
},
}
if flagVals.UseEKS {
rtInput.AdditionalValues["rancherTurtles.imagePullSecrets"] = "{regcred}"
Expand Down
19 changes: 17 additions & 2 deletions test/e2e/suites/import-gitops/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/rancher/turtles/test/e2e"
"github.com/rancher/turtles/test/framework"
opframework "github.com/rancher/turtles/test/framework"
turtlesframework "github.com/rancher/turtles/test/framework"
"github.com/rancher/turtles/test/testenv"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
ctrl "sigs.k8s.io/controller-runtime"
)
Expand Down Expand Up @@ -144,7 +147,7 @@ var _ = BeforeSuite(func() {
hostName = svcRes.Hostname

By("Deploying ghcr details")
framework.CreateDockerRegistrySecret(ctx, framework.CreateDockerRegistrySecretInput{
opframework.CreateDockerRegistrySecret(ctx, opframework.CreateDockerRegistrySecretInput{
Name: "regcred",
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
Namespace: "rancher-turtles-system",
Expand Down Expand Up @@ -212,6 +215,7 @@ var _ = BeforeSuite(func() {
Tag: "v0.0.1",
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers"),
AdditionalValues: rtInput.AdditionalValues,
PostUpgradeSteps: []func(){},
}

if flagVals.UseEKS {
Expand All @@ -226,6 +230,17 @@ var _ = BeforeSuite(func() {
rtInput.AdditionalValues["rancherTurtles.features.addon-provider-fleet.enabled"] = "true"
rtInput.AdditionalValues["rancherTurtles.features.managementv3-cluster.enabled"] = "false" // disable the default management.cattle.io/v3 controller

upgradeInput.PostUpgradeSteps = append(upgradeInput.PostUpgradeSteps, func() {
By("Waiting for CAAPF deployment to be available")
framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "caapf-controller-manager",
Namespace: "rancher-turtles-system",
}},
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
})

testenv.UpgradeRancherTurtles(ctx, upgradeInput)
} else {
rtInput := testenv.DeployRancherTurtlesInput{
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/suites/migrate-gitops/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ import (
"github.com/rancher/turtles/test/e2e"
turtlesframework "github.com/rancher/turtles/test/framework"
"github.com/rancher/turtles/test/testenv"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
ctrl "sigs.k8s.io/controller-runtime"
)
Expand Down Expand Up @@ -183,6 +187,17 @@ var _ = BeforeSuite(func() {
rtInput.AdditionalValues["rancherTurtles.features.addon-provider-fleet.enabled"] = "true"
rtInput.AdditionalValues["rancherTurtles.features.managementv3-cluster.enabled"] = "false" // disable the default management.cattle.io/v3 controller

upgradeInput.PostUpgradeSteps = append(upgradeInput.PostUpgradeSteps, func() {
By("Waiting for CAAPF deployment to be available")
framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "caapf-controller-manager",
Namespace: "rancher-turtles-system",
}},
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
})

testenv.UpgradeRancherTurtles(ctx, upgradeInput)

giteaValues := map[string]string{
Expand Down
5 changes: 5 additions & 0 deletions test/testenv/turtles.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ type UpgradeRancherTurtlesInput struct {
AdditionalValues map[string]string
Image string
Tag string
PostUpgradeSteps []func()
SkipCleanup bool
}

Expand Down Expand Up @@ -259,6 +260,10 @@ func UpgradeRancherTurtles(ctx context.Context, input UpgradeRancherTurtlesInput
if err != nil {
Expect(fmt.Errorf("Unable to perform chart upgrade: %w\nOutput: %s, Command: %s", err, out, strings.Join(append(values, additionalValues...), " "))).ToNot(HaveOccurred())
}

for _, step := range input.PostUpgradeSteps {
step()
}
}

func UninstallRancherTurtles(ctx context.Context, input UninstallRancherTurtlesInput) {
Expand Down

0 comments on commit bfcd9bc

Please sign in to comment.