Skip to content

Commit de9a942

Browse files
committed
fix: changes based on review
1 parent 8bb463c commit de9a942

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

make/dev.mk

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ endif
1212
kind load docker-image --name $(KIND_CLUSTER_NAME) \
1313
ghcr.io/nutanix-cloud-native/caren-helm-reg:$$(gojq -r .version dist/metadata.json)
1414
helm upgrade --install cluster-api-runtime-extensions-nutanix ./charts/cluster-api-runtime-extensions-nutanix \
15-
--create-namespace \
16-
--namespace caren-system \
1715
--set-string image.repository=ko.local/cluster-api-runtime-extensions-nutanix \
1816
--set-string image.tag=$$(gojq -r .version dist/metadata.json) \
1917
--set-string mindthegapImage.tag=$$(gojq -r .version dist/metadata.json) \
2018
--wait --wait-for-jobs
21-
kubectl rollout restart deployment -n caren-system cluster-api-runtime-extensions-nutanix
22-
kubectl rollout status deployment -n caren-system cluster-api-runtime-extensions-nutanix
19+
kubectl rollout restart deployment cluster-api-runtime-extensions-nutanix
20+
kubectl rollout status deployment cluster-api-runtime-extensions-nutanix
2321

2422
.PHONY: dev.update-webhook-image-on-kind
2523
dev.update-webhook-image-on-kind: export KUBECONFIG := $(KIND_KUBECONFIG)
@@ -29,9 +27,9 @@ ifndef SKIP_BUILD
2927
endif
3028
kind load docker-image --name $(KIND_CLUSTER_NAME) \
3129
ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
32-
kubectl set image deployment -n caren-system cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
33-
kubectl rollout restart deployment -n caren-system cluster-api-runtime-extensions-nutanix
34-
kubectl rollout status deployment -n caren-system cluster-api-runtime-extensions-nutanix
30+
kubectl set image deployment cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
31+
kubectl rollout restart deployment cluster-api-runtime-extensions-nutanix
32+
kubectl rollout status deployment cluster-api-runtime-extensions-nutanix
3533

3634

3735
.PHONY: dev.update-bootstrap-credentials-aws

pkg/handlers/generic/lifecycle/csi/nutanix-csi/handler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ func (n *NutanixCSI) handleHelmAddonApply(
194194
ValuesTemplate: values,
195195
},
196196
}
197-
198197
lifecycleutils.SetTLSConfigForHelmChartProxyIfNeeded(storageChartProxy)
199198
snapshotChartProxy := &caaphv1.HelmChartProxy{
200199
TypeMeta: metav1.TypeMeta{

pkg/handlers/generic/lifecycle/utils/utils.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package utils
66
import (
77
"context"
88
"fmt"
9+
"os"
910
"strings"
1011

1112
corev1 "k8s.io/api/core/v1"
@@ -224,11 +225,16 @@ func CreateConfigMapForCRS(configMapName, configMapNamespace string,
224225
}
225226

226227
func SetTLSConfigForHelmChartProxyIfNeeded(hcp *caaphv1.HelmChartProxy) {
228+
// this is set as an environment variable from the downward API on deployment
229+
deploymentNS := os.Getenv("POD_NAMESPACE")
230+
if deploymentNS == "" {
231+
deploymentNS = v1alpha1.CarenNamespace
232+
}
227233
if strings.Contains(hcp.Spec.RepoURL, "mindthegap") {
228234
hcp.Spec.TLSConfig = &caaphv1.TLSConfig{
229235
CASecretRef: &corev1.SecretReference{
230236
Name: "mindthegap-tls",
231-
Namespace: v1alpha1.CarenNamespace,
237+
Namespace: deploymentNS,
232238
},
233239
}
234240
}

0 commit comments

Comments
 (0)