Skip to content

Commit f90bcaf

Browse files
committed
refactor: Write configuration under /etc/caren
Previously, we wrote some configuration to /etc/cre. Now that the project name is CAREN, we should use /etc/caren. We also wrote containerd configuration to /etc/containerd/cre.d, but this configuration is not read by containerd directly. Instead, it is read by a script that merges it to the primary containerd configuration. For that reason, this configuration belongs under /etc/caren.
1 parent 22bf205 commit f90bcaf

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

pkg/handlers/generic/mutation/containerdmetrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
const (
1313
// TODO Factor out this constant to a common package.
14-
containerdPatchesDirOnRemote = "/etc/containerd/cre.d"
14+
containerdPatchesDirOnRemote = "/etc/caren/containerd"
1515
)
1616

1717
var (

pkg/handlers/generic/mutation/imageregistries/credentials/credential_provider_install_files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
const (
1616
//nolint:gosec // Does not contain hard coded credentials.
17-
installKubeletCredentialProvidersScriptOnRemote = "/etc/cre/install-kubelet-credential-providers.sh"
17+
installKubeletCredentialProvidersScriptOnRemote = "/etc/caren/install-kubelet-credential-providers.sh"
1818

1919
installKubeletCredentialProvidersScriptOnRemoteCommand = "/bin/bash " + installKubeletCredentialProvidersScriptOnRemote
2020

pkg/handlers/generic/mutation/imageregistries/credentials/inject_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ var _ = Describe("Generate Image registry patches", func() {
161161
Path: "/spec/template/spec/kubeadmConfigSpec/files",
162162
ValueMatcher: gomega.ContainElements(
163163
gomega.HaveKeyWithValue(
164-
"path", "/etc/cre/install-kubelet-credential-providers.sh",
164+
"path", "/etc/caren/install-kubelet-credential-providers.sh",
165165
),
166166
gomega.HaveKeyWithValue(
167167
"path", "/etc/kubernetes/image-credential-provider-config.yaml",
@@ -175,7 +175,7 @@ var _ = Describe("Generate Image registry patches", func() {
175175
Operation: "add",
176176
Path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands",
177177
ValueMatcher: gomega.ContainElement(
178-
"/bin/bash /etc/cre/install-kubelet-credential-providers.sh",
178+
"/bin/bash /etc/caren/install-kubelet-credential-providers.sh",
179179
),
180180
},
181181
{
@@ -222,7 +222,7 @@ var _ = Describe("Generate Image registry patches", func() {
222222
Path: "/spec/template/spec/kubeadmConfigSpec/files",
223223
ValueMatcher: gomega.ContainElements(
224224
gomega.HaveKeyWithValue(
225-
"path", "/etc/cre/install-kubelet-credential-providers.sh",
225+
"path", "/etc/caren/install-kubelet-credential-providers.sh",
226226
),
227227
gomega.HaveKeyWithValue(
228228
"path", "/etc/kubernetes/image-credential-provider-config.yaml",
@@ -239,7 +239,7 @@ var _ = Describe("Generate Image registry patches", func() {
239239
Operation: "add",
240240
Path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands",
241241
ValueMatcher: gomega.ContainElement(
242-
"/bin/bash /etc/cre/install-kubelet-credential-providers.sh",
242+
"/bin/bash /etc/caren/install-kubelet-credential-providers.sh",
243243
),
244244
},
245245
{
@@ -286,7 +286,7 @@ var _ = Describe("Generate Image registry patches", func() {
286286
Path: "/spec/template/spec/files",
287287
ValueMatcher: gomega.ContainElements(
288288
gomega.HaveKeyWithValue(
289-
"path", "/etc/cre/install-kubelet-credential-providers.sh",
289+
"path", "/etc/caren/install-kubelet-credential-providers.sh",
290290
),
291291
gomega.HaveKeyWithValue(
292292
"path", "/etc/kubernetes/image-credential-provider-config.yaml",
@@ -300,7 +300,7 @@ var _ = Describe("Generate Image registry patches", func() {
300300
Operation: "add",
301301
Path: "/spec/template/spec/preKubeadmCommands",
302302
ValueMatcher: gomega.ContainElement(
303-
"/bin/bash /etc/cre/install-kubelet-credential-providers.sh",
303+
"/bin/bash /etc/caren/install-kubelet-credential-providers.sh",
304304
),
305305
},
306306
{
@@ -344,7 +344,7 @@ var _ = Describe("Generate Image registry patches", func() {
344344
Path: "/spec/template/spec/files",
345345
ValueMatcher: gomega.ContainElements(
346346
gomega.HaveKeyWithValue(
347-
"path", "/etc/cre/install-kubelet-credential-providers.sh",
347+
"path", "/etc/caren/install-kubelet-credential-providers.sh",
348348
),
349349
gomega.HaveKeyWithValue(
350350
"path", "/etc/kubernetes/image-credential-provider-config.yaml",
@@ -361,7 +361,7 @@ var _ = Describe("Generate Image registry patches", func() {
361361
Operation: "add",
362362
Path: "/spec/template/spec/preKubeadmCommands",
363363
ValueMatcher: gomega.ContainElement(
364-
"/bin/bash /etc/cre/install-kubelet-credential-providers.sh",
364+
"/bin/bash /etc/caren/install-kubelet-credential-providers.sh",
365365
),
366366
},
367367
{

pkg/handlers/generic/mutation/mirrors/inject_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var _ = Describe("Generate Global mirror patches", func() {
7070
"path", "/etc/containerd/certs.d/_default/hosts.toml",
7171
),
7272
gomega.HaveKeyWithValue(
73-
"path", "/etc/containerd/cre.d/registry-config.toml",
73+
"path", "/etc/caren/containerd/registry-config.toml",
7474
),
7575
gomega.HaveKeyWithValue(
7676
"path", "/etc/containerd/apply-patches.sh",
@@ -115,7 +115,7 @@ var _ = Describe("Generate Global mirror patches", func() {
115115
"path", "/etc/certs/mirror.pem",
116116
),
117117
gomega.HaveKeyWithValue(
118-
"path", "/etc/containerd/cre.d/registry-config.toml",
118+
"path", "/etc/caren/containerd/registry-config.toml",
119119
),
120120
gomega.HaveKeyWithValue(
121121
"path", "/etc/containerd/apply-patches.sh",
@@ -160,7 +160,7 @@ var _ = Describe("Generate Global mirror patches", func() {
160160
"path", "/etc/containerd/certs.d/_default/hosts.toml",
161161
),
162162
gomega.HaveKeyWithValue(
163-
"path", "/etc/containerd/cre.d/registry-config.toml",
163+
"path", "/etc/caren/containerd/registry-config.toml",
164164
),
165165
gomega.HaveKeyWithValue(
166166
"path", "/etc/containerd/apply-patches.sh",
@@ -213,7 +213,7 @@ var _ = Describe("Generate Global mirror patches", func() {
213213
"path", "/etc/certs/mirror.pem",
214214
),
215215
gomega.HaveKeyWithValue(
216-
"path", "/etc/containerd/cre.d/registry-config.toml",
216+
"path", "/etc/caren/containerd/registry-config.toml",
217217
),
218218
gomega.HaveKeyWithValue(
219219
"path", "/etc/containerd/apply-patches.sh",

pkg/handlers/generic/mutation/mirrors/mirror.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525
secretKeyForMirrorCACert = "ca.crt"
2626

2727
tomlMergeImage = "ghcr.io/mesosphere/toml-merge:v0.2.0"
28-
containerdPatchesDirOnRemote = "/etc/containerd/cre.d"
28+
containerdPatchesDirOnRemote = "/etc/caren/containerd"
2929
containerdApplyPatchesScriptOnRemote = "/etc/containerd/apply-patches.sh"
3030
containerdApplyPatchesScriptOnRemoteCommand = "/bin/bash " + containerdApplyPatchesScriptOnRemote
3131
)

pkg/handlers/generic/mutation/mirrors/mirror_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func Test_generateMirrorCACertFile(t *testing.T) {
161161
func Test_generateContainerdRegistryConfigDropInFile(t *testing.T) {
162162
want := []cabpkv1.File{
163163
{
164-
Path: "/etc/containerd/cre.d/registry-config.toml",
164+
Path: "/etc/caren/containerd/registry-config.toml",
165165
Owner: "",
166166
Permissions: "0600",
167167
Encoding: "",
@@ -203,7 +203,7 @@ trap 'cleanup' EXIT
203203
readonly tmp_ctr_mount_dir="$(mktemp -d)"
204204
205205
ctr --namespace k8s.io images mount "${TOML_MERGE_IMAGE}" "${tmp_ctr_mount_dir}"
206-
"${tmp_ctr_mount_dir}/usr/local/bin/toml-merge" -i --patch-file "/etc/containerd/cre.d/*.toml" /etc/containerd/config.toml
206+
"${tmp_ctr_mount_dir}/usr/local/bin/toml-merge" -i --patch-file "/etc/caren/containerd/*.toml" /etc/containerd/config.toml
207207
`,
208208
},
209209
}

0 commit comments

Comments
 (0)