Skip to content

Commit 2fb12b1

Browse files
add support for IPAM and Runtime Extension provider in E2E
1 parent 5101f01 commit 2fb12b1

File tree

11 files changed

+285
-200
lines changed

11 files changed

+285
-200
lines changed

test/e2e/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ cluster-templates-v1beta1: $(KUSTOMIZE) ## Generate cluster templates for v1beta
105105
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology.yaml
106106
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition.yaml
107107

108-
test-extension-deployment: $(KUSTOMIZE) ## Generate deployment for test extension
109-
mkdir -p $(REPO_ROOT)/test/e2e/data/test-extension
110-
$(KUSTOMIZE) build $(REPO_ROOT)/test/extension/config/default > $(REPO_ROOT)/test/e2e/data/test-extension/deployment.yaml
111-
112108
## --------------------------------------
113109
## Testing
114110
## --------------------------------------
@@ -131,7 +127,7 @@ _SKIP_ARGS := $(foreach arg,$(strip $(GINKGO_SKIP)),-skip="$(arg)")
131127
endif
132128

133129
.PHONY: run
134-
run: $(GINKGO) cluster-templates test-extension-deployment ## Run the end-to-end tests
130+
run: $(GINKGO) cluster-templates ## Run the end-to-end tests
135131
$(GINKGO) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) -poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) --tags=e2e --focus="$(GINKGO_FOCUS)" $(_SKIP_ARGS) --nodes=$(GINKGO_NODES) --timeout=$(GINKGO_TIMEOUT) --no-color=$(GINKGO_NOCOLOR) --output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) . -- \
136132
-e2e.artifacts-folder="$(ARTIFACTS)" \
137133
-e2e.config="$(E2E_CONF_FILE)" \

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 67 additions & 104 deletions
Large diffs are not rendered by default.

test/e2e/clusterctl_upgrade.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
235235
err := os.Chmod(clusterctlBinaryPath, 0744) //nolint:gosec
236236
Expect(err).ToNot(HaveOccurred(), "failed to chmod temporary file")
237237

238+
// Adjusts the clusterctlConfigPath in case the clusterctl version <= v1.3 (thus using a config file with only the providers supported in those versions)
239+
clusterctlConfigPath := clusterctl.AdjustConfigPathForBinary(clusterctlBinaryPath, input.ClusterctlConfigPath)
240+
238241
By("Initializing the workload cluster with older versions of providers")
239242

240243
if input.PreInit != nil {
@@ -243,14 +246,16 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
243246
}
244247

245248
clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
246-
ClusterctlBinaryPath: clusterctlBinaryPath, // use older version of clusterctl to init the management cluster
247-
ClusterProxy: managementClusterProxy,
248-
ClusterctlConfigPath: input.ClusterctlConfigPath,
249-
CoreProvider: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.ClusterAPIProviderName)[0],
250-
BootstrapProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.KubeadmBootstrapProviderName),
251-
ControlPlaneProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.KubeadmControlPlaneProviderName),
252-
InfrastructureProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, input.E2EConfig.InfrastructureProviders()...),
253-
LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name),
249+
ClusterctlBinaryPath: clusterctlBinaryPath, // use older version of clusterctl to init the management cluster
250+
ClusterProxy: managementClusterProxy,
251+
ClusterctlConfigPath: clusterctlConfigPath,
252+
CoreProvider: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.ClusterAPIProviderName)[0],
253+
BootstrapProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.KubeadmBootstrapProviderName),
254+
ControlPlaneProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, config.KubeadmControlPlaneProviderName),
255+
InfrastructureProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, input.E2EConfig.InfrastructureProviders()...),
256+
IPAMProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, input.E2EConfig.IPAMProviders()...),
257+
RuntimeExtensionProviders: input.E2EConfig.GetProviderLatestVersionsByContract(initContract, input.E2EConfig.RuntimeExtensionProviders()...),
258+
LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name),
254259
}, input.E2EConfig.GetIntervals(specName, "wait-controllers")...)
255260

