Commit afd56634 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'set-kube-ca-pem-to-file' into 'master'

Add KUBE_CA_PEM_FILE, deprecate KUBE_CA_PEM

Closes #25753

See merge request !9398
parents df63d9db ba4a2c54
...@@ -94,7 +94,12 @@ class KubernetesService < DeploymentService ...@@ -94,7 +94,12 @@ class KubernetesService < DeploymentService
{ key: 'KUBE_TOKEN', value: token, public: false }, { key: 'KUBE_TOKEN', value: token, public: false },
{ key: 'KUBE_NAMESPACE', value: namespace, public: true } { key: 'KUBE_NAMESPACE', value: namespace, public: true }
] ]
variables << { key: 'KUBE_CA_PEM', value: ca_pem, public: true } if ca_pem.present?
if ca_pem.present?
variables << { key: 'KUBE_CA_PEM', value: ca_pem, public: true }
variables << { key: 'KUBE_CA_PEM_FILE', value: ca_pem, public: true, file: true }
end
variables variables
end end
......
---
title: Add KUBE_CA_PEM_FILE, deprecate KUBE_CA_PEM
merge_request: 9398
author:
...@@ -49,7 +49,8 @@ GitLab CI build environment: ...@@ -49,7 +49,8 @@ GitLab CI build environment:
- `KUBE_URL` - equal to the API URL - `KUBE_URL` - equal to the API URL
- `KUBE_TOKEN` - `KUBE_TOKEN`
- `KUBE_NAMESPACE` - `KUBE_NAMESPACE`
- `KUBE_CA_PEM` - only if a custom CA bundle was specified - `KUBE_CA_PEM_FILE` - only present if a custom CA bundle was specified. Path to a file containing PEM data.
- `KUBE_CA_PEM` (deprecated)- only if a custom CA bundle was specified. Raw PEM data.
## Web terminals ## Web terminals
......
...@@ -163,6 +163,12 @@ describe KubernetesService, models: true, caching: true do ...@@ -163,6 +163,12 @@ describe KubernetesService, models: true, caching: true do
{ key: 'KUBE_CA_PEM', value: 'CA PEM DATA', public: true } { key: 'KUBE_CA_PEM', value: 'CA PEM DATA', public: true }
) )
end end
it 'sets KUBE_CA_PEM_FILE' do
expect(subject.predefined_variables).to include(
{ key: 'KUBE_CA_PEM_FILE', value: 'CA PEM DATA', public: true, file: true }
)
end
end end
describe '#terminals' do describe '#terminals' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment