From 285b6fa176ee4ae1683cb9136ede11779a3a278c Mon Sep 17 00:00:00 2001 From: pegasas <616672335@qq.com> Date: Fri, 18 Aug 2023 22:01:50 +0800 Subject: [PATCH 1/3] Document snag with stringData and server-side apply --- content/en/docs/concepts/configuration/secret.md | 8 ++++++++ .../configmap-secret/managing-secret-using-config-file.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md index 8d26c463f0bf8..071e0ed8361cc 100644 --- a/content/en/docs/concepts/configuration/secret.md +++ b/content/en/docs/concepts/configuration/secret.md @@ -387,6 +387,10 @@ stringData: password: t0p-Secret # required field for kubernetes.io/basic-auth ``` +{{< note >}} +`stringData` for a Secret does not work well with server-side apply +{{< /note >}} + The basic authentication Secret type is provided only for convenience. You can create an `Opaque` type for credentials used for basic authentication. However, using the defined and public Secret type (`kubernetes.io/basic-auth`) helps other @@ -545,6 +549,10 @@ stringData: usage-bootstrap-signing: "true" ``` +{{< note >}} +`stringData` for a Secret does not work well with server-side apply +{{< /note >}} + ## Working with Secrets ### Creating a Secret diff --git a/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md b/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md index 7245624bf8349..17696ae16e6c4 100644 --- a/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md +++ b/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md @@ -109,6 +109,10 @@ stringData: password: ``` +{{< note >}} +`stringData` for a Secret does not work well with server-side apply +{{< /note >}} + When you retrieve the Secret data, the command returns the encoded values, and not the plaintext values you provided in `stringData`. @@ -152,6 +156,10 @@ stringData: username: administrator ``` +{{< note >}} +`stringData` for a Secret does not work well with server-side apply +{{< /note >}} + The `Secret` object is created as follows: ```yaml From 60d9f83f594d7d3b40ba3e7421a6925a2ff8fd85 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Mon, 9 Oct 2023 21:53:16 +0800 Subject: [PATCH 2/3] Update secret.md --- content/en/docs/concepts/configuration/secret.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md index 071e0ed8361cc..ac74aaaf54e54 100644 --- a/content/en/docs/concepts/configuration/secret.md +++ b/content/en/docs/concepts/configuration/secret.md @@ -388,7 +388,7 @@ stringData: ``` {{< note >}} -`stringData` for a Secret does not work well with server-side apply +The `stringData` field for a Secret does not work well with server-side apply. {{< /note >}} The basic authentication Secret type is provided only for convenience. @@ -550,7 +550,7 @@ stringData: ``` {{< note >}} -`stringData` for a Secret does not work well with server-side apply +The `stringData` field for a Secret does not work well with server-side apply. {{< /note >}} ## Working with Secrets From cf837603093dee27329b8e4a965e61d1d481ba2f Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Mon, 9 Oct 2023 21:53:43 +0800 Subject: [PATCH 3/3] Update managing-secret-using-config-file.md --- .../configmap-secret/managing-secret-using-config-file.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md b/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md index 17696ae16e6c4..2f3dd8dc0ae92 100644 --- a/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md +++ b/content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md @@ -110,7 +110,7 @@ stringData: ``` {{< note >}} -`stringData` for a Secret does not work well with server-side apply +The `stringData` field for a Secret does not work well with server-side apply. {{< /note >}} When you retrieve the Secret data, the command returns the encoded values, @@ -157,7 +157,7 @@ stringData: ``` {{< note >}} -`stringData` for a Secret does not work well with server-side apply +The `stringData` field for a Secret does not work well with server-side apply. {{< /note >}} The `Secret` object is created as follows: