From f0d88fbb3d0c1af240e3c7c0f64a4f84c82e307e Mon Sep 17 00:00:00 2001 From: zhujian Date: Mon, 1 Apr 2024 07:06:31 +0000 Subject: [PATCH] Fix e2e Signed-off-by: zhujian --- examples/deploy/addon/helloworld-helm/kustomization.yaml | 1 + .../helloworld-helm/resources/addon_deployment_config.yaml | 6 ++++++ .../resources/helloworld_helm_clustermanagementaddon.yaml | 3 +++ pkg/utils/addon_config.go | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 examples/deploy/addon/helloworld-helm/resources/addon_deployment_config.yaml diff --git a/examples/deploy/addon/helloworld-helm/kustomization.yaml b/examples/deploy/addon/helloworld-helm/kustomization.yaml index 7d42707ac..bfe217d67 100644 --- a/examples/deploy/addon/helloworld-helm/kustomization.yaml +++ b/examples/deploy/addon/helloworld-helm/kustomization.yaml @@ -1,6 +1,7 @@ namespace: open-cluster-management resources: +- resources/addon_deployment_config.yaml - resources/cluster_role.yaml - resources/cluster_role_binding.yaml - resources/service_account.yaml diff --git a/examples/deploy/addon/helloworld-helm/resources/addon_deployment_config.yaml b/examples/deploy/addon/helloworld-helm/resources/addon_deployment_config.yaml new file mode 100644 index 000000000..fd5088372 --- /dev/null +++ b/examples/deploy/addon/helloworld-helm/resources/addon_deployment_config.yaml @@ -0,0 +1,6 @@ +apiVersion: addon.open-cluster-management.io/v1alpha1 +kind: AddOnDeploymentConfig +metadata: + name: helloworldhelm-config +spec: + agentInstallNamespace: open-cluster-management-agent-addon diff --git a/examples/deploy/addon/helloworld-helm/resources/helloworld_helm_clustermanagementaddon.yaml b/examples/deploy/addon/helloworld-helm/resources/helloworld_helm_clustermanagementaddon.yaml index 5a24d7310..8bb30a314 100644 --- a/examples/deploy/addon/helloworld-helm/resources/helloworld_helm_clustermanagementaddon.yaml +++ b/examples/deploy/addon/helloworld-helm/resources/helloworld_helm_clustermanagementaddon.yaml @@ -9,4 +9,7 @@ spec: supportedConfigs: - group: addon.open-cluster-management.io resource: addondeploymentconfigs + defaultConfig: + name: helloworldhelm-config + namespace: open-cluster-management - resource: configmaps diff --git a/pkg/utils/addon_config.go b/pkg/utils/addon_config.go index 77294aaaf..50f15ac1d 100644 --- a/pkg/utils/addon_config.go +++ b/pkg/utils/addon_config.go @@ -47,7 +47,7 @@ func AgentInstallNamespaceFromDeploymentConfigFunc( return "", fmt.Errorf("failed to get deployment config for addon %s: %v", addon.Name, err) } if config == nil { - return "", fmt.Errorf("failed to get deployment config for addon %s: %v", addon.Name, err) + return "", fmt.Errorf("failed to get deployment config for addon %s", addon.Name) } return config.Spec.AgentInstallNamespace, nil