File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package resourcebuilder
2
2
3
3
import (
4
4
"context"
5
+ "fmt"
5
6
6
7
"k8s.io/klog"
7
8
@@ -49,25 +50,27 @@ func (b *crdBuilder) Do(ctx context.Context) error {
49
50
var err error
50
51
var name string
51
52
52
- switch crd := crd .(type ) {
53
+ switch typedCRD := crd .(type ) {
53
54
case * apiextv1beta1.CustomResourceDefinition :
54
55
if b .modifier != nil {
55
- b .modifier (crd )
56
+ b .modifier (typedCRD )
56
57
}
57
- _ , updated , err = resourceapply .ApplyCustomResourceDefinitionV1beta1 (b .clientV1beta1 , crd )
58
+ _ , updated , err = resourceapply .ApplyCustomResourceDefinitionV1beta1 (b .clientV1beta1 , typedCRD )
58
59
if err != nil {
59
60
return err
60
61
}
61
- name = crd .Name
62
+ name = typedCRD .Name
62
63
case * apiextv1.CustomResourceDefinition :
63
64
if b .modifier != nil {
64
- b .modifier (crd )
65
+ b .modifier (typedCRD )
65
66
}
66
- _ , updated , err = resourceapply .ApplyCustomResourceDefinitionV1 (b .clientV1 , crd )
67
+ _ , updated , err = resourceapply .ApplyCustomResourceDefinitionV1 (b .clientV1 , typedCRD )
67
68
if err != nil {
68
69
return err
69
70
}
70
- name = crd .Name
71
+ name = typedCRD .Name
72
+ default :
73
+ return fmt .Errorf ("unrecognized CustomResourceDefinition version: %T" , crd )
71
74
}
72
75
73
76
if updated {
You can’t perform that action at this time.
0 commit comments