Skip to content

Commit

Permalink
fix(openapi): add InstallMode definition
Browse files Browse the repository at this point in the history
Had to add openapi-gen tag in clusterserviceversion_types.go and
adjusted Makefile to pick it up.
  • Loading branch information
Jeff Peeler committed Feb 11, 2019
1 parent 3ca040c commit d649858
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ codegen:
cp scripts/generate_groups.sh vendor/k8s.io/code-generator/generate_groups.sh
mkdir -p vendor/k8s.io/code-generator/hack
cp boilerplate.go.txt vendor/k8s.io/code-generator/hack/boilerplate.go.txt
go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go --logtostderr -i ./vendor/k8s.io/apimachinery/pkg/runtime,./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./vendor/k8s.io/apimachinery/pkg/version,./pkg/package-server/apis/packagemanifest/v1alpha1 -p $(PKG)/pkg/package-server/apis/openapi -O zz_generated.openapi -h boilerplate.go.txt -r /dev/null
go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go --logtostderr -i ./vendor/k8s.io/apimachinery/pkg/runtime,./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./vendor/k8s.io/apimachinery/pkg/version,./pkg/package-server/apis/packagemanifest/v1alpha1,./pkg/api/apis/operators/v1alpha1 -p $(PKG)/pkg/package-server/apis/openapi -O zz_generated.openapi -h boilerplate.go.txt -r /dev/null
$(CODEGEN) all $(PKG)/pkg/api/client $(PKG)/pkg/api/apis "operators:v1alpha1,v1alpha2"
$(CODEGEN) all $(PKG)/pkg/package-server/client $(PKG)/pkg/package-server/apis "packagemanifest:v1alpha1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
)

// InstallMode associates an InstallModeType with a flag representing if the CSV supports it
// +k8s:openapi-gen=true
type InstallMode struct {
Type InstallModeType `json:"type"`
Supported bool `json:"supported"`
Expand Down
27 changes: 27 additions & 0 deletions pkg/package-server/apis/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v1alpha1

import (
"github.com/coreos/go-semver/semver"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
operatorv1alpha1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -101,7 +101,7 @@ type CSVDescription struct {
LongDescription string `json:"description,omitempty"`

// InstallModes specify supported installation types
InstallModes []v1alpha1.InstallMode `json:"installModes,omitempty"`
InstallModes []operatorv1alpha1.InstallMode `json:"installModes,omitempty"`
}

// AppLink defines a link to an application
Expand Down

0 comments on commit d649858

Please sign in to comment.