256261
By("THE MANAGEMENT CLUSTER WITH THE OLDER VERSION OF PROVIDERS IS UP&RUNNING!")
@@ -282,7 +287,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
282287
// pass reference to the management cluster hosting this test
283288
KubeconfigPath: managementClusterProxy.GetKubeconfigPath(),
284289
// pass the clusterctl config file that points to the local provider repository created for this test,
285-
ClusterctlConfigPath: input.ClusterctlConfigPath,
290+
ClusterctlConfigPath: clusterctlConfigPath,
286291
// select template
287292
Flavor: input.WorkloadFlavor,
288293
// define template variables

test/e2e/config/docker.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ providers:
201201
- sourcePath: "../data/infrastructure-docker/v1beta1/main/clusterclass-quick-start-runtimesdk.yaml"
202202
- sourcePath: "../data/shared/v1beta1/main/metadata.yaml"
203203

204+
- name: test-extension
205+
type: RuntimeExtensionProvider
206+
versions:
207+
- name: v1.3.99 # next; use manifest from source files
208+
value: ../../../test/extension/config/default
209+
files:
210+
- sourcePath: "../data/shared/v1beta1/main/metadata.yaml"
211+
204212
variables:
205213
# Default variables for the e2e test; those values could be overridden via env variables, thus
206214
# allowing the same e2e config file to be re-used in different Prow jobs e.g. each one with a K8s version permutation.
@@ -220,7 +228,6 @@ variables:
220228
DOCKER_POD_IPV6_CIDRS: "fd00:100:96::/48"
221229
CNI: "./data/cni/kindnet/kindnet.yaml"
222230
KUBETEST_CONFIGURATION: "./data/kubetest/conformance.yaml"
223-
TEST_EXTENSION: "./data/test-extension/deployment.yaml"
224231
NODE_DRAIN_TIMEOUT: "60s"
225232
# Enabling the feature flags by setting the env variables.
226233
EXP_CLUSTER_RESOURCE_SET: "true"

test/e2e/e2e_suite_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,12 @@ func setupBootstrapCluster(config *clusterctl.E2EConfig, scheme *runtime.Scheme,
240240

241241
func initBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
242242
clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
243-
ClusterProxy: bootstrapClusterProxy,
244-
ClusterctlConfigPath: clusterctlConfig,
245-
InfrastructureProviders: config.InfrastructureProviders(),
246-
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
243+
ClusterProxy: bootstrapClusterProxy,
244+
ClusterctlConfigPath: clusterctlConfig,
245+
InfrastructureProviders: config.InfrastructureProviders(),
246+
IPAMProviders: config.IPAMProviders(),
247+
RuntimeExtensionProviders: config.RuntimeExtensionProviders(),
248+
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
247249
}, config.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
248250
}
249251

test/e2e/self_hosted.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,12 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
147147

148148
By("Initializing the workload cluster")
149149
clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
150-
ClusterProxy: selfHostedClusterProxy,
151-
ClusterctlConfigPath: input.ClusterctlConfigPath,
152-
InfrastructureProviders: input.E2EConfig.InfrastructureProviders(),
153-
LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name),
150+
ClusterProxy: selfHostedClusterProxy,
151+
ClusterctlConfigPath: input.ClusterctlConfigPath,
152+
InfrastructureProviders: input.E2EConfig.InfrastructureProviders(),
153+
IPAMProviders: input.E2EConfig.IPAMProviders(),
154+
RuntimeExtensionProviders: input.E2EConfig.RuntimeExtensionProviders(),
155+
LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name),
154156
}, input.E2EConfig.GetIntervals(specName, "wait-controllers")...)
155157

156158
By("Ensure API servers are stable before doing move")

