From d9e78b4defa4c046386158c224751ad4294c3c2b Mon Sep 17 00:00:00 2001 From: Wen Zhou Date: Thu, 30 May 2024 07:12:15 +0200 Subject: [PATCH] fix: wrong path when use devFlag + wrong default value + special name in (#1024) trustyai Signed-off-by: Wen Zhou --- ...er.opendatahub.io_datascienceclusters.yaml | 22 ++++---- components/component.go | 4 +- components/kueue/kueue.go | 2 +- .../trainingoperator/trainingoperator.go | 2 +- components/trustyai/trustyai.go | 9 +-- ...er.opendatahub.io_datascienceclusters.yaml | 55 +++++++++++-------- docs/api-overview.md | 2 +- 7 files changed, 54 insertions(+), 42 deletions(-) diff --git a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml index ac1ae15e029..4d8ca33b3c5 100644 --- a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml +++ b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml @@ -53,7 +53,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -96,7 +96,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -140,7 +140,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -198,7 +198,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -301,7 +301,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -345,7 +345,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -388,7 +388,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -431,7 +431,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -474,7 +474,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -517,7 +517,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string @@ -560,7 +560,7 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to the folder containing manifests in a repository type: string diff --git a/components/component.go b/components/component.go index 82cec3124bd..0ec07abc04e 100644 --- a/components/component.go +++ b/components/component.go @@ -64,9 +64,9 @@ type ManifestsConfig struct { // +operator-sdk:csv:customresourcedefinitions:type=spec,order=1 URI string `json:"uri,omitempty"` - // contextDir is the relative path to the folder containing manifests in a repository + // contextDir is the relative path to the folder containing manifests in a repository, default value "manifests" // +optional - // +kubebuilder:default:="" + // +kubebuilder:default:="manifests" // +operator-sdk:csv:customresourcedefinitions:type=spec,order=2 ContextDir string `json:"contextDir,omitempty"` diff --git a/components/kueue/kueue.go b/components/kueue/kueue.go index 3d18f46cced..1c9cf4bfc19 100644 --- a/components/kueue/kueue.go +++ b/components/kueue/kueue.go @@ -39,7 +39,7 @@ func (k *Kueue) OverrideManifests(_ string) error { return err } // If overlay is defined, update paths - defaultKustomizePath := "openshift" + defaultKustomizePath := "rhoai" if manifestConfig.SourcePath != "" { defaultKustomizePath = manifestConfig.SourcePath } diff --git a/components/trainingoperator/trainingoperator.go b/components/trainingoperator/trainingoperator.go index 67bc543fd71..880ea3ca6bc 100644 --- a/components/trainingoperator/trainingoperator.go +++ b/components/trainingoperator/trainingoperator.go @@ -41,7 +41,7 @@ func (r *TrainingOperator) OverrideManifests(_ string) error { return err } // If overlay is defined, update paths - defaultKustomizePath := "openshift" + defaultKustomizePath := "rhoai" if manifestConfig.SourcePath != "" { defaultKustomizePath = manifestConfig.SourcePath } diff --git a/components/trustyai/trustyai.go b/components/trustyai/trustyai.go index 31574708ffe..b47d06dd198 100644 --- a/components/trustyai/trustyai.go +++ b/components/trustyai/trustyai.go @@ -19,8 +19,9 @@ import ( ) var ( - ComponentName = "trustyai" - Path = deploy.DefaultManifestPath + "/" + "trustyai-service-operator/base" + ComponentName = "trustyai" + ComponentPathName = "trustyai-service-operator" + Path = deploy.DefaultManifestPath + "/" + ComponentPathName + "/base" ) // Verifies that TrustyAI implements ComponentInterface. @@ -36,7 +37,7 @@ func (t *TrustyAI) OverrideManifests(_ string) error { // If devflags are set, update default manifests path if len(t.DevFlags.Manifests) != 0 { manifestConfig := t.DevFlags.Manifests[0] - if err := deploy.DownloadManifests(ComponentName, manifestConfig); err != nil { + if err := deploy.DownloadManifests(ComponentPathName, manifestConfig); err != nil { return err } // If overlay is defined, update paths @@ -44,7 +45,7 @@ func (t *TrustyAI) OverrideManifests(_ string) error { if manifestConfig.SourcePath != "" { defaultKustomizePath = manifestConfig.SourcePath } - Path = filepath.Join(deploy.DefaultManifestPath, ComponentName, defaultKustomizePath) + Path = filepath.Join(deploy.DefaultManifestPath, ComponentPathName, defaultKustomizePath) } return nil } diff --git a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml index 84f542cb5cc..e9794afb72f 100644 --- a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml +++ b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml @@ -54,9 +54,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -97,9 +98,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -141,9 +143,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -199,9 +202,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -302,9 +306,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -346,9 +351,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -389,9 +395,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -432,9 +439,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -475,9 +483,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -518,9 +527,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" @@ -561,9 +571,10 @@ spec: items: properties: contextDir: - default: "" + default: manifests description: contextDir is the relative path to - the folder containing manifests in a repository + the folder containing manifests in a repository, + default value "manifests" type: string sourcePath: default: "" diff --git a/docs/api-overview.md b/docs/api-overview.md index 038e692f8ad..439c4902f99 100644 --- a/docs/api-overview.md +++ b/docs/api-overview.md @@ -94,7 +94,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | | `uri` _string_ | uri is the URI point to a git repo with tag/branch. e.g. https://github.com/org/repo/tarball/ | | | -| `contextDir` _string_ | contextDir is the relative path to the folder containing manifests in a repository | | | +| `contextDir` _string_ | contextDir is the relative path to the folder containing manifests in a repository, default value "manifests" | manifests | | | `sourcePath` _string_ | sourcePath is the subpath within contextDir where kustomize builds start. Examples include any sub-folder or path: `base`, `overlays/dev`, `default`, `odh` etc. | | |