Skip to content

Commit 62264f9

Browse files
author
Harrison Katz
committed
Rename clusterId -> clusterName
1 parent 7faac52 commit 62264f9

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ deploy: _deploy-check-env-vars docker-build manifests kustomize _helm_setup ## D
147147
helm upgrade $(HELM_RELEASE_NAME) $(HELM_CHART_DIR) --install \
148148
--namespace $(KUBE_NAMESPACE) \
149149
--create-namespace \
150-
--set clusterId=$(KUBE_CLUSTER_NAME) \
150+
--set clusterName=$(KUBE_CLUSTER_NAME) \
151151
--set image.repository=$(IMG) \
152152
--set image.tag="latest" \
153153
--set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"local\"\}" \
@@ -164,7 +164,7 @@ deploy_gateway: _deploy-check-env-vars docker-build manifests kustomize _helm_se
164164
helm upgrade $(HELM_RELEASE_NAME) $(HELM_CHART_DIR) --install \
165165
--namespace $(KUBE_NAMESPACE) \
166166
--create-namespace \
167-
--set clusterId=$(KUBE_CLUSTER_NAME) \
167+
--set clusterName=$(KUBE_CLUSTER_NAME) \
168168
--set image.repository=$(IMG) \
169169
--set image.tag="latest" \
170170
--set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"local\"\}" \
@@ -182,7 +182,7 @@ deploy_with_bindings: _deploy-check-env-vars docker-build manifests kustomize _h
182182
helm upgrade $(HELM_RELEASE_NAME) $(HELM_CHART_DIR) --install \
183183
--namespace $(KUBE_NAMESPACE) \
184184
--create-namespace \
185-
--set clusterId=$(KUBE_CLUSTER_NAME) \
185+
--set clusterName=$(KUBE_CLUSTER_NAME) \
186186
--set image.repository=$(IMG) \
187187
--set image.tag="latest" \
188188
--set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"local\"\}" \

