From a63c4001069e05a09fc6d8d8379356bd2360bedb Mon Sep 17 00:00:00 2001 From: Boris Kuschel Date: Wed, 30 Sep 2020 09:03:56 -0400 Subject: [PATCH 1/2] Use crds in profile, if exists Signed-off-by: Boris Kuschel --- pkg/qliksense/crds.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/qliksense/crds.go b/pkg/qliksense/crds.go index 4fab11c7..62594636 100644 --- a/pkg/qliksense/crds.go +++ b/pkg/qliksense/crds.go @@ -93,11 +93,15 @@ func getQliksenseInitCrds(qcr *qapi.QliksenseCR) (string, error) { } } - qInitMsPath := filepath.Join(repoPath, Q_INIT_CRD_PATH) + qInitMsPath := filepath.Join(repoPath, "manifests", qcr.Spec.Profile, "crds") if _, err := os.Lstat(qInitMsPath); err != nil { - // older version of qliksense-init used - qInitMsPath = filepath.Join(repoPath, "manifests/base/manifests/qliksense-init") + qInitMsPath = filepath.Join(repoPath, Q_INIT_CRD_PATH) + if _, err := os.Lstat(qInitMsPath); err != nil { + // older version of qliksense-init used + qInitMsPath = filepath.Join(repoPath, "manifests/base/manifests/") + } } + qInitByte, err := ExecuteKustomizeBuild(qInitMsPath) if err != nil { fmt.Println("cannot generate crds for qliksense-init", err) From 5899760c16952b20edc887b2e4cc25c7f847e372 Mon Sep 17 00:00:00 2001 From: Boris Kuschel Date: Wed, 30 Sep 2020 09:07:01 -0400 Subject: [PATCH 2/2] retain old qliksense-init func Signed-off-by: Boris Kuschel --- pkg/qliksense/crds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/qliksense/crds.go b/pkg/qliksense/crds.go index 62594636..73601600 100644 --- a/pkg/qliksense/crds.go +++ b/pkg/qliksense/crds.go @@ -98,7 +98,7 @@ func getQliksenseInitCrds(qcr *qapi.QliksenseCR) (string, error) { qInitMsPath = filepath.Join(repoPath, Q_INIT_CRD_PATH) if _, err := os.Lstat(qInitMsPath); err != nil { // older version of qliksense-init used - qInitMsPath = filepath.Join(repoPath, "manifests/base/manifests/") + qInitMsPath = filepath.Join(repoPath, "manifests/base/manifests/qliksense-init") } }