Skip to content

Commit cd332aa

Browse files
Merge pull request #265 from sttts/sttts-crd-v1-wait-v1beta1
apiext: wait for CRD using v1beta1 for compatibility on upgrades
2 parents 83f1a16 + 42a0804 commit cd332aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/resourcebuilder/apiext.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ func (b *crdBuilder) Do(ctx context.Context) error {
7171
}
7272

7373
if updated {
74-
return waitForCustomResourceDefinitionCompletion(ctx, b.clientV1, name)
74+
return waitForCustomResourceDefinitionCompletion(ctx, b.clientV1beta1, name)
7575
}
7676
return nil
7777
}
7878

79-
func waitForCustomResourceDefinitionCompletion(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, crd string) error {
79+
func waitForCustomResourceDefinitionCompletion(ctx context.Context, client apiextclientv1beta1.CustomResourceDefinitionsGetter, crd string) error {
8080
return wait.PollImmediateUntil(defaultObjectPollInterval, func() (bool, error) {
8181
c, err := client.CustomResourceDefinitions().Get(crd, metav1.GetOptions{})
8282
if errors.IsNotFound(err) {
@@ -89,7 +89,7 @@ func waitForCustomResourceDefinitionCompletion(ctx context.Context, client apiex
8989
}
9090

9191
for _, condition := range c.Status.Conditions {
92-
if condition.Type == apiextv1.Established && condition.Status == apiextv1.ConditionTrue {
92+
if condition.Type == apiextv1beta1.Established && condition.Status == apiextv1beta1.ConditionTrue {
9393
return true, nil
9494
}
9595
}

0 commit comments

Comments
 (0)