Skip to content

Commit

Permalink
fix the label cannot be number (#531)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
  • Loading branch information
zhiweiyin318 authored Jun 19, 2024
1 parent 74f4c92 commit 12baec9
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
open-cluster-management.io/aggregate-to-work: "true"
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
app: klusterlet-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand All @@ -23,7 +23,7 @@ spec:
app: klusterlet-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
app: klusterlet-registration-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand All @@ -23,7 +23,7 @@ spec:
app: klusterlet-registration-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
app: klusterlet-manifestwork-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand All @@ -23,7 +23,7 @@ spec:
app: klusterlet-manifestwork-agent
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion manifests/klusterlet/management/klusterlet-work-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{ if gt (len .Labels) 0 }}
{{ range $key, $value := .Labels }}
{{ $key }}: {{ $value }}
"{{ $key }}": "{{ $value }}"
{{ end }}
{{ end }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func TestSyncDeploySingleton(t *testing.T) {

for _, c := range cases {
klusterlet := newKlusterlet("klusterlet", "testns", "cluster1")
klusterlet.SetLabels(map[string]string{"test": "test", "abc": "abc"})
klusterlet.SetLabels(map[string]string{"test": "123", "abc": "abc", "123": "213"})
klusterlet.Spec.DeployOption.Mode = operatorapiv1.InstallModeSingleton
bootStrapSecret := newSecret(helpers.BootstrapHubKubeConfig, "testns")
hubKubeConfigSecret := newSecret(helpers.HubKubeConfig, "testns")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/operator/klusterlet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
klusterlet = &operatorapiv1.Klusterlet{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("klusterlet-%s", rand.String(6)),
Labels: map[string]string{"test": "test", "component": "klusterlet"},
Labels: map[string]string{"test": "123", "component": "klusterlet", "123": "312"},
},
Spec: operatorapiv1.KlusterletSpec{
RegistrationImagePullSpec: "quay.io/open-cluster-management/registration",
Expand Down

0 comments on commit 12baec9

Please sign in to comment.