Skip to content

Commit 1d4b959

Browse files
committed
fix admission unit test
Signed-off-by: perdasilva <[email protected]>
1 parent a05c983 commit 1d4b959

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

controllers/admission_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55

66
. "github.com/onsi/ginkgo/v2"
77
. "github.com/onsi/gomega"
8-
operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
98
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9+
10+
operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
1011
)
1112

1213
func operator(spec operatorsv1alpha1.OperatorSpec) *operatorsv1alpha1.Operator {
@@ -68,7 +69,7 @@ var _ = Describe("Operator Spec Validations", func() {
6869
}))
6970

7071
Expect(err).To(HaveOccurred(), "expected error for invalid semver %q", invalidSemver)
71-
Expect(err.Error()).To(ContainSubstring("spec.version in body should match '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*))?$"))
72+
Expect(err.Error()).To(ContainSubstring("spec.version in body should match '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-(0|[1-9]\\d*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*))?$'"))
7273
}
7374
})
7475
})

0 commit comments

Comments
 (0)