diff --git a/Makefile b/Makefile index f2fabd1f280c..24e527631cc8 100644 --- a/Makefile +++ b/Makefile @@ -123,14 +123,13 @@ $(foreach gv,$(api_group_versions),$(eval $(foreach t,$(api_group_version_target controller_gen_targets := $(foreach gv,$(api_group_versions),pkg/apis/$(gv)/.controller-gen.stamp) codegen_targets := $(controller_gen_targets) $(controller_gen_targets): .k0sbuild.docker-image.k0s hack/tools/boilerplate.go.txt hack/tools/Makefile.variables - rm -rf 'static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))CustomResourceDefinition' - mkdir -p 'static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))' + rm -rf 'static/_crds/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))' gendir="$$(mktemp -d .controller-gen.XXXXXX.tmp)" \ && trap "rm -rf -- $$gendir" INT EXIT \ && CGO_ENABLED=0 $(GO) run sigs.k8s.io/controller-tools/cmd/controller-gen@v$(controller-gen_version) \ paths="./$(dir $@)..." \ object:headerFile=hack/tools/boilerplate.go.txt output:object:dir="$$gendir" \ - crd output:crd:dir='static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))CustomResourceDefinition' \ + crd output:crd:dir='static/_crds/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))' \ && mv -f -- "$$gendir"/zz_generated.deepcopy.go '$(dir $@).' touch -- '$@' @@ -167,12 +166,12 @@ pkg/client/clientset/.client-gen.stamp: .k0sbuild.docker-image.k0s hack/tools/bo touch -- '$@' codegen_targets += static/zz_generated_assets.go -static/zz_generated_assets.go: $(controller_gen_targets) # to generate the CRDs into static/manifests/*/CustomResourceDefinition +static/zz_generated_assets.go: $(controller_gen_targets) # to generate the CRDs into static/_crds/* static/zz_generated_assets.go: $(shell find static/manifests/calico static/manifests/windows static/misc -type f) static/zz_generated_assets.go: .k0sbuild.docker-image.k0s hack/tools/Makefile.variables CGO_ENABLED=0 $(GO) run github.com/kevinburke/go-bindata/go-bindata@v$(go-bindata_version) \ -o '$@' -pkg static -prefix static \ - $(foreach gv,$(api_group_versions),static/manifests/$(dir $(gv))CustomResourceDefinition/...) \ + $(foreach gv,$(api_group_versions),static/_crds/$(dir $(gv))...) \ static/manifests/calico/... \ static/manifests/windows/... \ static/misc/... diff --git a/pkg/component/controller/crd.go b/pkg/component/controller/crd.go index ba82fa57c8cc..147f146b464b 100644 --- a/pkg/component/controller/crd.go +++ b/pkg/component/controller/crd.go @@ -70,7 +70,7 @@ func (c CRD) Init(_ context.Context) error { // Run unpacks manifests from bindata func (c CRD) Start(_ context.Context) error { - crdAssetsPath := path.Join("manifests", c.assetsDir, "CustomResourceDefinition") + crdAssetsPath := path.Join("_crds", c.assetsDir) crds, err := static.AssetDir(crdAssetsPath) if err != nil { return fmt.Errorf("can't unbundle CRD `%s` manifests: %w", c.bundle, err) diff --git a/static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_controlnodes.yaml b/static/_crds/autopilot/autopilot.k0sproject.io_controlnodes.yaml similarity index 100% rename from static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_controlnodes.yaml rename to static/_crds/autopilot/autopilot.k0sproject.io_controlnodes.yaml diff --git a/static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_plans.yaml b/static/_crds/autopilot/autopilot.k0sproject.io_plans.yaml similarity index 100% rename from static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_plans.yaml rename to static/_crds/autopilot/autopilot.k0sproject.io_plans.yaml diff --git a/static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_updateconfigs.yaml b/static/_crds/autopilot/autopilot.k0sproject.io_updateconfigs.yaml similarity index 100% rename from static/manifests/autopilot/CustomResourceDefinition/autopilot.k0sproject.io_updateconfigs.yaml rename to static/_crds/autopilot/autopilot.k0sproject.io_updateconfigs.yaml diff --git a/static/manifests/etcd/CustomResourceDefinition/etcd.k0sproject.io_etcdmembers.yaml b/static/_crds/etcd/etcd.k0sproject.io_etcdmembers.yaml similarity index 100% rename from static/manifests/etcd/CustomResourceDefinition/etcd.k0sproject.io_etcdmembers.yaml rename to static/_crds/etcd/etcd.k0sproject.io_etcdmembers.yaml diff --git a/static/manifests/helm/CustomResourceDefinition/helm.k0sproject.io_charts.yaml b/static/_crds/helm/helm.k0sproject.io_charts.yaml similarity index 100% rename from static/manifests/helm/CustomResourceDefinition/helm.k0sproject.io_charts.yaml rename to static/_crds/helm/helm.k0sproject.io_charts.yaml diff --git a/static/manifests/k0s/CustomResourceDefinition/k0s.k0sproject.io_clusterconfigs.yaml b/static/_crds/k0s/k0s.k0sproject.io_clusterconfigs.yaml similarity index 100% rename from static/manifests/k0s/CustomResourceDefinition/k0s.k0sproject.io_clusterconfigs.yaml rename to static/_crds/k0s/k0s.k0sproject.io_clusterconfigs.yaml