Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not try to update type of Secret in selfSignedCertProvider #6205

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Apr 9, 2024

If a cluster used user provided certificate and created a Secret named antrea-controller-tls of Opaque type, changing to use self-signed certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update the type of Secret if it already exists.


cert-manager has similar logic: cert-manager/cert-manager@7a4be1e

The following scenarios have been considered:

  1. cert-manager provided certificate -> Antrea self-signed certificate: as both of them use tls type
  2. user manually created certificate -> Antrea self-signed certificate: as Antrea doesn't update type
  3. Antrea self-signed certificate -> cert-manager provided certificate: as cert-manager doesn't update type
  4. Antrea self-signed certificate -> user manually created certificate (type of tls): user should keep the type unchanged, or delete the secret first to specify other types.

@tnqn tnqn added the action/backport Indicates a PR that requires backports. label Apr 9, 2024
If a cluster used user provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
@tnqn tnqn force-pushed the do-not-update-secret-type branch from c6c5237 to 2961d58 Compare April 9, 2024 06:21
@tnqn
Copy link
Member Author

tnqn commented Apr 9, 2024

/test-all

@antoninbas antoninbas merged commit 7bd05a9 into antrea-io:main Apr 9, 2024
52 of 56 checks passed
@tnqn tnqn deleted the do-not-update-secret-type branch April 10, 2024 02:41
tnqn added a commit to tnqn/antrea that referenced this pull request Apr 10, 2024
…-io#6205)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
tnqn added a commit to tnqn/antrea that referenced this pull request Apr 10, 2024
…-io#6205)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
tnqn added a commit to tnqn/antrea that referenced this pull request Apr 10, 2024
…-io#6205)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
tnqn added a commit that referenced this pull request Apr 10, 2024
…#6206)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
tnqn added a commit that referenced this pull request Apr 10, 2024
…#6207)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
tnqn added a commit that referenced this pull request Apr 10, 2024
…#6208)

If a cluster used user-provided certificate and created a Secret named
antrea-controller-tls of Opaque type, changing to use self-signed
certificate would fail because the type field is immutable.

To support switching the certificate provider, we don't try to update
the type of Secret if it already exists.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
@tnqn tnqn added kind/bug Categorizes issue or PR as related to a bug. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/backport Indicates a PR that requires backports.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants