Skip to content

Commit 4409ec9

Browse files
author
Arvind Thirumurugan
committed
minor fix
1 parent 36e1c9c commit 4409ec9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cmd/crdinstaller/main.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,6 @@ func main() {
122122

123123
// installCRDs installs the CRDs from the specified directory based on the mode.
124124
func installCRDs(ctx context.Context, client dynamic.Interface, crdPath, mode string, wait bool, _ int) error {
125-
// CRD GVR
126-
crdGVR := schema.GroupVersionResource{
127-
Group: "apiextensions.k8s.io",
128-
Version: "v1",
129-
Resource: "customresourcedefinitions",
130-
}
131-
132125
// Set of CRD filenames to install based on mode.
133126
crdFilesToInstall := make(map[string]bool)
134127

@@ -191,10 +184,16 @@ func installCRDs(ctx context.Context, client dynamic.Interface, crdPath, mode st
191184
return fmt.Errorf("failed to unmarshal CRD from %s: %w", path, err)
192185
}
193186

194-
// Apply CRD.
187+
// Create CRD.
195188
crdName := crd.GetName()
196189
klog.V(2).Infof("Creating CRD: %s", crdName)
197190

191+
// CRD GVR
192+
crdGVR := schema.GroupVersionResource{
193+
Group: "apiextensions.k8s.io",
194+
Version: "v1",
195+
Resource: "customresourcedefinitions",
196+
}
198197
_, err = client.Resource(crdGVR).Create(ctx, &crd, metav1.CreateOptions{})
199198
if err != nil {
200199
if apierrors.IsAlreadyExists(err) {

0 commit comments

Comments
 (0)