diff --git a/pkg/crd/crds.go b/pkg/crd/crds.go new file mode 100644 index 000000000000..5028f57a8572 --- /dev/null +++ b/pkg/crd/crds.go @@ -0,0 +1,15 @@ +package crd + +import ( + v1 "github.com/k3s-io/k3s/pkg/apis/k3s.cattle.io/v1" + "github.com/rancher/wrangler/pkg/crd" +) + +func List() []crd.CRD { + addon := crd.NamespacedType("Addon.k3s.cattle.io/v1"). + WithSchemaFromStruct(v1.Addon{}). + WithColumn("Source", ".status.source"). + WithColumn("Checksum", ".status.checksum") + + return []crd.CRD{addon} +} diff --git a/pkg/server/context.go b/pkg/server/context.go index 22408cac783f..0ad06230dc54 100644 --- a/pkg/server/context.go +++ b/pkg/server/context.go @@ -6,7 +6,9 @@ import ( "os" "runtime" + helmcrd "github.com/k3s-io/helm-controller/pkg/crd" "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io" + addoncrd "github.com/k3s-io/k3s/pkg/crd" "github.com/k3s-io/k3s/pkg/deploy" "github.com/k3s-io/k3s/pkg/generated/controllers/k3s.cattle.io" "github.com/k3s-io/k3s/pkg/version" @@ -82,10 +84,8 @@ func crds(ctx context.Context, config *rest.Config) error { return err } - factory.BatchCreateCRDs(ctx, crd.NamespacedTypes( - "Addon.k3s.cattle.io/v1", - "HelmChart.helm.cattle.io/v1", - "HelmChartConfig.helm.cattle.io/v1")...) + types := append(helmcrd.List(), addoncrd.List()...) + factory.BatchCreateCRDs(ctx, types...) return factory.BatchWait() }