Skip to content

Commit

Permalink
lib/resourcebuilder/apiext: Error on unrecognized CRD version
Browse files Browse the repository at this point in the history
Error for unrecognized CRD version, because that will be easier to
debug than trying to figure out why a CRD manifest is being silently
ignored by the CVO (which is what we've done since the version switch
landed in 4ee7b07, Add apiextensions.k8s.io/v1 support for CRDs,
2019-10-22, #259).
  • Loading branch information
wking committed Jul 8, 2020
1 parent 8b9931b commit 7027544
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/resourcebuilder/apiext.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resourcebuilder

import (
"context"
"fmt"

"k8s.io/klog"

Expand Down Expand Up @@ -68,6 +69,8 @@ func (b *crdBuilder) Do(ctx context.Context) error {
return err
}
name = crd.Name
default:
return fmt.Error("unrecognized CustomResourceDefinition version: %v", crd.(type))
}

if updated {
Expand Down

0 comments on commit 7027544

Please sign in to comment.