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

Merge branch 'fix-kubectl-180' into 'master'

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

Closes #38685

See merge request gitlab-org/gitlab-ce!14635
parents eddeeed3 40c6128b
---
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