cmd/api/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func main() {
9292

9393
type managerOpts struct {
9494
// flags
95-
clusterId string
95+
clusterName string
9696
releaseName string
9797
metricsAddr string
9898
electionID string
@@ -145,7 +145,7 @@ func cmd() *cobra.Command {
145145
},
146146
}
147147

148-
c.Flags().StringVar(&opts.clusterId, "cluster-id", "", "Cluster ID where the ngrok-operator is installed")
148+
c.Flags().StringVar(&opts.clusterName, "cluster-name", "", "Cluster Name where the ngrok-operator is installed")
149149
c.Flags().StringVar(&opts.releaseName, "release-name", "ngrok-operator", "Helm Release name for the deployed operator")
150150
c.Flags().StringVar(&opts.metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to")
151151
c.Flags().StringVar(&opts.probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
@@ -173,7 +173,7 @@ func cmd() *cobra.Command {
173173
c.Flags().StringVar(&opts.bindings.serviceLabels, "bindings-service-labels", "", "Service Labels to propagate to the target service")
174174
c.Flags().StringVar(&opts.bindings.ingressEndpoint, "bindings-ingress-endpoint", "", "The endpoint the bindings forwarder connects to")
175175

176-
_ = c.MarkFlagRequired("cluster-id")
176+
_ = c.MarkFlagRequired("cluster-name")
177177
_ = c.MarkFlagRequired("release-name")
178178

179179
opts.zapOpts = &zap.Options{}
@@ -659,7 +659,7 @@ func createKubernetesOperator(ctx context.Context, client client.Client, opts ma
659659
_, err := controllerutil.CreateOrUpdate(ctx, client, k8sOperator, func() error {
660660
k8sOperator.Spec = ngrokv1alpha1.KubernetesOperatorSpec{
661661
Deployment: &ngrokv1alpha1.KubernetesOperatorDeployment{
662-
Cluster: opts.clusterId,
662+
Cluster: opts.clusterName,
663663
Name: opts.releaseName,
664664
Namespace: opts.namespace,
665665
Version: version.GetVersion(),

helm/ngrok-operator/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The `ngrok-operator` helm chart now includes a `schema.json` file that can be us
143143

144144
### Added
145145

146-
- Required `.Values.clusterId` for the ngrok-operator to register with the ngrok API
146+
- Required `.Values.clusterName` for the ngrok-operator to register with the ngrok API
147147

148148
### Changed
149149

helm/ngrok-operator/templates/controller-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ spec:
6060
args:
6161
- --release-name={{ .Release.Name }}
6262
{{- if .Values.oneClickDemoMode }}
63-
- --cluster-id=one-click-demo-mode
63+
- --cluster-name=one-click-demo-mode
6464
{{- else }}
65-
- --cluster-id={{ .Values.clusterId | required "Missing required .Values.clusterId!"}}
65+
- --cluster-name={{ .Values.clusterName | required "Missing required .Values.clusterName!"}}
6666
{{- end }}
6767
{{- include "ngrok-operator.manager.cliFeatureFlags" . | nindent 8 }}
6868
{{- if .Values.oneClickDemoMode }}

helm/ngrok-operator/tests/__snapshot__/controller-deployment_test.yaml.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm/ngrok-operator/tests/controller-deployment_test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
suite: test controller-deployment
22
set:
3-
clusterId: "test-cluster"
3+
clusterName: "test-cluster"
44
templates:
55
- controller-deployment.yaml
66
# The following included templates are needed due to the way helm unittest works.
@@ -246,22 +246,22 @@ tests:
246246
- contains:
247247
path: spec.template.spec.containers[0].args
248248
content: --one-click-demo-mode
249-
- it: Should pass cluster-id
249+
- it: Should pass cluster-name
250250
template: controller-deployment.yaml
251251
documentIndex: 0 # Document 0 is the deployment since its the first template
252252
asserts:
253253
- contains:
254254
path: spec.template.spec.containers[0].args
255-
content: --cluster-id=test-cluster
256-
- it: Should pass cluster-id as demo mode when enabled
255+
content: --cluster-name=test-cluster
256+
- it: Should pass cluster-name as demo mode when enabled
257257
template: controller-deployment.yaml
258258
documentIndex: 0 # Document 0 is the deployment since its the first template
259259
set:
260260
oneClickDemoMode: true
261261
asserts:
262262
- contains:
263263
path: spec.template.spec.containers[0].args
264-
content: --cluster-id=one-click-demo-mode
264+
content: --cluster-name=one-click-demo-mode
265265
- it: Should pass log format argument if set
266266
set:
267267
log:

helm/ngrok-operator/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
##
44
## @param nameOverride String to partially override generated resource names
55
## @param fullnameOverride String to fully override generated resource names
6-
## @param clusterId String to identify the kubernetes cluster in the ngrok dashboard (must be unique per Helm release per cluster)
6+
## @param clusterName String to identify the kubernetes cluster in the ngrok dashboard (must be unique per Helm release per cluster)
77
## @param description ngrok-operator description that will appear in the ngrok dashboard
88
## @param commonLabels Labels to add to all deployed objects
99
## @param commonAnnotations Annotations to add to all deployed objects
1010
## @param oneClickDemoMode If true, then the operator will startup without required fields or API registration, become Ready, but not actually be running
1111
nameOverride: ""
1212
fullnameOverride: ""
13-
clusterId: ""
13+
clusterName: ""
1414
description: "The official ngrok Kubernetes Operator."
1515
commonLabels: {}
1616
commonAnnotations: {}

internal/controller/ngrok/kubernetesoperator_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (r *KubernetesOperatorReconciler) create(ctx context.Context, ko *ngrokv1al
136136
EnabledFeatures: calculateFeaturesEnabled(ko),
137137
Region: ko.Spec.Region,
138138
Deployment: ngrok.KubernetesOperatorDeployment{
139-
// TODO(hkatz) clusterId
139+
// TODO(hkatz) clusterName
140140
// Cluster: ko.Spec.Deployment.Cluster,
141141
Name: ko.Spec.Deployment.Name,
142142
Namespace: ko.Spec.Deployment.Namespace,
@@ -326,7 +326,7 @@ func ngrokK8sopMatchesKubernetesOperator(k8sop *ngrok.KubernetesOperator, ko *ng
326326
return false
327327
}
328328

329-
// TODO(hkatz) clusterId
329+
// TODO(hkatz) clusterName
330330
// if item.Deployment.Cluster != ko.Spec.Deployment.Cluster {
331331
// continue
332332
// }

0 commit comments

Comments
 (0)