Skip to content

Commit 1bcc22b

Browse files
authored
Merge pull request #56 from PDOK/no-jira-label-old-new
Operator gebruikt v2 labels daarover crashed v3
2 parents 350fb33 + 4ba07ca commit 1bcc22b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

internal/controller/shared_controller.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,18 +524,30 @@ func makeUptimeName[O pdoknlv3.WMSWFS](obj O) (string, error) {
524524

525525
datasetID, ok := obj.GetLabels()["dataset"]
526526
if !ok {
527-
return "", errors.New("dataset label not found in object")
527+
// V3 label
528+
datasetID, ok = obj.GetLabels()["pdok.nl/dataset-id"]
529+
if !ok {
530+
return "", errors.New("dataset label not found in object")
531+
}
528532
}
529533
parts = append(parts, strings.ReplaceAll(datasetID, "-", ""))
530534

531535
theme, ok := obj.GetLabels()["theme"]
536+
if !ok {
537+
// V3 label
538+
theme, ok = obj.GetLabels()["pdok.nl/tag"]
539+
}
540+
532541
if ok {
533542
parts = append(parts, strings.ReplaceAll(theme, "-", ""))
534543
}
535544

536545
version, ok := obj.GetLabels()["service-version"]
537546
if !ok {
538-
return "", errors.New("service-version label not found in object")
547+
version, ok = obj.GetLabels()["pdok.nl/service-version"]
548+
if !ok {
549+
return "", errors.New("service-version label not found in object")
550+
}
539551
}
540552
parts = append(parts, version)
541553

0 commit comments

Comments
 (0)