Skip to content

Commit 5d5eff3

Browse files
committed
Operator gebruikt v2 labels daarover crashed v3
1 parent 178716c commit 5d5eff3

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

internal/controller/shared_controller.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,24 +515,40 @@ func makeUptimeName[O pdoknlv3.WMSWFS](obj O) (string, error) {
515515

516516
ownerID, ok := obj.GetLabels()["dataset-owner"]
517517
if !ok {
518-
return "", errors.New("dataset-owner label not found in object")
518+
// Ve label
519+
ownerID, ok = obj.GetLabels()["pdok.nl/owner-id"]
520+
if !ok {
521+
return "", errors.New("dataset-owner and pdok.nl/owner-id labels are not found in object")
522+
}
519523
}
520524
parts = append(parts, strings.ToUpper(strings.ReplaceAll(ownerID, "-", "")))
521525

522526
datasetID, ok := obj.GetLabels()["dataset"]
523527
if !ok {
524-
return "", errors.New("dataset label not found in object")
528+
// V3 label
529+
datasetID, ok = obj.GetLabels()["pdok.nl/dataset-id"]
530+
if !ok {
531+
return "", errors.New("dataset label not found in object")
532+
}
525533
}
526534
parts = append(parts, strings.ReplaceAll(datasetID, "-", ""))
527535

528536
theme, ok := obj.GetLabels()["theme"]
537+
if !ok {
538+
// V3 label
539+
theme, ok = obj.GetLabels()["pdok.nl/tag"]
540+
}
541+
529542
if ok {
530543
parts = append(parts, strings.ReplaceAll(theme, "-", ""))
531544
}
532545

533546
version, ok := obj.GetLabels()["service-version"]
534547
if !ok {
535-
return "", errors.New("service-version label not found in object")
548+
version, ok = obj.GetLabels()["pdok.nl/service-version"]
549+
if !ok {
550+
return "", errors.New("service-version label not found in object")
551+
}
536552
}
537553
parts = append(parts, version)
538554

0 commit comments

Comments
 (0)