diff --git a/.github/workflows/fleet-upgrade.yml b/.github/workflows/fleet-upgrade-ci.yml similarity index 100% rename from .github/workflows/fleet-upgrade.yml rename to .github/workflows/fleet-upgrade-ci.yml diff --git a/.github/workflows/rancher-upgrade-fleet.yml b/.github/workflows/rancher-upgrade-fleet-ci.yml similarity index 100% rename from .github/workflows/rancher-upgrade-fleet.yml rename to .github/workflows/rancher-upgrade-fleet-ci.yml diff --git a/dev/remove-fleet b/dev/remove-fleet index b585387a36..5a58d29b20 100755 --- a/dev/remove-fleet +++ b/dev/remove-fleet @@ -8,17 +8,22 @@ ctx=$(kubectl config current-context) kubectl config use-context "$upstream_ctx" +# Remove controllers helm uninstall -n cattle-fleet-system fleet + +# Remove finalizers, this will prevent deletion of namespace fleet-local from hanging +for res in gitrepos.fleet.cattle.io bundledeployments.fleet.cattle.io bundles.fleet.cattle.io; do + kubectl get "$res" -A --no-headers | while read ns name _; do kubectl patch "$res" -n "$ns" "$name" -p '{"metadata":{"finalizers":[]}}' --type=merge; done +done + helm uninstall -n cattle-fleet-system fleet-crd +# make sure crds are removed +kubectl delete crd gitrepos.fleet.cattle.io bundledeployments.fleet.cattle.io bundles.fleet.cattle.io + kubectl delete ns cattle-fleet-system --now kubectl delete ns cattle-fleet-clusters-system --now -# This will prevent deletion of namespace fleet-local from hanging -bd_ns=$(kubectl get ns -l fleet.cattle.io/managed=true --no-headers -o=jsonpath={.items[0].metadata.name}) -kubectl patch bundledeployment fleet-agent-local -n $bd_ns -p '{"metadata":{"finalizers":[]}}' --type=merge -kubectl patch bundle fleet-agent-local -n fleet-local -p '{"metadata":{"finalizers":[]}}' --type=merge - kubectl delete ns fleet-local --now kubectl delete ns -l "fleet.cattle.io/managed=true" @@ -31,4 +36,3 @@ helm uninstall -n cattle-fleet-system fleet-agent kubectl delete ns cattle-fleet-system --now kubectl config use-context "$ctx" - diff --git a/e2e/multi-cluster/bundle_namespace_mapping_test.go b/e2e/multi-cluster/bundle_namespace_mapping_test.go index 91e86ed0a4..f509680dbe 100644 --- a/e2e/multi-cluster/bundle_namespace_mapping_test.go +++ b/e2e/multi-cluster/bundle_namespace_mapping_test.go @@ -11,7 +11,9 @@ import ( "github.com/rancher/fleet/e2e/testenv/kubectl" ) -var _ = Describe("Bundle Namespace Mapping", Label("difficult"), func() { +// This test uses two clusters to demonstrate matching clusters in different +// namespaces. Therefore it's setup and input configuration is difficult. +var _ = Describe("Bundle Namespace Mapping", func() { var ( k kubectl.Command kd kubectl.Command diff --git a/e2e/multi-cluster/depends_on_test.go b/e2e/multi-cluster/depends_on_test.go index 59b02782f4..c1a4364b62 100644 --- a/e2e/multi-cluster/depends_on_test.go +++ b/e2e/multi-cluster/depends_on_test.go @@ -13,7 +13,7 @@ import ( fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1" ) -var _ = Describe("Bundle Depends On", Label("difficult"), func() { +var _ = Describe("Bundle Depends On", func() { var ( k kubectl.Command diff --git a/internal/cmd/cli/apply/apply.go b/internal/cmd/cli/apply/apply.go index a4c472b00b..14ce2e097a 100644 --- a/internal/cmd/cli/apply/apply.go +++ b/internal/cmd/cli/apply/apply.go @@ -213,7 +213,8 @@ func Dir(ctx context.Context, client Getter, name, baseDir string, opts *Options if opts == nil { opts = &Options{} } - // the bundleID is a valid helm release name, it's used as a default if a release name is not specified in helm options + // The bundleID is a valid helm release name, it's used as a default if a release name is not specified in helm options. + // It's also used to create the bundle name. bundleID := filepath.Join(name, baseDir) bundleID = name2.HelmReleaseName(bundleID)