Fix broken certificate-authority-data with kubectl >= 1.8.0
This commit is contained in:
parent
f1b8d79f4a
commit
40c6128b39
4 changed files with 8 additions and 3 deletions
5
changelogs/unreleased/fix-kubectl-180.yml
Normal file
5
changelogs/unreleased/fix-kubectl-180.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: 'Kubernetes integration: ensure v1.8.0 compatibility'
|
||||
merge_request: 14635
|
||||
author:
|
||||
type: fixed
|
|
@ -113,7 +113,7 @@ module Gitlab
|
|||
|
||||
def kubeconfig_embed_ca_pem(config, ca_pem)
|
||||
cluster = config.dig(:clusters, 0, :cluster)
|
||||
cluster[:'certificate-authority-data'] = Base64.encode64(ca_pem)
|
||||
cluster[:'certificate-authority-data'] = Base64.strict_encode64(ca_pem)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
2
spec/fixtures/config/kubeconfig.yml
vendored
2
spec/fixtures/config/kubeconfig.yml
vendored
|
@ -4,7 +4,7 @@ clusters:
|
|||
- name: gitlab-deploy
|
||||
cluster:
|
||||
server: https://kube.domain.com
|
||||
certificate-authority-data: "UEVN\n"
|
||||
certificate-authority-data: "UEVN"
|
||||
contexts:
|
||||
- name: gitlab-deploy
|
||||
context:
|
||||
|
|
|
@ -208,7 +208,7 @@ describe KubernetesService, :use_clean_rails_memory_store_caching do
|
|||
config.dig('users', 0, 'user')['token'] = 'token'
|
||||
config.dig('contexts', 0, 'context')['namespace'] = namespace
|
||||
config.dig('clusters', 0, 'cluster')['certificate-authority-data'] =
|
||||
Base64.encode64('CA PEM DATA')
|
||||
Base64.strict_encode64('CA PEM DATA')
|
||||
|
||||
YAML.dump(config)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue