Skip to content

Commit 539ed91

Browse files
committed
fixup! chore: rename ubuntu identifiers to opensuse across tests, docs and samples
Signed-off-by: Alessio Biancalana <alessio.biancalana@suse.com>
1 parent 94aefd1 commit 539ed91

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

internal/podworkload/workload.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ func parseDeployment(podName, templateHash string) (string, workloadkind.Kind) {
3636
//
3737
// Concrete examples:
3838
// 1. Regular case
39-
// deployment-name: opensuse-deployment-674bcc58f4-pwvps
40-
// pod-name: opensuse-deployment
39+
// deployment-name: ubuntu-deployment-674bcc58f4-pwvps
40+
// pod-name: ubuntu-deployment
4141
//
4242
// 2. 63 characters
43-
// deployment-name: opensuse-deploymentttttttttttttttttttttttttttttttttttttttttttt
44-
// pod-name: opensuse-deploymenttttttttttttttttttttttttttttttttttttttttq8fcg
43+
// deployment-name: ubuntu-deploymentttttttttttttttttttttttttttttttttttttttttttttt
44+
// pod-name: ubuntu-deploymenttttttttttttttttttttttttttttttttttttttttttq8fcg
4545
// In this case we have just the final [random(q8fcg)] without the `-`. The name of the deployment is truncated.
4646
//
4747
// 3. 56 characters
48-
// deployment-name: opensuse-deploymentttttttttttttttttttttttttttttttttttt-t
49-
// pod-name: opensuse-deploymentttttttttttttttttttttttttttttttttttt-t-65fb8c
48+
// deployment-name: ubuntu-deploymentttttttttttttttttttttttttttttttttttttt-t
49+
// pod-name: ubuntu-deploymentttttttttttttttttttttttttttttttttttttt-t-65fb8c
5050
// In this case `-[hash]-[random]` are just collapsed into `-65fb8c` but the name is not truncated
5151

5252
// first we trim the random suffix, we always have it.
5353
// Example:
54-
// from: opensuse-deployment-674bcc58f4-pwvps
55-
// to: opensuse-deployment-674bcc58f4-
54+
// from: ubuntu-deployment-674bcc58f4-pwvps
55+
// to: ubuntu-deployment-674bcc58f4-
5656
podPrefixWithPartialHash := podName[:len(podName)-randomSuffixLen]
5757

5858
// we first try a match with the exactPattern, if we don't find it we will look for a partial match
@@ -77,12 +77,12 @@ func parseDaemonSet(podName string) (string, workloadkind.Kind) {
7777
//
7878
// Concrete examples:
7979
// 1. Regular case
80-
// daemonset-name: opensuse-daemonset
81-
// pod-name: opensuse-daemonset-6qq8v
80+
// daemonset-name: ubuntu-daemonset
81+
// pod-name: ubuntu-daemonset-6qq8v
8282
//
8383
// 2. Long case
84-
// daemonset-name: opensuse-daemonsetttttttttttttttttttttttttttttttttttttttttttttttttt
85-
// pod-name: opensuse-daemonsettttttttttttttttttttttttttttttttttttttttt6qq8v
84+
// daemonset-name: ubuntu-daemonsetttttttttttttttttttttttttttttttttttttttttttttttttttt
85+
// pod-name: ubuntu-daemonsettttttttttttttttttttttttttttttttttttttttttt6qq8v
8686
// So the name of the daemonset is truncated and the `-` will be omitted.
8787

8888
// we remove the suffix that is always present

internal/podworkload/workload_test.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ func TestGetWorkloadInfo(t *testing.T) {
2323
{
2424
name: "deployment",
2525
pod: podInfo{
26-
name: "opensuse-deployment-674bcc58f4-pwvps",
26+
name: "ubuntu-deployment-674bcc58f4-pwvps",
2727
labels: map[string]string{
2828
podTemplateHashLabel: "674bcc58f4",
2929
},
3030
},
31-
wantName: "opensuse-deployment",
31+
wantName: "ubuntu-deployment",
3232
wantType: workloadkind.Deployment,
3333
},
3434
{
@@ -79,26 +79,26 @@ func TestGetWorkloadInfo(t *testing.T) {
7979
{
8080
name: "statefulset",
8181
pod: podInfo{
82-
name: "opensuse-statefulset-0",
82+
name: "ubuntu-statefulset-0",
8383
labels: map[string]string{
8484
"apps.kubernetes.io/pod-index": "0",
85-
"controller-revision-hash": "opensuse-statefulset-7b5845dd9c",
86-
statefulsetLabel: "opensuse-statefulset-0",
85+
"controller-revision-hash": "ubuntu-statefulset-7b5845dd9c",
86+
statefulsetLabel: "ubuntu-statefulset-0",
8787
},
8888
},
89-
wantName: "opensuse-statefulset",
89+
wantName: "ubuntu-statefulset",
9090
wantType: workloadkind.StatefulSet,
9191
},
9292
{
9393
name: "daemonset",
9494
pod: podInfo{
95-
name: "opensuse-daemonset-6qq8v",
95+
name: "ubuntu-daemonset-6qq8v",
9696
labels: map[string]string{
9797
daemonsetLabel: "568bcd7685",
9898
"pod-template-generation": "1",
9999
},
100100
},
101-
wantName: "opensuse-daemonset",
101+
wantName: "ubuntu-daemonset",
102102
wantType: workloadkind.DaemonSet,
103103
},
104104
{
@@ -128,73 +128,73 @@ func TestGetWorkloadInfo(t *testing.T) {
128128
{
129129
name: "cronjob both label",
130130
pod: podInfo{
131-
name: "opensuse-cronjob-29483273-vthf9",
131+
name: "ubuntu-cronjob-29483273-vthf9",
132132
labels: map[string]string{
133133
"batch.kubernetes.io/controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
134-
newJobNameLabel: "opensuse-cronjob-29483273",
134+
newJobNameLabel: "ubuntu-cronjob-29483273",
135135
"controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
136-
oldJobNameLabel: "opensuse-cronjob-29483273",
136+
oldJobNameLabel: "ubuntu-cronjob-29483273",
137137
},
138138
},
139-
wantName: "opensuse-cronjob",
139+
wantName: "ubuntu-cronjob",
140140
wantType: workloadkind.CronJob,
141141
},
142142
{
143143
name: "cronjob new label only",
144144
pod: podInfo{
145-
name: "opensuse-cronjob-29483273-vthf9",
145+
name: "ubuntu-cronjob-29483273-vthf9",
146146
labels: map[string]string{
147147
"batch.kubernetes.io/controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
148148
"controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
149-
newJobNameLabel: "opensuse-cronjob-29483273",
149+
newJobNameLabel: "ubuntu-cronjob-29483273",
150150
},
151151
},
152-
wantName: "opensuse-cronjob",
152+
wantName: "ubuntu-cronjob",
153153
wantType: workloadkind.CronJob,
154154
},
155155
{
156156
name: "cronjob old label only",
157157
pod: podInfo{
158-
name: "opensuse-cronjob-29483273-vthf9",
158+
name: "ubuntu-cronjob-29483273-vthf9",
159159
labels: map[string]string{
160160
"batch.kubernetes.io/controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
161161
"controller-uid": "0bebfe37-e018-4ff3-86fa-74cdd8dc2c67",
162-
oldJobNameLabel: "opensuse-cronjob-29483273",
162+
oldJobNameLabel: "ubuntu-cronjob-29483273",
163163
},
164164
},
165-
wantName: "opensuse-cronjob",
165+
wantName: "ubuntu-cronjob",
166166
wantType: workloadkind.CronJob,
167167
},
168168
{
169169
name: "job",
170170
pod: podInfo{
171-
name: "opensuse-job-9bq97",
171+
name: "ubuntu-job-9bq97",
172172
labels: map[string]string{
173173
"batch.kubernetes.io/controller-uid": "bdd392e0-262c-4fdf-8825-6e7d7351fec9",
174-
newJobNameLabel: "opensuse-job",
174+
newJobNameLabel: "ubuntu-job",
175175
"controller-uid": "bdd392e0-262c-4fdf-8825-6e7d7351fec9",
176-
oldJobNameLabel: "opensuse-job",
176+
oldJobNameLabel: "ubuntu-job",
177177
},
178178
},
179-
wantName: "opensuse-job",
179+
wantName: "ubuntu-job",
180180
wantType: workloadkind.Job,
181181
},
182182
{
183183
name: "simple pod",
184184
pod: podInfo{
185-
name: "opensuse-pod",
185+
name: "ubuntu-pod",
186186
labels: map[string]string{},
187187
},
188-
wantName: "opensuse-pod",
188+
wantName: "ubuntu-pod",
189189
wantType: workloadkind.Pod,
190190
},
191191
{
192192
name: "replicaset ignored",
193193
pod: podInfo{
194-
name: "opensuse-replicaset-rnswg",
194+
name: "ubuntu-replicaset-rnswg",
195195
labels: map[string]string{},
196196
},
197-
wantName: "opensuse-replicaset-rnswg",
197+
wantName: "ubuntu-replicaset-rnswg",
198198
wantType: workloadkind.Pod,
199199
},
200200
}

0 commit comments

Comments
 (0)