Commit 40c6128b authored by Alessio Caiazza's avatar Alessio Caiazza

Fix broken certificate-authority-data with kubectl >= 1.8.0

parent f1b8d79f
---
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
......@@ -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
......
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