diff --git a/deploy/resources.go b/deploy/resources.go index 2923d8043..c49aabffb 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -7,3 +7,6 @@ var NotificationTemplateFS embed.FS //go:embed templates/toolchaincluster/* var ToolchainClusterTemplateFS embed.FS + +//go:embed templates/registration-service/* +var RegistrationServiceFS embed.FS diff --git a/deploy/registration-service/registration-service.yaml b/deploy/templates/registration-service/registration-service.yaml similarity index 100% rename from deploy/registration-service/registration-service.yaml rename to deploy/templates/registration-service/registration-service.yaml diff --git a/make/go.mk b/make/go.mk index 3aa7e542d..490d5daf9 100644 --- a/make/go.mk +++ b/make/go.mk @@ -64,9 +64,6 @@ generate-assets: go-bindata @rm ./test/templates/usertiers/usertier_assets.go 2>/dev/null || true @$(GO_BINDATA) -pkg usertiers_test -o ./test/templates/usertiers/usertier_assets.go -nometadata -nocompress -prefix $(USERTEMPLATES_TEST_BASEDIR) -ignore doc.go $(USERTEMPLATES_TEST_BASEDIR)/... - @echo "generating registration service template data..." - @$(GO_BINDATA) -pkg registrationservice -o ./pkg/templates/registrationservice/template_assets.go -nocompress -prefix $(REGISTRATION_SERVICE_DIR) $(REGISTRATION_SERVICE_DIR) - .PHONY: verify-dependencies ## Runs commands to verify after the updated dependecies of toolchain-common/API(go mod replace), if the repo needs any changes to be made verify-dependencies: tidy vet build test lint-go-code diff --git a/pkg/templates/registrationservice/template.go b/pkg/templates/registrationservice/template.go index 101ef9f73..52e15c5d5 100644 --- a/pkg/templates/registrationservice/template.go +++ b/pkg/templates/registrationservice/template.go @@ -1,6 +1,7 @@ package registrationservice import ( + "github.com/codeready-toolchain/host-operator/deploy" templatev1 "github.com/openshift/api/template/v1" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/kubernetes/scheme" @@ -13,7 +14,7 @@ const ResourceName = "registration-service" const ProxyRouteName = "api" func GetDeploymentTemplate() (*templatev1.Template, error) { - deployment, err := Asset("registration-service.yaml") + deployment, err := deploy.RegistrationServiceFS.ReadFile("templates/registration-service/registration-service.yaml") if err != nil { return nil, err }