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

This commit is contained in:
Alessio Caiazza 2017-10-02 18:55:07 +02:00
parent f1b8d79f4a
commit 40c6128b39
No known key found for this signature in database
GPG key ID: 8655B9CB5B8B512E
4 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
title: 'Kubernetes integration: ensure v1.8.0 compatibility'
merge_request: 14635
author:
type: fixed

View file

@ -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

View file

@ -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:

View file

@ -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