test/extension/handlers/lifecycle/handlers.go

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ import (
2323

2424
"github.com/pkg/errors"
2525
corev1 "k8s.io/api/core/v1"
26+
apierrors "k8s.io/apimachinery/pkg/api/errors"
27+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2628
"k8s.io/apimachinery/pkg/types"
2729
"k8s.io/klog/v2"
2830
ctrl "sigs.k8s.io/controller-runtime"
2931
"sigs.k8s.io/controller-runtime/pkg/client"
3032
"sigs.k8s.io/yaml"
3133

34+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3235
runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog"
3336
runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
3437
)
@@ -42,14 +45,13 @@ type Handler struct {
4245
func (h *Handler) DoBeforeClusterCreate(ctx context.Context, request *runtimehooksv1.BeforeClusterCreateRequest, response *runtimehooksv1.BeforeClusterCreateResponse) {
4346
log := ctrl.LoggerFrom(ctx)
4447
log.Info("BeforeClusterCreate is called")
45-
cluster := request.Cluster
4648

47-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterCreate, response); err != nil {
49+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterCreate, response); err != nil {
4850
response.Status = runtimehooksv1.ResponseStatusFailure
4951
response.Message = err.Error()
5052
return
5153
}
52-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterCreate, response); err != nil {
54+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterCreate, response); err != nil {
5355
response.Status = runtimehooksv1.ResponseStatusFailure
5456
response.Message = err.Error()
5557
}
@@ -59,15 +61,14 @@ func (h *Handler) DoBeforeClusterCreate(ctx context.Context, request *runtimehoo
5961
func (h *Handler) DoBeforeClusterUpgrade(ctx context.Context, request *runtimehooksv1.BeforeClusterUpgradeRequest, response *runtimehooksv1.BeforeClusterUpgradeResponse) {
6062
log := ctrl.LoggerFrom(ctx)
6163
log.Info("BeforeClusterUpgrade is called")
62-
cluster := request.Cluster
6364

64-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterUpgrade, response); err != nil {
65+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterUpgrade, response); err != nil {
6566
response.Status = runtimehooksv1.ResponseStatusFailure
6667
response.Message = err.Error()
6768
return
6869
}
6970

70-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterUpgrade, response); err != nil {
71+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterUpgrade, response); err != nil {
7172
response.Status = runtimehooksv1.ResponseStatusFailure
7273
response.Message = err.Error()
7374
}
@@ -77,15 +78,14 @@ func (h *Handler) DoBeforeClusterUpgrade(ctx context.Context, request *runtimeho
7778
func (h *Handler) DoAfterControlPlaneInitialized(ctx context.Context, request *runtimehooksv1.AfterControlPlaneInitializedRequest, response *runtimehooksv1.AfterControlPlaneInitializedResponse) {
7879
log := ctrl.LoggerFrom(ctx)
7980
log.Info("AfterControlPlaneInitialized is called")
80-
cluster := request.Cluster
8181

82-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterControlPlaneInitialized, response); err != nil {
82+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterControlPlaneInitialized, response); err != nil {
8383
response.Status = runtimehooksv1.ResponseStatusFailure
8484
response.Message = err.Error()
8585
return
8686
}
8787

88-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterControlPlaneInitialized, response); err != nil {
88+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterControlPlaneInitialized, response); err != nil {
8989
response.Status = runtimehooksv1.ResponseStatusFailure
9090
response.Message = err.Error()
9191
}
@@ -95,15 +95,14 @@ func (h *Handler) DoAfterControlPlaneInitialized(ctx context.Context, request *r
9595
func (h *Handler) DoAfterControlPlaneUpgrade(ctx context.Context, request *runtimehooksv1.AfterControlPlaneUpgradeRequest, response *runtimehooksv1.AfterControlPlaneUpgradeResponse) {
9696
log := ctrl.LoggerFrom(ctx)
9797
log.Info("AfterControlPlaneUpgrade is called")
98-
cluster := request.Cluster
9998

100-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterControlPlaneUpgrade, response); err != nil {
99+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterControlPlaneUpgrade, response); err != nil {
101100
response.Status = runtimehooksv1.ResponseStatusFailure
102101
response.Message = err.Error()
103102
return
104103
}
105104

106-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterControlPlaneUpgrade, response); err != nil {
105+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterControlPlaneUpgrade, response); err != nil {
107106
response.Status = runtimehooksv1.ResponseStatusFailure
108107
response.Message = err.Error()
109108
}
@@ -113,15 +112,14 @@ func (h *Handler) DoAfterControlPlaneUpgrade(ctx context.Context, request *runti
113112
func (h *Handler) DoAfterClusterUpgrade(ctx context.Context, request *runtimehooksv1.AfterClusterUpgradeRequest, response *runtimehooksv1.AfterClusterUpgradeResponse) {
114113
log := ctrl.LoggerFrom(ctx)
115114
log.Info("AfterClusterUpgrade is called")
116-
cluster := request.Cluster
117115

118-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterClusterUpgrade, response); err != nil {
116+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterClusterUpgrade, response); err != nil {
119117
response.Status = runtimehooksv1.ResponseStatusFailure
120118
response.Message = err.Error()
121119
return
122120
}
123121

124-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.AfterClusterUpgrade, response); err != nil {
122+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.AfterClusterUpgrade, response); err != nil {
125123
response.Status = runtimehooksv1.ResponseStatusFailure
126124
response.Message = err.Error()
127125
}
@@ -131,25 +129,33 @@ func (h *Handler) DoAfterClusterUpgrade(ctx context.Context, request *runtimehoo
131129
func (h *Handler) DoBeforeClusterDelete(ctx context.Context, request *runtimehooksv1.BeforeClusterDeleteRequest, response *runtimehooksv1.BeforeClusterDeleteResponse) {
132130
log := ctrl.LoggerFrom(ctx)
133131
log.Info("BeforeClusterDelete is called")
134-
cluster := request.Cluster
135132

136-
if err := h.readResponseFromConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterDelete, response); err != nil {
133+
if err := h.readResponseFromConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterDelete, response); err != nil {
137134
response.Status = runtimehooksv1.ResponseStatusFailure
138135
response.Message = err.Error()
139136
return
140137
}
141-
if err := h.recordCallInConfigMap(ctx, cluster.Namespace, runtimehooksv1.BeforeClusterDelete, response); err != nil {
138+
if err := h.recordCallInConfigMap(ctx, &request.Cluster, runtimehooksv1.BeforeClusterDelete, response); err != nil {
142139
response.Status = runtimehooksv1.ResponseStatusFailure
143140
response.Message = err.Error()
144141
}
142+
143+
// TODO: consider if to cleanup the ConfigMap after gating Cluster deletion.
145144
}
146145

147-
func (h *Handler) readResponseFromConfigMap(ctx context.Context, namespace string, hook runtimecatalog.Hook, response runtimehooksv1.ResponseObject) error {
146+
func (h *Handler) readResponseFromConfigMap(ctx context.Context, cluster *clusterv1.Cluster, hook runtimecatalog.Hook, response runtimehooksv1.ResponseObject) error {
148147
hookName := runtimecatalog.HookName(hook)
149148
configMap := &corev1.ConfigMap{}
150-
configMapName := "test-extension-hookresponses"
151-
if err := h.Client.Get(ctx, client.ObjectKey{Namespace: namespace, Name: configMapName}, configMap); err != nil {
152-
return errors.Wrapf(err, "failed to read the ConfigMap %s", klog.KRef(namespace, configMapName))
149+
configMapName := fmt.Sprintf("%s-test-extension-hookresponses", cluster.Name)
150+
if err := h.Client.Get(ctx, client.ObjectKey{Namespace: cluster.Namespace, Name: configMapName}, configMap); err != nil {
151+
if apierrors.IsNotFound(err) {
152+
configMap = responsesConfigMap(cluster)
153+
if err := h.Client.Create(ctx, configMap); err != nil {
154+
return errors.Wrapf(err, "failed to create the ConfigMap %s", klog.KRef(cluster.Namespace, configMapName))
155+
}
156+
} else {
157+
return errors.Wrapf(err, "failed to read the ConfigMap %s", klog.KRef(cluster.Namespace, configMapName))
158+
}
153159
}
154160
if err := yaml.Unmarshal([]byte(configMap.Data[hookName+"-preloadedResponse"]), response); err != nil {
155161
return errors.Wrapf(err, "failed to read %q response information from ConfigMap", hook)
@@ -161,12 +167,34 @@ func (h *Handler) readResponseFromConfigMap(ctx context.Context, namespace strin
161167
return nil
162168
}
163169

164-
func (h *Handler) recordCallInConfigMap(ctx context.Context, namespace string, hook runtimecatalog.Hook, response runtimehooksv1.ResponseObject) error {
170+
// responsesConfigMap generates a ConfigMap with preloaded responses for the test extension.
171+
func responsesConfigMap(cluster *clusterv1.Cluster) *corev1.ConfigMap {
172+
return &corev1.ConfigMap{
173+
ObjectMeta: metav1.ObjectMeta{
174+
Name: fmt.Sprintf("%s-test-extension-hookresponses", cluster.Name),
175+
Namespace: cluster.Namespace,
176+
},
177+
// Set the initial preloadedResponses for each of the tested hooks.
178+
Data: map[string]string{
179+
// Blocking hooks are set to return RetryAfterSeconds initially. These will be changed during the test.
180+
"BeforeClusterCreate-preloadedResponse": `{"Status": "Success", "RetryAfterSeconds": 5}`,
181+
"BeforeClusterUpgrade-preloadedResponse": `{"Status": "Success", "RetryAfterSeconds": 5}`,
182+
"AfterControlPlaneUpgrade-preloadedResponse": `{"Status": "Success", "RetryAfterSeconds": 5}`,
183+
"BeforeClusterDelete-preloadedResponse": `{"Status": "Success", "RetryAfterSeconds": 5}`,
184+
185+
// Non-blocking hooks are set to Status:Success.
186+
"AfterControlPlaneInitialized-preloadedResponse": `{"Status": "Success"}`,
187+
"AfterClusterUpgrade-preloadedResponse": `{"Status": "Success"}`,
188+
},
189+
}
190+
}
191+
192+
func (h *Handler) recordCallInConfigMap(ctx context.Context, cluster *clusterv1.Cluster, hook runtimecatalog.Hook, response runtimehooksv1.ResponseObject) error {
165193
hookName := runtimecatalog.HookName(hook)
166194
configMap := &corev1.ConfigMap{}
167-
configMapName := "test-extension-hookresponses"
168-
if err := h.Client.Get(ctx, client.ObjectKey{Namespace: namespace, Name: configMapName}, configMap); err != nil {
169-
return errors.Wrapf(err, "failed to read the ConfigMap %s", klog.KRef(namespace, configMapName))
195+
configMapName := fmt.Sprintf("%s-test-extension-hookresponses", cluster.Name)
196+
if err := h.Client.Get(ctx, client.ObjectKey{Namespace: cluster.Namespace, Name: configMapName}, configMap); err != nil {
197+
return errors.Wrapf(err, "failed to read the ConfigMap %s", klog.KRef(cluster.Namespace, configMapName))
170198
}
171199
var patch client.Patch
172200
if r, ok := response.(runtimehooksv1.RetryResponseObject); ok {
@@ -178,7 +206,7 @@ func (h *Handler) recordCallInConfigMap(ctx context.Context, namespace string, h
178206
[]byte(fmt.Sprintf(`{"data":{"%s-actualResponseStatus":"%s"}}`, hookName, response.GetStatus()))) //nolint:gocritic
179207
}
180208
if err := h.Client.Patch(ctx, configMap, patch); err != nil {
181-
return errors.Wrapf(err, "failed to update the ConfigMap %s", klog.KRef(namespace, configMapName))
209+
return errors.Wrapf(err, "failed to update the ConfigMap %s", klog.KRef(cluster.Namespace, configMapName))
182210
}
183211
return nil
184212
}

0 commit comments

Comments
 (0)