Skip to content

Add CRD manifest as build artifact #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions hack/crdgen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"os"

v1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
_ "github.com/rancher/system-upgrade-controller/pkg/generated/controllers/upgrade.cattle.io/v1"
"github.com/rancher/wrangler/pkg/crd"
)

func main() {
plan := crd.NamespacedType("Plan.upgrade.cattle.io/v1").
WithSchemaFromStruct(v1.Plan{}).
WithColumn("Image", ".spec.upgrade.image").
WithColumn("Channel", ".spec.channel").
WithColumn("Version", ".spec.version")
crd.Print(os.Stdout, []crd.CRD{plan})
}
1 change: 1 addition & 0 deletions scripts/package-controller
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ if [ "$ARCH" = "amd64" ]; then
trap reset-kustomization EXIT
kustomize edit set image "rancher/system-upgrade-controller=${REPO}/system-upgrade-controller:${VERSION}"
kustomize build --reorder=none --output ./dist/artifacts/system-upgrade-controller.yaml
go run hack/crdgen.go > ./dist/artifacts/crd.yaml
fi