Skip to content

Commit 6cca687

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#61479 from hyperbolic2346/mwilson/api-server-clear-client-ca
Automatic merge from submit-queue (batch tested with PRs 61195, 61479). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Clearing out the client-ca-file option **What this PR does / why we need it**: kubernetes-master charm wouldn't clear the ca-client-file snap setting. We haven't used it for a while, but since it wasn't clearing it out any old deploys that updated would still have it set. This change will start clearing it. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/515 **Special notes for your reviewer**: **Release note**: ```release-note kubernetes-master charm now properly clears the client-ca-file setting on the apiserver snap ```
2 parents f898114 + 69e264f commit 6cca687

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ def configure_kubernetes_service(service, base_args, extra_args_key):
10761076
args = {}
10771077
for arg in prev_args:
10781078
# remove previous args by setting to null
1079+
# note this is so we remove them from the snap's config
10791080
args[arg] = 'null'
10801081
for k, v in base_args.items():
10811082
args[k] = v
@@ -1099,6 +1100,14 @@ def configure_apiserver(etcd_connection_string, leader_etcd_version):
10991100
server_cert_path = layer_options.get('server_certificate_path')
11001101
server_key_path = layer_options.get('server_key_path')
11011102

1103+
# at one point in time, this code would set ca-client-cert,
1104+
# but this was removed. This was before configure_kubernetes_service
1105+
# kept track of old arguments and removed them, so client-ca-cert
1106+
# was able to hang around forever stored in the snap configuration.
1107+
# This removes that stale configuration from the snap if it still
1108+
# exists.
1109+
api_opts['client-ca-file'] = 'null'
1110+
11021111
if is_privileged():
11031112
api_opts['allow-privileged'] = 'true'
11041113
set_state('kubernetes-master.privileged')

0 commit comments

Comments
 (0)