From b7446bf6ddc35c902acfabec12601bdcce42c66b Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 25 Sep 2024 22:21:25 +0800 Subject: [PATCH] fix: adjust priority for config namespace --- internal/apps/dop/endpoints/pipeline.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/apps/dop/endpoints/pipeline.go b/internal/apps/dop/endpoints/pipeline.go index 27cc0a12fb0..88ad7f13bbd 100644 --- a/internal/apps/dop/endpoints/pipeline.go +++ b/internal/apps/dop/endpoints/pipeline.go @@ -97,8 +97,10 @@ func (e *Endpoints) pipelineCreate(ctx context.Context, r *http.Request, vars ma } // also add project/org default config namespace - reqPipeline.ConfigManageNamespaces = append(reqPipeline.ConfigManageNamespaces, makeOrgDefaultLevelCmsNs(app.OrgID)...) - reqPipeline.ConfigManageNamespaces = append(reqPipeline.ConfigManageNamespaces, makeProjectDefaultLevelCmsNs(app.ProjectID)...) + // priority: org->project->app->user + reqPipeline.ConfigManageNamespaces = append(append(makeOrgDefaultLevelCmsNs(app.OrgID), + makeProjectDefaultLevelCmsNs(app.ProjectID)...), + reqPipeline.ConfigManageNamespaces...) rules, err := e.branchRule.Query(apistructs.ProjectScope, int64(app.ProjectID)) if err != nil {