diff --git a/docs/apidoc/swagger.json b/docs/apidoc/swagger.json index fb4f7f5f3..f54854293 100644 --- a/docs/apidoc/swagger.json +++ b/docs/apidoc/swagger.json @@ -4024,7 +4024,8 @@ "enum": [ "component", "trait", - "workflowstep" + "workflowstep", + "policy" ], "type": "string", "description": "query the definition type", @@ -6807,6 +6808,13 @@ "summary": "get chart value", "operationId": "chartValues", "parameters": [ + { + "type": "string", + "description": "the config project", + "name": "project", + "in": "query", + "required": true + }, { "type": "string", "description": "helm chart", @@ -6875,6 +6883,13 @@ "summary": "list versions", "operationId": "listVersionsFromQuery", "parameters": [ + { + "type": "string", + "description": "the config project", + "name": "project", + "in": "query", + "required": true + }, { "type": "string", "description": "helm chart", @@ -6973,6 +6988,13 @@ "summary": "list charts", "operationId": "listCharts", "parameters": [ + { + "type": "string", + "description": "the config project", + "name": "project", + "in": "query", + "required": true + }, { "type": "string", "description": "helm repository url", @@ -7023,6 +7045,13 @@ "operationId": "listChartVersions", "deprecated": true, "parameters": [ + { + "type": "string", + "description": "the config project", + "name": "project", + "in": "query", + "required": true + }, { "type": "string", "description": "identifier of the helm chart", @@ -7077,6 +7106,13 @@ "operationId": "getChartValues", "deprecated": true, "parameters": [ + { + "type": "string", + "description": "the config project", + "name": "project", + "in": "query", + "required": true + }, { "type": "string", "description": "identifier of the helm chart", @@ -9632,12 +9668,12 @@ }, "model.WorkflowStep": { "required": [ - "name", + "orderIndex", "alias", - "dependsOn", "type", "description", - "orderIndex" + "dependsOn", + "name" ], "properties": { "alias": { @@ -9754,9 +9790,9 @@ }, "model.WorkflowStepStatus": { "required": [ + "id", "name", - "alias", - "id" + "alias" ], "properties": { "alias": { @@ -10339,13 +10375,13 @@ }, "v1.ApplicationDeployResponse": { "required": [ - "envName", - "triggerType", - "workflowName", "status", - "note", "createTime", "version", + "note", + "envName", + "triggerType", + "workflowName", "record" ], "properties": { @@ -12050,13 +12086,13 @@ }, "v1.DetailApplicationResponse": { "required": [ - "project", "description", - "icon", - "name", - "alias", "createTime", "updateTime", + "icon", + "alias", + "project", + "name", "policies", "envBindings", "resourceInfo" @@ -12113,20 +12149,20 @@ }, "v1.DetailClusterResponse": { "required": [ - "createTime", "apiServerURL", "dashboardURL", - "kubeConfig", - "kubeConfigSecret", - "updateTime", + "labels", "name", + "updateTime", "alias", - "description", - "icon", - "labels", "status", + "createTime", + "icon", "reason", "provider", + "kubeConfig", + "kubeConfigSecret", + "description", "resourceInfo" ], "properties": { @@ -12184,14 +12220,14 @@ }, "v1.DetailComponentResponse": { "required": [ + "updateTime", + "name", + "creator", + "alias", "type", "createTime", - "main", "appPrimaryKey", - "creator", - "name", - "updateTime", - "alias", + "main", "definition" ], "properties": { @@ -12279,13 +12315,13 @@ }, "v1.DetailDefinitionResponse": { "required": [ - "description", - "icon", - "ownerAddon", + "labels", "name", "alias", "status", - "labels", + "ownerAddon", + "description", + "icon", "schema", "uiSchema" ], @@ -12342,15 +12378,15 @@ }, "v1.DetailPolicyResponse": { "required": [ - "description", - "creator", - "createTime", + "properties", "updateTime", + "envName", "name", "alias", "type", - "properties", - "envName" + "description", + "creator", + "createTime" ], "properties": { "alias": { @@ -12392,18 +12428,18 @@ }, "v1.DetailRevisionResponse": { "required": [ - "reason", + "status", "deployUser", - "triggerType", - "envName", - "updateTime", + "appPrimaryKey", "version", "revisionCRName", - "status", "note", - "workflowName", + "envName", "createTime", - "appPrimaryKey" + "reason", + "triggerType", + "workflowName", + "updateTime" ], "properties": { "appPrimaryKey": { @@ -12460,10 +12496,10 @@ }, "v1.DetailTargetResponse": { "required": [ + "createTime", "updateTime", "project", - "name", - "createTime" + "name" ], "properties": { "alias": { @@ -12503,11 +12539,11 @@ }, "v1.DetailUserResponse": { "required": [ + "lastLoginTime", "name", "email", "disabled", "createTime", - "lastLoginTime", "projects", "roles" ], @@ -12548,12 +12584,12 @@ }, "v1.DetailWorkflowRecordResponse": { "required": [ - "namespace", - "mode", - "workflowAlias", "status", "message", + "mode", "name", + "namespace", + "workflowAlias", "applicationRevision", "workflowName", "deployTime", @@ -12617,16 +12653,16 @@ }, "v1.DetailWorkflowResponse": { "required": [ - "mode", - "subMode", "name", - "envName", - "createTime", - "updateTime", "alias", "description", + "default", + "subMode", "enable", - "default" + "envName", + "createTime", + "updateTime", + "mode" ], "properties": { "alias": { @@ -12864,9 +12900,9 @@ "name", "alias", "project", + "spec", "description", "createTime", - "spec", "info" ], "properties": { @@ -12909,10 +12945,10 @@ }, "v1.GetPipelineRunLogResponse": { "required": [ - "type", - "phase", "id", "name", + "type", + "phase", "source", "log" ], @@ -13566,11 +13602,11 @@ }, "v1.LoginUserInfoResponse": { "required": [ + "createTime", "lastLoginTime", "name", "email", "disabled", - "createTime", "projects", "platformPermissions", "projectPermissions" @@ -13772,11 +13808,11 @@ }, "v1.PipelineBase": { "required": [ + "description", + "createTime", "name", "alias", "project", - "description", - "createTime", "spec" ], "properties": { @@ -13875,11 +13911,11 @@ }, "v1.PipelineMetaResponse": { "required": [ + "project", "description", "createTime", "name", - "alias", - "project" + "alias" ], "properties": { "alias": { @@ -13902,13 +13938,13 @@ }, "v1.PipelineRun": { "required": [ + "spec", "project", "pipelineRunName", + "pipelineName", "record", "contextName", "contextValues", - "spec", - "pipelineName", "status" ], "properties": { @@ -13944,9 +13980,9 @@ }, "v1.PipelineRunBase": { "required": [ - "pipelineName", "project", "pipelineRunName", + "pipelineName", "record", "contextName", "contextValues", @@ -14419,10 +14455,10 @@ }, "v1.StepOutputBase": { "required": [ - "id", "name", "type", "phase", + "id", "values" ], "properties": { @@ -14505,9 +14541,9 @@ }, "v1.SystemInfoResponse": { "required": [ - "platformID", "enableCollection", "loginType", + "platformID", "systemVersion" ], "properties": { @@ -15031,14 +15067,14 @@ }, "v1.WorkflowRecord": { "required": [ - "status", "name", - "namespace", - "applicationRevision", - "mode", "workflowName", + "status", + "message", + "mode", + "namespace", "workflowAlias", - "message" + "applicationRevision" ], "properties": { "applicationRevision": { diff --git a/packages/velaux-ui/src/api/repository.ts b/packages/velaux-ui/src/api/repository.ts index 26093a9cf..cf589b41a 100644 --- a/packages/velaux-ui/src/api/repository.ts +++ b/packages/velaux-ui/src/api/repository.ts @@ -26,6 +26,7 @@ export function getChartValueFiles(params: { secretName?: string; chart: string; version: string; + project?: string }) { const url = baseURL + repository + '/chart/values'; return get(url, { @@ -35,14 +36,15 @@ export function getChartValueFiles(params: { secretName: params.secretName, chart: params.chart, version: params.version, + project: params.project }, }).then((res) => res); } -export function getCharts(params: { url: string; repoType: string; secretName?: string }) { +export function getCharts(params: { url: string; repoType: string; secretName?: string; project?: string }) { const url = baseURL + repository + '/charts'; return get(url, { - params: { repoUrl: params.url, repoType: params.repoType, secretName: params.secretName }, + params: { repoUrl: params.url, repoType: params.repoType, secretName: params.secretName, project: params.project }, }).then((res) => res); } @@ -51,6 +53,7 @@ export function getChartVersions(params: { repoType: string; chart: string; secretName?: string; + project?: string }) { const url = baseURL + repository + '/chart/versions'; return get(url, { @@ -59,6 +62,7 @@ export function getChartVersions(params: { repoType: params.repoType, secretName: params.secretName, chart: params.chart, + project: params.project }, }).then((res) => res); } diff --git a/packages/velaux-ui/src/extends/HelmChartSelect/index.tsx b/packages/velaux-ui/src/extends/HelmChartSelect/index.tsx index 876d58e75..a66500e06 100644 --- a/packages/velaux-ui/src/extends/HelmChartSelect/index.tsx +++ b/packages/velaux-ui/src/extends/HelmChartSelect/index.tsx @@ -16,6 +16,7 @@ type Props = { url: string; repoType: string; }; + project?: string; repo?: HelmRepo; }; @@ -44,6 +45,7 @@ class HelmChartSelect extends Component { } loadCharts = () => { + const { project } = this.props; const { helm, repo } = this.props; if (helm?.url && (!this.state.loading || this.state.helm?.url != helm.url)) { // Reset chart value @@ -51,7 +53,7 @@ class HelmChartSelect extends Component { this.props.onChange(''); } this.setState({ loading: true, helm: helm }); - getCharts({ url: helm.url, repoType: helm.repoType, secretName: repo?.secretName }).then( + getCharts({ url: helm.url, repoType: helm.repoType, secretName: repo?.secretName, project: project }).then( (re: string[]) => { this.setState({ charts: re && Array.isArray(re) ? re : [], loading: false, helm: helm }); }, diff --git a/packages/velaux-ui/src/extends/HelmChartVersionSelect/index.tsx b/packages/velaux-ui/src/extends/HelmChartVersionSelect/index.tsx index 22bf62ac2..bd9d3e0dc 100644 --- a/packages/velaux-ui/src/extends/HelmChartVersionSelect/index.tsx +++ b/packages/velaux-ui/src/extends/HelmChartVersionSelect/index.tsx @@ -17,6 +17,7 @@ type Props = { repoType: string; chart: string; }; + project?: string; repo?: HelmRepo; }; @@ -46,6 +47,7 @@ class HelmChartVersionSelect extends Component { } loadChartVersions = () => { + const { project } = this.props; const { helm, repo } = this.props; if ( helm?.url && @@ -63,6 +65,7 @@ class HelmChartVersionSelect extends Component { repoType: helm.repoType, chart: helm.chart, secretName: repo?.secretName, + project: project }).then((re: { versions: ChartVersion[] }) => { if (re) { this.setState({ versions: re.versions || [], loading: false, helm: helm }); diff --git a/packages/velaux-ui/src/extends/HelmValues/index.tsx b/packages/velaux-ui/src/extends/HelmValues/index.tsx index fc934db4a..8590380e2 100644 --- a/packages/velaux-ui/src/extends/HelmValues/index.tsx +++ b/packages/velaux-ui/src/extends/HelmValues/index.tsx @@ -26,6 +26,7 @@ type Props = { chart: string; version: string; }; + project?: string; repo?: HelmRepo; }; @@ -85,9 +86,10 @@ class HelmValues extends Component { } loadChartValues = () => { + const { project } = this.props; const { helm, repo } = this.props; if (helm?.chart && helm.version && helm.url) { - getChartValueFiles({ ...helm, secretName: repo?.secretName }).then( + getChartValueFiles({ ...helm, secretName: repo?.secretName, project: project }).then( (re: Record) => { if (re) { try { diff --git a/pkg/server/domain/service/helm.go b/pkg/server/domain/service/helm.go index 782fbd1a6..1b33c46be 100644 --- a/pkg/server/domain/service/helm.go +++ b/pkg/server/domain/service/helm.go @@ -44,11 +44,11 @@ func NewHelmService() HelmService { // HelmService responsible handle helm related interface type HelmService interface { - ListChartNames(ctx context.Context, url string, secretName string, skipCache bool) ([]string, error) - ListChartVersions(ctx context.Context, url string, chartName string, secretName string, skipCache bool) (repo.ChartVersions, error) - ListChartValuesFiles(ctx context.Context, url string, chartName string, version string, secretName string, repoType string, skipCache bool) (map[string]string, error) + ListChartNames(ctx context.Context, url string, secretName string, projectName string, skipCache bool) ([]string, error) + ListChartVersions(ctx context.Context, url string, chartName string, secretName string, projectName string, skipCache bool) (repo.ChartVersions, error) + ListChartValuesFiles(ctx context.Context, url string, chartName string, version string, secretName string, projectName string, repoType string, skipCache bool) (map[string]string, error) ListChartRepo(ctx context.Context, projectName string) (*v1.ChartRepoResponseList, error) - GetChartValues(ctx context.Context, repoURL string, chartName string, version string, secretName string, repoType string, skipCache bool) (map[string]interface{}, error) + GetChartValues(ctx context.Context, repoURL string, chartName string, version string, secretName string, projectName string, repoType string, skipCache bool) (map[string]interface{}, error) } type defaultHelmImpl struct { @@ -57,16 +57,37 @@ type defaultHelmImpl struct { ConfigService ConfigService `inject:""` } -func (d defaultHelmImpl) ListChartNames(ctx context.Context, repoURL string, secretName string, skipCache bool) ([]string, error) { +func (d defaultHelmImpl) GetHelmHTTPOption(ctx context.Context, secretName string, project string) (*common.HTTPOption, error) { + var opts *common.HTTPOption + var err error + if project != "" { + config, err := d.ConfigService.GetConfig(ctx, project, secretName) + if err != nil { + return nil, bcode.ErrRepoBasicAuth + } + opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: config.Namespace, Name: secretName}) + if err != nil { + return nil, bcode.ErrRepoBasicAuth + } + } else { + opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: types.DefaultKubeVelaNS, Name: secretName}) + if err != nil { + return nil, bcode.ErrRepoBasicAuth + } + } + return opts, nil +} + +func (d defaultHelmImpl) ListChartNames(ctx context.Context, repoURL string, secretName string, projectName string, skipCache bool) ([]string, error) { if !utils.IsValidURL(repoURL) { return nil, bcode.ErrRepoInvalidURL } var opts *common.HTTPOption var err error if len(secretName) != 0 { - opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: types.DefaultKubeVelaNS, Name: secretName}) + opts, err = d.GetHelmHTTPOption(ctx, secretName, projectName) if err != nil { - return nil, bcode.ErrRepoBasicAuth + return nil, err } } charts, err := d.helper.ListChartsFromRepo(repoURL, skipCache, opts) @@ -77,16 +98,16 @@ func (d defaultHelmImpl) ListChartNames(ctx context.Context, repoURL string, sec return charts, nil } -func (d defaultHelmImpl) ListChartVersions(ctx context.Context, repoURL string, chartName string, secretName string, skipCache bool) (repo.ChartVersions, error) { +func (d defaultHelmImpl) ListChartVersions(ctx context.Context, repoURL string, chartName string, secretName string, projectName string, skipCache bool) (repo.ChartVersions, error) { if !utils.IsValidURL(repoURL) { return nil, bcode.ErrRepoInvalidURL } var opts *common.HTTPOption var err error if len(secretName) != 0 { - opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: types.DefaultKubeVelaNS, Name: secretName}) + opts, err = d.GetHelmHTTPOption(ctx, secretName, projectName) if err != nil { - return nil, bcode.ErrRepoBasicAuth + return nil, err } } chartVersions, err := d.helper.ListVersions(repoURL, chartName, skipCache, opts) @@ -101,16 +122,16 @@ func (d defaultHelmImpl) ListChartVersions(ctx context.Context, repoURL string, return chartVersions, nil } -func (d defaultHelmImpl) ListChartValuesFiles(ctx context.Context, repoURL string, chartName string, version string, secretName string, repoType string, skipCache bool) (map[string]string, error) { +func (d defaultHelmImpl) ListChartValuesFiles(ctx context.Context, repoURL string, chartName string, version string, secretName string, projectName string, repoType string, skipCache bool) (map[string]string, error) { if !utils.IsValidURL(repoURL) { return nil, bcode.ErrRepoInvalidURL } var opts *common.HTTPOption var err error if len(secretName) != 0 { - opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: types.DefaultKubeVelaNS, Name: secretName}) + opts, err = d.GetHelmHTTPOption(ctx, secretName, projectName) if err != nil { - return nil, bcode.ErrRepoBasicAuth + return nil, err } } v, err := d.helper.GetValuesFromChart(repoURL, chartName, version, skipCache, repoType, opts) @@ -121,16 +142,16 @@ func (d defaultHelmImpl) ListChartValuesFiles(ctx context.Context, repoURL strin return v.Data, nil } -func (d defaultHelmImpl) GetChartValues(ctx context.Context, repoURL string, chartName string, version string, secretName string, repoType string, skipCache bool) (map[string]interface{}, error) { +func (d defaultHelmImpl) GetChartValues(ctx context.Context, repoURL string, chartName string, version string, secretName string, projectName string, repoType string, skipCache bool) (map[string]interface{}, error) { if !utils.IsValidURL(repoURL) { return nil, bcode.ErrRepoInvalidURL } var opts *common.HTTPOption var err error if len(secretName) != 0 { - opts, err = helm.SetHTTPOption(ctx, d.K8sClient, types2.NamespacedName{Namespace: types.DefaultKubeVelaNS, Name: secretName}) + opts, err = d.GetHelmHTTPOption(ctx, secretName, projectName) if err != nil { - return nil, bcode.ErrRepoBasicAuth + return nil, err } } v, err := d.helper.GetValuesFromChart(repoURL, chartName, version, skipCache, repoType, opts) diff --git a/pkg/server/domain/service/helm_test.go b/pkg/server/domain/service/helm_test.go index 8fba182bd..10b60e542 100644 --- a/pkg/server/domain/service/helm_test.go +++ b/pkg/server/domain/service/helm_test.go @@ -204,17 +204,17 @@ var _ = Describe("test helm usecasae", func() { u, _, err := NewTestHelmService() Expect(err).Should(BeNil()) - charts, err := u.ListChartNames(ctx, mockServer.URL, "repo-secret", false) + charts, err := u.ListChartNames(ctx, mockServer.URL, "repo-secret", "", false) Expect(err).Should(BeNil()) Expect(len(charts)).Should(BeEquivalentTo(1)) Expect(charts[0]).Should(BeEquivalentTo("mysql")) - versions, err := u.ListChartVersions(ctx, mockServer.URL, "mysql", "repo-secret", false) + versions, err := u.ListChartVersions(ctx, mockServer.URL, "mysql", "repo-secret", "", false) Expect(err).Should(BeNil()) Expect(len(versions)).Should(BeEquivalentTo(1)) Expect(versions[0].Version).Should(BeEquivalentTo("8.8.23")) - values, err := u.ListChartValuesFiles(ctx, mockServer.URL, "mysql", "8.8.23", "repo-secret", "helm", false) + values, err := u.ListChartValuesFiles(ctx, mockServer.URL, "mysql", "8.8.23", "repo-secret", "", "helm", false) Expect(err).Should(BeNil()) Expect(values).ShouldNot(BeNil()) Expect(len(values)).ShouldNot(BeEquivalentTo(0)) @@ -223,13 +223,13 @@ var _ = Describe("test helm usecasae", func() { It("coverage not secret notExist error", func() { u, _, err := NewTestHelmService() Expect(err).Should(BeNil()) - _, err = u.ListChartNames(ctx, "http://127.0.0.1:8080", "repo-secret-notExist", false) + _, err = u.ListChartNames(ctx, "http://127.0.0.1:8080", "repo-secret-notExist", "", false) Expect(err).ShouldNot(BeNil()) - _, err = u.ListChartVersions(ctx, "http://127.0.0.1:8080", "mysql", "repo-secret-notExist", false) + _, err = u.ListChartVersions(ctx, "http://127.0.0.1:8080", "mysql", "repo-secret-notExist", "", false) Expect(err).ShouldNot(BeNil()) - _, err = u.ListChartValuesFiles(ctx, "http://127.0.0.1:8080", "mysql", "8.8.23", "repo-secret-notExist", "helm", false) + _, err = u.ListChartValuesFiles(ctx, "http://127.0.0.1:8080", "mysql", "8.8.23", "repo-secret-notExist", "", "helm", false) Expect(err).ShouldNot(BeNil()) }) }) diff --git a/pkg/server/interfaces/api/repository.go b/pkg/server/interfaces/api/repository.go index d99af7a0a..d0264af59 100644 --- a/pkg/server/interfaces/api/repository.go +++ b/pkg/server/interfaces/api/repository.go @@ -63,6 +63,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService { ws.Route(ws.GET("/charts").To(h.listCharts). Doc("list charts"). Metadata(restfulspec.KeyOpenAPITags, tags). + Param(ws.QueryParameter("project", "the config project").DataType("string").Required(true)). Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string")). Param(ws.QueryParameter("secretName", "secret of the repo").DataType("string")). Returns(200, "OK", []string{}). @@ -73,6 +74,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService { ws.Route(ws.GET("/chart/versions").To(h.listVersionsFromQuery). Doc("list versions"). Metadata(restfulspec.KeyOpenAPITags, tags). + Param(ws.QueryParameter("project", "the config project").DataType("string").Required(true)). Param(ws.QueryParameter("chart", "helm chart").DataType("string").Required(true)). Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string").Required(true)). Param(ws.QueryParameter("secretName", "secret of the repo").DataType("string")). @@ -83,6 +85,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService { ws.Route(ws.GET("/charts/{chart}/versions").To(h.listChartVersions). Doc("list versions").Deprecate(). Metadata(restfulspec.KeyOpenAPITags, tags). + Param(ws.QueryParameter("project", "the config project").DataType("string").Required(true)). Param(ws.PathParameter("chart", "identifier of the helm chart").DataType("string").Required(true)). Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string")). Param(ws.QueryParameter("secretName", "secret of the repo").DataType("string")). @@ -94,6 +97,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService { ws.Route(ws.GET("/chart/values").To(h.chartValues). Doc("get chart value"). Metadata(restfulspec.KeyOpenAPITags, tags). + Param(ws.QueryParameter("project", "the config project").DataType("string").Required(true)). Param(ws.QueryParameter("chart", "helm chart").DataType("string").Required(true)). Param(ws.QueryParameter("version", "helm chart version").DataType("string").Required(true)). Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string").Required(true)). @@ -106,6 +110,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService { ws.Route(ws.GET("/charts/{chart}/versions/{version}/values").To(h.getChartValues). Doc("get chart value").Deprecate(). Metadata(restfulspec.KeyOpenAPITags, tags). + Param(ws.QueryParameter("project", "the config project").DataType("string").Required(true)). Param(ws.PathParameter("chart", "identifier of the helm chart").DataType("string").Required(true)). Param(ws.PathParameter("version", "version of the helm chart").DataType("string").Required(true)). Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string")). @@ -141,12 +146,13 @@ func (h repository) GetWebServiceRoute() *restful.WebService { func (h repository) listCharts(req *restful.Request, res *restful.Response) { url := utils.Sanitize(req.QueryParameter("repoUrl")) secName := utils.Sanitize(req.QueryParameter("secretName")) + projectName := req.QueryParameter("project") skipCache, err := isSkipCache(req) if err != nil { bcode.ReturnError(req, res, bcode.ErrSkipCacheParameter) return } - charts, err := h.HelmService.ListChartNames(req.Request.Context(), url, secName, skipCache) + charts, err := h.HelmService.ListChartNames(req.Request.Context(), url, secName, projectName, skipCache) if err != nil { bcode.ReturnError(req, res, err) return @@ -162,13 +168,14 @@ func (h repository) listVersionsFromQuery(req *restful.Request, res *restful.Res url := req.QueryParameter("repoUrl") chartName := req.QueryParameter("chart") secName := req.QueryParameter("secretName") + projectName := req.QueryParameter("project") skipCache, err := isSkipCache(req) if err != nil { bcode.ReturnError(req, res, bcode.ErrSkipCacheParameter) return } - versions, err := h.HelmService.ListChartVersions(req.Request.Context(), url, chartName, secName, skipCache) + versions, err := h.HelmService.ListChartVersions(req.Request.Context(), url, chartName, secName, projectName, skipCache) if err != nil { bcode.ReturnError(req, res, err) return @@ -184,6 +191,7 @@ func (h repository) getChartValues(req *restful.Request, res *restful.Response) url := req.QueryParameter("repoUrl") secName := req.QueryParameter("secretName") chartName := req.PathParameter("chart") + projectName := req.QueryParameter("project") version := req.PathParameter("version") skipCache, err := isSkipCache(req) if err != nil { @@ -191,7 +199,7 @@ func (h repository) getChartValues(req *restful.Request, res *restful.Response) return } - values, err := h.HelmService.GetChartValues(req.Request.Context(), url, chartName, version, secName, "helm", skipCache) + values, err := h.HelmService.GetChartValues(req.Request.Context(), url, chartName, version, secName, projectName, "helm", skipCache) if err != nil { bcode.ReturnError(req, res, err) return @@ -207,12 +215,13 @@ func (h repository) listChartVersions(req *restful.Request, res *restful.Respons url := req.QueryParameter("repoUrl") chartName := req.PathParameter("chart") secName := req.QueryParameter("secretName") + projectName := req.QueryParameter("project") skipCache, err := isSkipCache(req) if err != nil { bcode.ReturnError(req, res, bcode.ErrSkipCacheParameter) return } - versions, err := h.HelmService.ListChartVersions(req.Request.Context(), url, chartName, secName, skipCache) + versions, err := h.HelmService.ListChartVersions(req.Request.Context(), url, chartName, secName, projectName, skipCache) if err != nil { bcode.ReturnError(req, res, err) return @@ -228,6 +237,7 @@ func (h repository) chartValues(req *restful.Request, res *restful.Response) { url := req.QueryParameter("repoUrl") secName := req.QueryParameter("secretName") chartName := req.QueryParameter("chart") + projectName := req.QueryParameter("project") version := req.QueryParameter("version") repoType := req.QueryParameter("repoType") skipCache, err := isSkipCache(req) @@ -236,7 +246,7 @@ func (h repository) chartValues(req *restful.Request, res *restful.Response) { return } - values, err := h.HelmService.ListChartValuesFiles(req.Request.Context(), url, chartName, version, secName, repoType, skipCache) + values, err := h.HelmService.ListChartValuesFiles(req.Request.Context(), url, chartName, version, secName, projectName, repoType, skipCache) if err != nil { bcode.ReturnError(req, res, err) return