You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/lib/release/release.go
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ package release
2
2
3
3
import (
4
4
"encoding/json"
5
+
"slices"
5
6
"strings"
6
7
7
8
semver "github.com/blang/semver/v4"
@@ -11,14 +12,16 @@ import (
11
12
// OperatorRelease is a wrapper around a slice of semver.PRVersion which supports correct
12
13
// marshaling to YAML and JSON.
13
14
// +kubebuilder:validation:Type=string
15
+
// +kubebuilder:validation:MaxLength=20
16
+
// +kubebuilder:validation:XValidation:rule="self.matches('^[0-9A-Za-z-]+(\\\\.[0-9A-Za-z-]+)*$')",message="release version must be composed of dot-separated identifiers containing only alphanumerics and hyphens"
17
+
// +kubebuilder:validation:XValidation:rule="!self.split('.').exists(x, x.matches('^0[0-9]+$'))",message="numeric identifiers in release version must not have leading zeros"
14
18
typeOperatorReleasestruct {
15
19
Release []semver.PRVersion`json:"-"`
16
20
}
17
21
18
22
// DeepCopyInto creates a deep-copy of the Version value.
errs=append(errs, errors.ErrInvalidBundle(fmt.Sprintf("bundle name with release versioning %q does not match expected name %q", bundle.Name, expectedName), bundle.Name))
0 commit comments