custom_registries ca_file docs misleading

Bug #1900764 reported by Chris Johnston
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Containerd Subordinate Charm
Fix Released
High
Unassigned

Bug Description

The docs for adding a ca_file to custom_registries doesn't work when the file contains begin/end certificate lines

$ cat test1.pem
this is a test

$ juju config containerd custom_registries='[{"url": "https://registry.example.com", "ca_file": "'$(base64 < test1.pem)'"}]'

$ juju config containerd custom_registries
[{"url": "https://registry.example.com", "ca_file": "dGhpcyBpcyBhIHRlc3QK"}]

$ cat test2.pem
-----BEGIN CERTIFICATE-----
this is a test
this is also a test
another line
-----END CERTIFICATE-----

$ juju config containerd custom_registries='[{"url": "https://registry.example.com", "ca_file": "'$(base64 < test2.pem)'"}]'
ERROR cannot set and retrieve values simultaneously

Adding an extra set of quotes seems to properly escape the lines:
$ juju config containerd custom_registries='[{"url": "https://registry.example.com", "ca_file": "'"$(base64 < test2.pem)"'"}]'

$ juju config containerd custom_registries
[{"url": "https://registry.example.com", "ca_file": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCnRoaXMgaXMgYSB0ZXN0CnRoaXMgaXMgYWxzbyBh
IHRlc3QKYW5vdGhlciBsaW5lCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"}]

Tags: sts
Revision history for this message
Chris Johnston (cjohnston) wrote :
description: updated
tags: added: sts
George Kraft (cynerva)
Changed in charm-containerd:
importance: Undecided → High
status: New → Triaged
tags: added: review-needed
Revision history for this message
Chris Sanders (chris.sanders) wrote :

Subscribing field-medium so this isn't missed

Changed in charm-containerd:
milestone: none → 1.20+ck1
George Kraft (cynerva)
Changed in charm-containerd:
status: Triaged → Fix Committed
tags: added: backport-needed
removed: review-needed
Revision history for this message
George Kraft (cynerva) wrote :
tags: removed: backport-needed
Changed in charm-containerd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.