Skip to content

Commit bc2daa5

Browse files
committed
Add CRD manifest as build artifact
Signed-off-by: Brad Davidson <[email protected]>
1 parent 2c588d5 commit bc2daa5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

hack/crdgen.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
v1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
7+
_ "github.com/rancher/system-upgrade-controller/pkg/generated/controllers/upgrade.cattle.io/v1"
8+
"github.com/rancher/wrangler/pkg/crd"
9+
)
10+
11+
func main() {
12+
plan := crd.NamespacedType("Plan.upgrade.cattle.io/v1").
13+
WithSchemaFromStruct(v1.Plan{}).
14+
WithColumn("Image", ".spec.upgrade.image").
15+
WithColumn("Channel", ".spec.channel").
16+
WithColumn("Version", ".spec.version")
17+
crd.Print(os.Stdout, []crd.CRD{plan})
18+
}

scripts/package-controller

+1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ if [ "$ARCH" = "amd64" ]; then
3535
trap reset-kustomization EXIT
3636
kustomize edit set image "rancher/system-upgrade-controller=${REPO}/system-upgrade-controller:${VERSION}"
3737
kustomize build --reorder=none --output ./dist/artifacts/system-upgrade-controller.yaml
38+
go run hack/crdgen.go > ./dist/artifacts/crd.yaml
3839
fi

0 commit comments

Comments
 (0)