Skip to content

Commit

Permalink
Add CRD manifest as build artifact
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Mar 3, 2022
1 parent 2c588d5 commit bc2daa5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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

0 comments on commit bc2daa5

Please sign in to comment.