Skip to content

Commit 4aa680b

Browse files
committed
Remove check to skip CSV annotation for Go types
Instead only skip when API types directory is missing.
1 parent a926ed4 commit 4aa680b

File tree

5 files changed

+2
-15
lines changed

5 files changed

+2
-15
lines changed

internal/generate/olm-catalog/csv_updaters.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
"github.com/operator-framework/operator-registry/pkg/registry"
2626
"github.com/operator-framework/operator-sdk/internal/generate/olm-catalog/descriptor"
27-
"github.com/operator-framework/operator-sdk/internal/util/projutil"
2827
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
2928

3029
"github.com/ghodss/yaml"
@@ -241,14 +240,6 @@ func (us crds) apply(csv *olmapiv1alpha1.ClusterServiceVersion) error {
241240
}
242241

243242
func updateDescriptions(csv *olmapiv1alpha1.ClusterServiceVersion, searchDir string) error {
244-
// TODO: Should this skip generating descriptions if API directory exists
245-
// but project type can't be detected due to layout differences.
246-
if opType := projutil.GetOperatorType(); opType != projutil.OperatorTypeGo {
247-
log.Infof("Skipping generation of owned CRDDescriptions from CSV annotations in %s."+
248-
" Could not detect project to be of Go type.", searchDir)
249-
return nil
250-
}
251-
252243
updatedDescriptions := []olmapiv1alpha1.CRDDescription{}
253244
for _, currDescription := range csv.Spec.CustomResourceDefinitions.Owned {
254245
group := currDescription.Name

internal/generate/olm-catalog/descriptor/descriptor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"strings"
2323

2424
olmapiv1alpha1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
25+
log "github.com/sirupsen/logrus"
2526
"k8s.io/apimachinery/pkg/runtime/schema"
2627
"k8s.io/gengo/parser"
2728
"k8s.io/gengo/types"
@@ -55,6 +56,7 @@ func GetCRDDescriptionForGVK(apisDir string, gvk schema.GroupVersionKind) (olmap
5556
return olmapiv1alpha1.CRDDescription{}, err
5657
}
5758
if !exists {
59+
log.Debugf("Could not find API types directory: %s", apisDir)
5860
return olmapiv1alpha1.CRDDescription{}, ErrAPIDirNotExist
5961
}
6062

internal/generate/testdata/go/go.mod

Lines changed: 0 additions & 1 deletion
This file was deleted.

internal/generate/testdata/non-standard-layout/go.mod

Lines changed: 0 additions & 1 deletion
This file was deleted.

internal/util/projutil/project_util.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ func GetOperatorType() OperatorType {
186186
return OperatorTypeAnsible
187187
case IsOperatorHelm():
188188
return OperatorTypeHelm
189-
// Additional case for when tests run cmds which have this check
190-
// from the SDK root
191-
case hasGoPkgFile():
192-
return OperatorTypeGo
193189
}
194190
return OperatorTypeUnknown
195191
}

0 commit comments

Comments
 (0)