Skip to content

Commit

Permalink
Fix: addon manager flaky error. (#558)
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
xuezhaojun authored Jul 8, 2024
1 parent b3f15c1 commit 990a639
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion hack/e2e_flaky_error_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ do
kind load docker-image --name=e2e quay.io/open-cluster-management/placement:$IMAGE_TAG
kind load docker-image --name=e2e quay.io/open-cluster-management/addon-manager:$IMAGE_TAG

# This is for addon-manager test: /workspaces/OCM/test/e2e/manifests/addon/addon_template.yaml
docker pull quay.io/open-cluster-management/addon-examples:latest
kind load docker-image --name=e2e quay.io/open-cluster-management/addon-examples:latest

kind get kubeconfig --name=e2e > .kubeconfig

echo "Running e2e test iteration $((i+1))/$RUN_TIMES with KlusterletDeployMode=$KLUSTERLET_DEPLOY_MODE"
test_output=$(IMAGE_TAG=$IMAGE_TAG KLUSTERLET_DEPLOY_MODE=$KLUSTERLET_DEPLOY_MODE make test-e2e 2>&1)
test_output=$(IMAGE_TAG=$IMAGE_TAG KLUSTERLET_DEPLOY_MODE=$KLUSTERLET_DEPLOY_MODE KUBECONFIG=.kubeconfig make test-e2e 2>&1)
test_exit_code=$?

# Determine test result and update the respective list
Expand Down
5 changes: 1 addition & 4 deletions test/e2e/addonmanagement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
workapiv1 "open-cluster-management.io/api/work/v1"

"open-cluster-management.io/ocm/pkg/addon/templateagent"
"open-cluster-management.io/ocm/pkg/operator/helpers"
"open-cluster-management.io/ocm/test/e2e/manifests"
)

Expand Down Expand Up @@ -50,7 +49,7 @@ var (

var _ = ginkgo.Describe("Enable addon management feature gate", ginkgo.Ordered, ginkgo.Label("addon-manager"), func() {
addOnName := "hello-template"
var addonInstallNamespace string
addonInstallNamespace := "test-addon-template"

s := runtime.NewScheme()
_ = scheme.AddToScheme(s)
Expand All @@ -74,8 +73,6 @@ var _ = ginkgo.Describe("Enable addon management feature gate", ginkgo.Ordered,
// the addon manager deployment should be running
gomega.Eventually(t.CheckHubReady, t.EventuallyTimeout, t.EventuallyInterval).Should(gomega.Succeed())

addonInstallNamespace = helpers.DefaultAddonNamespace

ginkgo.By(fmt.Sprintf("create addon template resources for cluster %v", clusterName))
err = createResourcesFromYamlFiles(context.Background(), t.HubDynamicClient, t.hubRestMapper, s,
defaultAddonTemplateReaderManifestsFunc(manifests.AddonManifestFiles, map[string]interface{}{
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/manifests/addon/addon_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
type: ServerSideApply
workload:
manifests:
- kind: Namespace
apiVersion: v1
metadata:
name: << AddonInstallNamespace >>
- kind: Deployment
apiVersion: apps/v1
metadata:
Expand Down

0 comments on commit 990a639

Please sign in to comment.