Skip to content

Commit 4bc4aaa

Browse files
oktalzGopher Bot
authored andcommitted
BUG/MINOR: job: on crd upgrade account that validation rules have different annotation for version
1 parent f4ca7dd commit 4bc4aaa

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/job/crd-check.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ func CRDRefresh(log utils.Logger, osArgs utils.OSArgs) error {
7373
crd.ObjectMeta.ResourceVersion = existingVersion.ObjectMeta.ResourceVersion
7474
if versions[0].Name == "v3" {
7575
cnInK8s, ok := existingVersion.ObjectMeta.Annotations["haproxy.org/client-native"]
76+
if !ok {
77+
cnInK8s, ok = existingVersion.ObjectMeta.Annotations["haproxy.org/custom-annotations"]
78+
}
7679

7780
needUpgrade := false
7881
if !ok {
7982
needUpgrade = true
8083
}
81-
cnNew := crd.ObjectMeta.Annotations["haproxy.org/client-native"]
84+
cnNew, ok := crd.ObjectMeta.Annotations["haproxy.org/client-native"]
85+
if !ok {
86+
cnNew = crd.ObjectMeta.Annotations["haproxy.org/custom-annotations"]
87+
}
8288
vK8s, err := semver.NewVersion(cnInK8s)
8389
if err != nil {
8490
needUpgrade = true

0 commit comments

Comments
 (0)