@@ -21,7 +21,7 @@ import (
2121
2222 . "github.com/onsi/ginkgo"
2323 . "github.com/onsi/gomega"
24- apiv1 "github.com/operator-framework/api/pkg/operators/v1 "
24+ apiv2 "github.com/operator-framework/api/pkg/operators/v2 "
2525 "k8s.io/apimachinery/pkg/api/meta"
2626 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727 "k8s.io/apimachinery/pkg/runtime"
@@ -32,8 +32,8 @@ import (
3232)
3333
3434const (
35- conditionFoo apiv1 .ConditionType = "conditionFoo"
36- conditionBar apiv1 .ConditionType = "conditionBar"
35+ conditionFoo apiv2 .ConditionType = "conditionFoo"
36+ conditionBar apiv2 .ConditionType = "conditionBar"
3737)
3838
3939var _ = Describe ("Condition" , func () {
@@ -46,7 +46,7 @@ var _ = Describe("Condition", func() {
4646
4747 BeforeEach (func () {
4848 sch := runtime .NewScheme ()
49- err = apiv1 .AddToScheme (sch )
49+ err = apiv2 .AddToScheme (sch )
5050 Expect (err ).NotTo (HaveOccurred ())
5151 cl = fake .NewClientBuilder ().WithScheme (sch ).Build ()
5252 })
@@ -75,17 +75,17 @@ var _ = Describe("Condition", func() {
7575 })
7676
7777 Describe ("Get/Set" , func () {
78- var operatorCond * apiv1 .OperatorCondition
78+ var operatorCond * apiv2 .OperatorCondition
7979
8080 objKey := types.NamespacedName {
8181 Name : "operator-condition-test" ,
8282 Namespace : ns ,
8383 }
8484
8585 BeforeEach (func () {
86- operatorCond = & apiv1 .OperatorCondition {
86+ operatorCond = & apiv2 .OperatorCondition {
8787 ObjectMeta : metav1.ObjectMeta {Name : "operator-condition-test" , Namespace : ns },
88- Status : apiv1. OperatorConditionStatus {
88+ Spec : apiv2. OperatorConditionSpec {
8989 Conditions : []metav1.Condition {
9090 {
9191 Type : string (conditionFoo ),
@@ -107,7 +107,7 @@ var _ = Describe("Condition", func() {
107107
108108 // create a new client
109109 sch := runtime .NewScheme ()
110- err = apiv1 .AddToScheme (sch )
110+ err = apiv2 .AddToScheme (sch )
111111 Expect (err ).NotTo (HaveOccurred ())
112112 cl = fake .NewClientBuilder ().WithScheme (sch ).Build ()
113113
@@ -171,12 +171,12 @@ var _ = Describe("Condition", func() {
171171 Expect (err ).NotTo (HaveOccurred ())
172172
173173 By ("fetching the condition from cluster" )
174- op := & apiv1 .OperatorCondition {}
174+ op := & apiv2 .OperatorCondition {}
175175 err = cl .Get (ctx , objKey , op )
176176 Expect (err ).NotTo (HaveOccurred ())
177177
178178 By ("checking if the condition has been updated" )
179- res := op .Status .Conditions [0 ]
179+ res := op .Spec .Conditions [0 ]
180180 Expect (res .Message ).To (BeEquivalentTo ("test" ))
181181 Expect (res .Status ).To (BeEquivalentTo (metav1 .ConditionFalse ))
182182 Expect (res .Reason ).To (BeEquivalentTo ("not_in_foo_state" ))
@@ -190,12 +190,12 @@ var _ = Describe("Condition", func() {
190190 Expect (err ).NotTo (HaveOccurred ())
191191
192192 By ("fetching the condition from cluster" )
193- op := & apiv1 .OperatorCondition {}
193+ op := & apiv2 .OperatorCondition {}
194194 err = cl .Get (ctx , objKey , op )
195195 Expect (err ).NotTo (HaveOccurred ())
196196
197197 By ("checking if the condition has been updated" )
198- res := op .Status .Conditions
198+ res := op .Spec .Conditions
199199 Expect (len (res )).To (BeEquivalentTo (2 ))
200200 Expect (meta .IsStatusConditionTrue (res , string (conditionBar ))).To (BeTrue ())
201201 })
0 commit comments