From 1f88cde32a014abf145a2dbfa6d15affebc2c0ee Mon Sep 17 00:00:00 2001 From: ngala Date: Thu, 16 Nov 2023 17:49:05 +0530 Subject: [PATCH 1/3] Add namespace-in-path parameter for GitLab Pages Changelog: added --- charts/gitlab/charts/gitlab-pages/templates/configmap.yml | 3 +++ charts/gitlab/charts/gitlab-pages/values.yaml | 2 ++ doc/charts/gitlab/gitlab-pages/index.md | 1 + spec/configuration/pages_spec.rb | 2 ++ 4 files changed, 8 insertions(+) diff --git a/charts/gitlab/charts/gitlab-pages/templates/configmap.yml b/charts/gitlab/charts/gitlab-pages/templates/configmap.yml index 496b61a8c7..207b38a0e0 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/configmap.yml +++ b/charts/gitlab/charts/gitlab-pages/templates/configmap.yml @@ -167,6 +167,9 @@ data: {{- if .Values.serverKeepAlive }} server-keep-alive={{ .Values.serverKeepAlive }} {{- end }} + {{- if .Values.namespaceInPath }} + namespace-in-path={{ .Values.namespaceInPath }} + {{- end }} configure: | {{- include "gitlab.scripts.configure.secrets" (dict "required" "pages" "optional" "none") | nindent 4 }} {{- if $.Values.metrics.tls.enabled }} diff --git a/charts/gitlab/charts/gitlab-pages/values.yaml b/charts/gitlab/charts/gitlab-pages/values.yaml index f5227cb21e..f624e4c8ca 100644 --- a/charts/gitlab/charts/gitlab-pages/values.yaml +++ b/charts/gitlab/charts/gitlab-pages/values.yaml @@ -244,3 +244,5 @@ affinity: # rateLimitTLSSourceIPBurst: # rateLimitTLSDomain: # rateLimitTLSDomainBurst: + +# namespaceInPath: diff --git a/doc/charts/gitlab/gitlab-pages/index.md b/doc/charts/gitlab/gitlab-pages/index.md index c554863c62..5defc0e4e3 100644 --- a/doc/charts/gitlab/gitlab-pages/index.md +++ b/doc/charts/gitlab/gitlab-pages/index.md @@ -155,6 +155,7 @@ configurations that can be supplied to the `helm install` command using the | `serverWriteTimeout` | `5m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `serverKeepAlive` | `15s` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `authCookieSessionTimeout` | `10m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | +| `namespaceInPath` | `false` | Enable namespace in path | ### Configuring the `ingress` diff --git a/spec/configuration/pages_spec.rb b/spec/configuration/pages_spec.rb index e732695068..1782551ee3 100644 --- a/spec/configuration/pages_spec.rb +++ b/spec/configuration/pages_spec.rb @@ -505,6 +505,7 @@ describe 'GitLab Pages' do serverWriteTimeout: 3h serverKeepAlive: 4h authCookieSessionTimeout: 1h + namespaceInPath: true )) end @@ -556,6 +557,7 @@ describe 'GitLab Pages' do server-read-header-timeout=2h server-write-timeout=3h server-keep-alive=4h + namespace-in-path=true MSG expect(pages_enabled_template.exit_code).to eq(0), "Unexpected error code #{pages_enabled_template.exit_code} -- #{pages_enabled_template.stderr}" -- GitLab From 35ba96563a87c1d7b3acce2e1f95a30dee3c0a3e Mon Sep 17 00:00:00 2001 From: ngala Date: Wed, 22 Nov 2023 12:55:36 +0530 Subject: [PATCH 2/3] Add namespace_in_path parameter in gitlab.yml --- charts/gitlab/templates/_pages.tpl | 1 + doc/charts/gitlab/gitlab-pages/index.md | 2 +- doc/charts/globals.md | 2 ++ spec/configuration/pages_spec.rb | 7 +++++-- values.yaml | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/charts/gitlab/templates/_pages.tpl b/charts/gitlab/templates/_pages.tpl index 72ee05648b..055d0500d4 100644 --- a/charts/gitlab/templates/_pages.tpl +++ b/charts/gitlab/templates/_pages.tpl @@ -21,6 +21,7 @@ pages: local_store: enabled: {{ $.Values.global.pages.localStore.enabled }} path: {{ $.Values.global.pages.localStore.path }} + namespace_in_path: {{ $.Values.namespaceInPath }} {{- end -}} {{- define "gitlab.pages.mountSecrets" }} diff --git a/doc/charts/gitlab/gitlab-pages/index.md b/doc/charts/gitlab/gitlab-pages/index.md index 5defc0e4e3..f47c46362c 100644 --- a/doc/charts/gitlab/gitlab-pages/index.md +++ b/doc/charts/gitlab/gitlab-pages/index.md @@ -155,7 +155,7 @@ configurations that can be supplied to the `helm install` command using the | `serverWriteTimeout` | `5m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `serverKeepAlive` | `15s` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `authCookieSessionTimeout` | `10m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | -| `namespaceInPath` | `false` | Enable namespace in path | +| `namespaceInPath` | `false` | Enable namespace in the URL path. | ### Configuring the `ingress` diff --git a/doc/charts/globals.md b/doc/charts/globals.md index ca7e902a90..c5bd1105fa 100644 --- a/doc/charts/globals.md +++ b/doc/charts/globals.md @@ -1947,6 +1947,7 @@ global: apiSecret: {} secret: key: + namespaceInPath: ``` | Name | Type | Default | Description | @@ -1968,6 +1969,7 @@ global: | `localStore.path` | String | `/srv/gitlab/shared/pages` | Path where pages files will be stored; only used if localStore is set to true. | | `apiSecret.secret` | String | | Secret containing 32 bit API key in Base64 encoded form. | | `apiSecret.key` | String | | Key within the API key secret where the API key is stored. | +| `namespaceInPath` | Boolean | False | Enable namespace in the URL path. | ## Configure Webservice diff --git a/spec/configuration/pages_spec.rb b/spec/configuration/pages_spec.rb index 1782551ee3..aabf12d7bb 100644 --- a/spec/configuration/pages_spec.rb +++ b/spec/configuration/pages_spec.rb @@ -224,7 +224,8 @@ describe 'GitLab Pages' do 'local_store' => { 'enabled' => false, 'path' => nil - } + }, + 'namespace_in_path' => false ) end end @@ -252,6 +253,7 @@ describe 'GitLab Pages' do localStore: enabled: true path: /random/path + namespaceInPath: true )) end @@ -275,7 +277,8 @@ describe 'GitLab Pages' do 'local_store' => { 'enabled' => true, 'path' => '/random/path' - } + }, + 'namespace_in_path' => true ) end diff --git a/values.yaml b/values.yaml index c4c5e1ef94..041da3ea36 100644 --- a/values.yaml +++ b/values.yaml @@ -676,6 +676,7 @@ global: authSecret: {} # secret: # key: + namespaceInPath: false ## GitLab Runner ## Secret created according to https://docs.gitlab.com/charts/installation/secrets#gitlab-runner-secret -- GitLab From b8ab60d8fe2abe56020ebfd9f01098c2955e0d1d Mon Sep 17 00:00:00 2001 From: ngala Date: Thu, 18 Jan 2024 14:40:14 +0530 Subject: [PATCH 3/3] Update description --- doc/charts/gitlab/gitlab-pages/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/charts/gitlab/gitlab-pages/index.md b/doc/charts/gitlab/gitlab-pages/index.md index f47c46362c..c6f7935ab3 100644 --- a/doc/charts/gitlab/gitlab-pages/index.md +++ b/doc/charts/gitlab/gitlab-pages/index.md @@ -155,7 +155,7 @@ configurations that can be supplied to the `helm install` command using the | `serverWriteTimeout` | `5m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `serverKeepAlive` | `15s` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | | `authCookieSessionTimeout` | `10m` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | -| `namespaceInPath` | `false` | Enable namespace in the URL path. | +| `namespaceInPath` | `false` | See: [GitLab Pages global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings) | ### Configuring the `ingress` -- GitLab