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

[release-1.14] CLI flags parsing bugfix #6706

Merged

Conversation

inteon
Copy link
Member

@inteon inteon commented Feb 1, 2024

Manual backport of cert-manager/cmctl#14 and cert-manager/cmctl#13.

Fixes two issues introduced in #6562:

  1. We were mixing PreRun and PreRunE functions. However, cobra will not execute PreRun when PreRunE is set. (see https://github.com/cert-manager/cmctl/pull/14/files#r1467623809)
  2. Flags were parsed and set on a global variable, which was shared across all sub-commands. This caused the namespace default overwrite for the install subcommand to apply to all commands. (see https://github.com/cert-manager/cert-manager/pull/6706/files#diff-6afa2ae6fa2d57e759177e96b60d01f7cc307f1ac5a197466476314b79524343L34-L37 and
    cmd.Flag("namespace").DefValue = defaultCertManagerNamespace
    cmd.Flag("namespace").Value.Set(defaultCertManagerNamespace)
    )

Kind

/kind bug

Release Note

Fix bug in cmctl namespace detection which prevented it being used as a startupapicheck image in namespaces other than cert-manager.
Fix bug in cmctl which caused `cmctl experimental install` to panic.

@jetstack-bot jetstack-bot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 1, 2024
@inteon inteon force-pushed the release-1.14-cli-flags-bugfix branch from 22e9a04 to 85e9ba8 Compare February 1, 2024 16:30
@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2024
@wallrj
Copy link
Member

wallrj commented Feb 1, 2024

The motivation for this backport is to fix the ctl check api command so that it can properly determine the namespace it's running in when inside Kubernetes, right?
So the following helm install command (with non-standard namespace jetstack-secure) fails with the unreleased v1.14.0 images, but should succeed with this change:

helm upgrade cert-manager cert-manager     --install     --create-namespace     --wait     --namespace jetstack-secure     --set installCRDs=true --repo https://v1-14-0.jetstack-charts.pages.dev --set cainjector.image.repository=quay.io/jetstack/cert-manager-cainjector --set startupapicheck.image.repository=quay.io/jetstack/cert-manager-ctl

The failure is:

kubectl logs  -n jetstack-secure cert-manager-startupapicheck-r5sjt  --previous
Error from server (Forbidden): certificates.cert-manager.io is forbidden: User "system:serviceaccount:jetstack-secure:cert-manager-startupapicheck" cannot create resource "certificates" in API group "cert-manager.io" in the namespace "cert-manager"

See discussion with @hawksight who discovered this bug:

@SgtCoDFish
Copy link
Member

/hold

until the question above is answered!

@jetstack-bot jetstack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2024
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@inteon inteon force-pushed the release-1.14-cli-flags-bugfix branch from 85e9ba8 to 241e64f Compare February 1, 2024 17:29
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that ctl x install and ctl check api works from my laptop using current 1.13 release.

Fixes: #6697

`ctl x install` (default cert-manager namespace)
$ go run ./cmd/ctl x install
I0201 16:37:17.111396   34258 applycrd.go:31] "Creating the cert-manager CRDs" logger="cert-manager"
I0201 16:37:17.111429   34258 settings.go:118] "creating 6 resource(s)" logger="cert-manager"
I0201 16:37:17.135269   34258 applycrd.go:47] "Clearing discovery cache" logger="cert-manager"
I0201 16:37:17.135523   34258 settings.go:118] "beginning wait for 6 resources with timeout of 1m0s" logger="cert-manager"
I0201 16:37:19.722455   34258 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:37:19.783040   34258 settings.go:118] "creating 41 resource(s)" logger="cert-manager"
I0201 16:37:19.926050   34258 settings.go:118] "beginning wait for 41 resources with timeout of 5m0s" logger="cert-manager"
I0201 16:37:19.993146   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:21.951344   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:23.941439   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:25.944658   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:27.938400   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:29.940735   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:31.954376   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-webhook. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:33.950874   34258 settings.go:118] "Deployment is not ready: cert-manager/cert-manager-webhook. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:37:35.949721   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" ServiceAccount" logger="cert-manager"
I0201 16:37:35.951669   34258 settings.go:118] "Ignoring delete failure for \"cert-manager-startupapicheck\" /v1, Kind=ServiceAccount: serviceaccounts \"cert-manager-startupapicheck\" not found" logger="cert-manager"
I0201 16:37:36.024511   34258 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:37:36.028446   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" Role" logger="cert-manager"
I0201 16:37:36.030607   34258 settings.go:118] "Ignoring delete failure for \"cert-manager-startupapicheck:create-cert\" rbac.authorization.k8s.io/v1, Kind=Role: roles.rbac.authorization.k8s.io \"cert-manager-startupapicheck:create-cert\" not found" logger="cert-manager"
I0201 16:37:36.083087   34258 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:37:36.088297   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" RoleBinding" logger="cert-manager"
I0201 16:37:36.090326   34258 settings.go:118] "Ignoring delete failure for \"cert-manager-startupapicheck:create-cert\" rbac.authorization.k8s.io/v1, Kind=RoleBinding: rolebindings.rbac.authorization.k8s.io \"cert-manager-startupapicheck:create-cert\" not found" logger="cert-manager"
I0201 16:37:36.146051   34258 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:37:36.150021   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" Job" logger="cert-manager"
I0201 16:37:36.152329   34258 settings.go:118] "Ignoring delete failure for \"cert-manager-startupapicheck\" batch/v1, Kind=Job: jobs.batch \"cert-manager-startupapicheck\" not found" logger="cert-manager"
I0201 16:37:36.210269   34258 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:37:36.214747   34258 settings.go:118] "Watching for changes to Job cert-manager-startupapicheck with timeout of 5m0s" logger="cert-manager"
I0201 16:37:36.219142   34258 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: ADDED" logger="cert-manager"
I0201 16:37:36.219162   34258 settings.go:118] "cert-manager-startupapicheck: Jobs active: 0, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:37:36.227738   34258 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:37:36.227778   34258 settings.go:118] "cert-manager-startupapicheck: Jobs active: 1, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:37:42.973775   34258 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:37:42.973823   34258 settings.go:118] "cert-manager-startupapicheck: Jobs active: 0, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:37:42.986209   34258 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:37:42.987039   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" ServiceAccount" logger="cert-manager"
I0201 16:37:42.992312   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" Role" logger="cert-manager"
I0201 16:37:42.996406   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" RoleBinding" logger="cert-manager"
I0201 16:37:43.000956   34258 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" Job" logger="cert-manager"
NAME: cert-manager
LAST DEPLOYED: Thu Feb  1 16:37:19 2024
NAMESPACE: cert-manager
STATUS: deployed
REVISION: 1
DESCRIPTION: Cert-manager was installed using the cert-manager CLI
NOTES:
cert-manager v1.13.3 has been deployed successfully!

In order to begin issuing certificates, you will need to set up a ClusterIssuer
or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).

More information on the different types of issuers and how to configure them
can be found in our documentation:

https://cert-manager.io/docs/configuration/

For information on how to configure cert-manager to automatically provision
Certificates for Ingress resources, take a look at the `ingress-shim`
documentation:

https://cert-manager.io/docs/usage/ingress/
`ctl x install -n jetstack-secure` (non-default namespace)
$ go run ./cmd/ctl x install -n jetstack-secure
I0201 16:42:17.835737   38118 applycrd.go:31] "Creating the cert-manager CRDs" logger="cert-manager"
I0201 16:42:17.835781   38118 settings.go:118] "creating 6 resource(s)" logger="cert-manager"
I0201 16:42:17.867376   38118 applycrd.go:47] "Clearing discovery cache" logger="cert-manager"
I0201 16:42:17.867616   38118 settings.go:118] "beginning wait for 6 resources with timeout of 1m0s" logger="cert-manager"
I0201 16:42:20.458242   38118 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:42:20.535657   38118 settings.go:118] "creating 41 resource(s)" logger="cert-manager"
I0201 16:42:20.636913   38118 settings.go:118] "beginning wait for 41 resources with timeout of 5m0s" logger="cert-manager"
I0201 16:42:20.697144   38118 settings.go:118] "Deployment is not ready: jetstack-secure/cert-manager-cainjector. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:42:22.670759   38118 settings.go:118] "Deployment is not ready: jetstack-secure/cert-manager-webhook. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:42:24.660926   38118 settings.go:118] "Deployment is not ready: jetstack-secure/cert-manager-webhook. 0 out of 1 expected pods are ready" logger="cert-manager"
I0201 16:42:26.665944   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" ServiceAccount" logger="cert-manager"
I0201 16:42:26.747366   38118 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:42:26.751347   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" Role" logger="cert-manager"
I0201 16:42:26.814230   38118 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:42:26.818083   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" RoleBinding" logger="cert-manager"
I0201 16:42:26.875408   38118 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:42:26.880941   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" Job" logger="cert-manager"
I0201 16:42:26.944232   38118 settings.go:118] "creating 1 resource(s)" logger="cert-manager"
I0201 16:42:26.952103   38118 settings.go:118] "Watching for changes to Job cert-manager-startupapicheck with timeout of 5m0s" logger="cert-manager"
I0201 16:42:26.956295   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: ADDED" logger="cert-manager"
I0201 16:42:26.956336   38118 settings.go:118] "cert-manager-startupapicheck: Jobs active: 0, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:42:26.964783   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:42:26.964820   38118 settings.go:118] "cert-manager-startupapicheck: Jobs active: 1, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:42:27.965822   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:42:27.965852   38118 settings.go:118] "cert-manager-startupapicheck: Jobs active: 1, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:43:29.164328   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:43:29.164360   38118 settings.go:118] "cert-manager-startupapicheck: Jobs active: 1, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:43:31.274999   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:43:31.275061   38118 settings.go:118] "cert-manager-startupapicheck: Jobs active: 0, jobs failed: 0, jobs succeeded: 0" logger="cert-manager"
I0201 16:43:31.287577   38118 settings.go:118] "Add/Modify event for cert-manager-startupapicheck: MODIFIED" logger="cert-manager"
I0201 16:43:31.288748   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" ServiceAccount" logger="cert-manager"
I0201 16:43:31.295333   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" Role" logger="cert-manager"
I0201 16:43:31.300311   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck:create-cert\" RoleBinding" logger="cert-manager"
I0201 16:43:31.304707   38118 settings.go:118] "Starting delete for \"cert-manager-startupapicheck\" Job" logger="cert-manager"
NAME: cert-manager
LAST DEPLOYED: Thu Feb  1 16:42:19 2024
NAMESPACE: jetstack-secure
STATUS: deployed
REVISION: 1
DESCRIPTION: Cert-manager was installed using the cert-manager CLI
NOTES:
cert-manager v1.13.3 has been deployed successfully!

In order to begin issuing certificates, you will need to set up a ClusterIssuer
or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).

More information on the different types of issuers and how to configure them
can be found in our documentation:

https://cert-manager.io/docs/configuration/

For information on how to configure cert-manager to automatically provision
Certificates for Ingress resources, take a look at the `ingress-shim`
documentation:

https://cert-manager.io/docs/usage/ingress/
`ctl check api` works from laptop
$ go run ./cmd/ctl check api
The cert-manager API is ready

$ go run ./cmd/ctl check api -n jetstack-secure
The cert-manager API is ready

$ go run ./cmd/ctl check api -n non-existing-namespace
Error from server (NotFound): namespaces "non-existing-namespace" not found
exit status 1

@inteon
Copy link
Member Author

inteon commented Feb 1, 2024

/unhold

@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2024
@inteon
Copy link
Member Author

inteon commented Feb 1, 2024

/approve

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 1, 2024
@wallrj wallrj linked an issue Feb 1, 2024 that may be closed by this pull request
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helm install using non-default namespace and ctl image for startupapicheck
$ make ko-deploy-certmanager KO_HELM_VALUES_FILES=values.yaml
sed -e "s:{{RELEASE_VERSION}}:v1.14.0-12-g241e64fd3019c2:g" < deploy/charts/cert-manager/README.template.md > _bin/helm/cert-manager/README.md
curl --silent --show-error --fail --location --retry 10 --retry-connrefused https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -o _bin/downloaded/tools/yq@v4.35.1_linux_amd64
./hack/util/checkhash.sh _bin/downloaded/tools/yq@v4.35.1_linux_amd64 bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08
chmod +x _bin/downloaded/tools/yq@v4.35.1_linux_amd64
cd _bin/tools/ && ln -f -s ../downloaded/tools/yq@v4.35.1_linux_amd64 yq
IFS= read -rd '' SIGNKEY_ANNOTATION < <(cat deploy/charts/cert-manager/signkey_annotation.txt) ; \
        SIGNKEY_ANNOTATION=$SIGNKEY_ANNOTATION /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq eval \
        '.annotations."artifacthub.io/signKey" = strenv(SIGNKEY_ANNOTATION) | .annotations."artifacthub.io/prerelease" = "true" | .version = "v1.14.0-12-g241e64fd3019c2" | .appVersion = "v1.14.0-12-g241e64fd3019c2"' \
        deploy/charts/cert-manager/Chart.template.yaml > _bin/helm/cert-manager/Chart.yaml
cp deploy/charts/cert-manager/values.yaml _bin/helm/cert-manager/values.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-config.yaml _bin/helm/cert-manager/templates/cainjector-config.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-deployment.yaml _bin/helm/cert-manager/templates/cainjector-deployment.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-poddisruptionbudget.yaml _bin/helm/cert-manager/templates/cainjector-poddisruptionbudget.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-psp-clusterrole.yaml _bin/helm/cert-manager/templates/cainjector-psp-clusterrole.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-psp-clusterrolebinding.yaml _bin/helm/cert-manager/templates/cainjector-psp-clusterrolebinding.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-psp.yaml _bin/helm/cert-manager/templates/cainjector-psp.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-rbac.yaml _bin/helm/cert-manager/templates/cainjector-rbac.yaml
cp -f deploy/charts/cert-manager/templates/cainjector-serviceaccount.yaml _bin/helm/cert-manager/templates/cainjector-serviceaccount.yaml
cp -f deploy/charts/cert-manager/templates/controller-config.yaml _bin/helm/cert-manager/templates/controller-config.yaml
cp -f deploy/charts/cert-manager/templates/deployment.yaml _bin/helm/cert-manager/templates/deployment.yaml
cp -f deploy/charts/cert-manager/templates/networkpolicy-egress.yaml _bin/helm/cert-manager/templates/networkpolicy-egress.yaml
cp -f deploy/charts/cert-manager/templates/networkpolicy-webhooks.yaml _bin/helm/cert-manager/templates/networkpolicy-webhooks.yaml
cp -f deploy/charts/cert-manager/templates/poddisruptionbudget.yaml _bin/helm/cert-manager/templates/poddisruptionbudget.yaml
cp -f deploy/charts/cert-manager/templates/podmonitor.yaml _bin/helm/cert-manager/templates/podmonitor.yaml
cp -f deploy/charts/cert-manager/templates/psp-clusterrole.yaml _bin/helm/cert-manager/templates/psp-clusterrole.yaml
cp -f deploy/charts/cert-manager/templates/psp-clusterrolebinding.yaml _bin/helm/cert-manager/templates/psp-clusterrolebinding.yaml
cp -f deploy/charts/cert-manager/templates/psp.yaml _bin/helm/cert-manager/templates/psp.yaml
cp -f deploy/charts/cert-manager/templates/rbac.yaml _bin/helm/cert-manager/templates/rbac.yaml
cp -f deploy/charts/cert-manager/templates/service.yaml _bin/helm/cert-manager/templates/service.yaml
cp -f deploy/charts/cert-manager/templates/serviceaccount.yaml _bin/helm/cert-manager/templates/serviceaccount.yaml
cp -f deploy/charts/cert-manager/templates/servicemonitor.yaml _bin/helm/cert-manager/templates/servicemonitor.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-job.yaml _bin/helm/cert-manager/templates/startupapicheck-job.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-psp-clusterrole.yaml _bin/helm/cert-manager/templates/startupapicheck-psp-clusterrole.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-psp-clusterrolebinding.yaml _bin/helm/cert-manager/templates/startupapicheck-psp-clusterrolebinding.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-psp.yaml _bin/helm/cert-manager/templates/startupapicheck-psp.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-rbac.yaml _bin/helm/cert-manager/templates/startupapicheck-rbac.yaml
cp -f deploy/charts/cert-manager/templates/startupapicheck-serviceaccount.yaml _bin/helm/cert-manager/templates/startupapicheck-serviceaccount.yaml
cp -f deploy/charts/cert-manager/templates/webhook-config.yaml _bin/helm/cert-manager/templates/webhook-config.yaml
cp -f deploy/charts/cert-manager/templates/webhook-deployment.yaml _bin/helm/cert-manager/templates/webhook-deployment.yaml
cp -f deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml _bin/helm/cert-manager/templates/webhook-mutating-webhook.yaml
cp -f deploy/charts/cert-manager/templates/webhook-poddisruptionbudget.yaml _bin/helm/cert-manager/templates/webhook-poddisruptionbudget.yaml
cp -f deploy/charts/cert-manager/templates/webhook-psp-clusterrole.yaml _bin/helm/cert-manager/templates/webhook-psp-clusterrole.yaml
cp -f deploy/charts/cert-manager/templates/webhook-psp-clusterrolebinding.yaml _bin/helm/cert-manager/templates/webhook-psp-clusterrolebinding.yaml
cp -f deploy/charts/cert-manager/templates/webhook-psp.yaml _bin/helm/cert-manager/templates/webhook-psp.yaml
cp -f deploy/charts/cert-manager/templates/webhook-rbac.yaml _bin/helm/cert-manager/templates/webhook-rbac.yaml
cp -f deploy/charts/cert-manager/templates/webhook-service.yaml _bin/helm/cert-manager/templates/webhook-service.yaml
cp -f deploy/charts/cert-manager/templates/webhook-serviceaccount.yaml _bin/helm/cert-manager/templates/webhook-serviceaccount.yaml
cp -f deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml _bin/helm/cert-manager/templates/webhook-validating-webhook.yaml
cp deploy/charts/cert-manager/templates/NOTES.txt _bin/helm/cert-manager/templates/NOTES.txt
cp deploy/charts/cert-manager/templates/_helpers.tpl _bin/helm/cert-manager/templates/_helpers.tpl
echo '{{- if .Values.installCRDs }}' > _bin/helm/cert-manager/templates/crds.yaml
./hack/concat-yaml.sh deploy/crds/crd-certificaterequests.yaml deploy/crds/crd-certificates.yaml deploy/crds/crd-challenges.yaml deploy/crds/crd-clusterissuers.yaml deploy/crds/crd-issuers.yaml deploy/crds/crd-orders.yaml >> _bin/helm/cert-manager/templates/crds.yaml
echo '{{- end }}' >> _bin/helm/cert-manager/templates/crds.yaml
curl --silent --show-error --fail --location --retry 10 --retry-connrefused https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz -o _bin/downloaded/tools/helm@v3.12.3_linux_amd64.tar.gz
./hack/util/checkhash.sh _bin/downloaded/tools/helm@v3.12.3_linux_amd64.tar.gz 1b2313cd198d45eab00cc37c38f6b1ca0a948ba279c29e322bdf426d406129b5
tar xfO _bin/downloaded/tools/helm@v3.12.3_linux_amd64.tar.gz linux-amd64/helm > _bin/downloaded/tools/helm@v3.12.3_linux_amd64
chmod +x _bin/downloaded/tools/helm@v3.12.3_linux_amd64
rm -f _bin/downloaded/tools/helm@v3.12.3_linux_amd64.tar.gz
cd _bin/tools/ && ln -f -s ../downloaded/tools/helm@v3.12.3_linux_amd64 helm
/home/richard/projects/cert-manager/cert-manager/_bin/tools/helm package --app-version=v1.14.0-12-g241e64fd3019c2 --version=v1.14.0-12-g241e64fd3019c2 --destination "_bin/" ./_bin/helm/cert-manager
Successfully packaged chart and saved it to: _bin/cert-manager-v1.14.0-12-g241e64fd3019c2.tgz
curl --silent --show-error --fail --location --retry 10 --retry-connrefused https://github.com/ko-build/ko/releases/download/v0.14.1/ko_0.14.1_Linux_x86_64.tar.gz -o _bin/downloaded/tools/ko@v0.14.1_linux_amd64.tar.gz
./hack/util/checkhash.sh _bin/downloaded/tools/ko@v0.14.1_linux_amd64.tar.gz 3f8f8e3fb4b78a4dfc0708df2b58f202c595a66c34195786f9a279ea991f4eae
tar xfO _bin/downloaded/tools/ko@v0.14.1_linux_amd64.tar.gz ko > _bin/downloaded/tools/ko@v0.14.1_linux_amd64
chmod +x _bin/downloaded/tools/ko@v0.14.1_linux_amd64
rm _bin/downloaded/tools/ko@v0.14.1_linux_amd64.tar.gz
cd _bin/tools/ && ln -f -s ../downloaded/tools/ko@v0.14.1_linux_amd64 ko
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/controller \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/controller.yaml
2024/02/01 17:32:11 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/controller-binary
2024/02/01 17:32:12 Building github.com/cert-manager/cert-manager/controller-binary for linux/amd64
2024/02/01 17:32:21 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-controller:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:32:25 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:32:26 pushed blob: sha256:359e4f5a826cf0b8e1a338cdf3f39de87a8b70e131a2d6cf2d764d55c01a7200
2024/02/01 17:32:27 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:32:31 pushed blob: sha256:7c3e6cdfe7906bf8a0ba57464b5bbbb0b2a97cdcb7c65cf67022f1d849a5b488
2024/02/01 17:32:32 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-controller:v1.14.0-12-g241e64fd3019c2: digest: sha256:8ad8715aa6f3e27c09ecea9077d6692bc140568dec654f71408d5453bb1064ad size: 1211
2024/02/01 17:32:32 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-controller:v1.14.0-12-g241e64fd3019c2@sha256:8ad8715aa6f3e27c09ecea9077d6692bc140568dec654f71408d5453bb1064ad
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/acmesolver \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/acmesolver.yaml
2024/02/01 17:32:33 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/acmesolver-binary
2024/02/01 17:32:34 Building github.com/cert-manager/cert-manager/acmesolver-binary for linux/amd64
2024/02/01 17:32:35 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-acmesolver:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:32:40 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:32:40 pushed blob: sha256:ebb8c9438bf9d76b40b65ef1d32eb8ce804794aa23206d6f0e0ff9536b631c74
2024/02/01 17:32:41 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:32:42 pushed blob: sha256:8978475aaf668215af0781aff7bc4e44f14d17bac13ae73b2baca5b50a33226b
2024/02/01 17:32:43 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-acmesolver:v1.14.0-12-g241e64fd3019c2: digest: sha256:dffa0e80a7f211a6f7445e97b468ee3a0c8ca39919d193539073e025a24c46ac size: 1211
2024/02/01 17:32:43 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-acmesolver:v1.14.0-12-g241e64fd3019c2@sha256:dffa0e80a7f211a6f7445e97b468ee3a0c8ca39919d193539073e025a24c46ac
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/cainjector \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/cainjector.yaml
2024/02/01 17:32:45 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/cainjector-binary
2024/02/01 17:32:45 Building github.com/cert-manager/cert-manager/cainjector-binary for linux/amd64
2024/02/01 17:32:48 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-cainjector:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:32:52 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:32:52 pushed blob: sha256:6f3f1bc73875c211804a39830ffb5ca0fdb34db7a340af78b165b9f7dc1b682b
2024/02/01 17:32:54 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:32:56 pushed blob: sha256:479dd184c434812f8a444a5653ff4a29ad37dfcdcb11e44e11e7c5d1fad0b129
2024/02/01 17:32:57 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-cainjector:v1.14.0-12-g241e64fd3019c2: digest: sha256:c128ad05e502ad0ce5c904980cf5710937083763fd7de573ea4064981b5a27dc size: 1211
2024/02/01 17:32:57 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-cainjector:v1.14.0-12-g241e64fd3019c2@sha256:c128ad05e502ad0ce5c904980cf5710937083763fd7de573ea4064981b5a27dc
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/webhook \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/webhook.yaml
2024/02/01 17:32:58 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/webhook-binary
2024/02/01 17:33:00 Building github.com/cert-manager/cert-manager/webhook-binary for linux/amd64
2024/02/01 17:33:03 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-webhook:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:33:08 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:33:08 pushed blob: sha256:671bf52e696edcbf6120dd1de73ac7ff360a1dc9e823a58838022024ba6d61dd
2024/02/01 17:33:09 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:33:12 pushed blob: sha256:d8e24f8c958782475e09c88db4b3456fc566ae2832a11edd7d89b20d67eee6b7
2024/02/01 17:33:14 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-webhook:v1.14.0-12-g241e64fd3019c2: digest: sha256:d7ea2f704c3582c194faa5b83d013346fc6050f13578116b9693de2f9d9ee194 size: 1211
2024/02/01 17:33:14 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-webhook:v1.14.0-12-g241e64fd3019c2@sha256:d7ea2f704c3582c194faa5b83d013346fc6050f13578116b9693de2f9d9ee194
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/ctl \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/ctl.yaml
2024/02/01 17:33:15 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/cmd/ctl
2024/02/01 17:33:15 Building github.com/cert-manager/cert-manager/cmd/ctl for linux/amd64
2024/02/01 17:33:22 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-ctl:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:33:26 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:33:26 pushed blob: sha256:f66bfcfc109aea848bd812a3072b6021d5b9bd47674f96744578e8b7ccea9aca
2024/02/01 17:33:28 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:33:31 pushed blob: sha256:6d3619fd8855f1ac9b02c49da041f6620ec456cfb1d4bd1f49cbda1218a3f1db
2024/02/01 17:33:33 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-ctl:v1.14.0-12-g241e64fd3019c2: digest: sha256:a501818e3c0a45c30e991db8117e78f86a03d912ea79544e4fadcc42b962df27 size: 1211
2024/02/01 17:33:33 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-ctl:v1.14.0-12-g241e64fd3019c2@sha256:a501818e3c0a45c30e991db8117e78f86a03d912ea79544e4fadcc42b962df27
/home/richard/projects/cert-manager/cert-manager/_bin/tools/ko build ./cmd/startupapicheck \
        --bare \
        --sbom=none \
        --platform=linux/amd64 \
        --tags=v1.14.0-12-g241e64fd3019c2 \
        | /home/richard/projects/cert-manager/cert-manager/_bin/tools/yq 'capture("(?P<ref>(?P<repository>[^:]+):(?P<tag>[^@]+)@(?P<digest>.*))")' > _bin/scratch/ko/startupapicheck.yaml
2024/02/01 17:33:34 Using base cgr.dev/chainguard/static:latest@sha256:17c46078cc3a08fa218189d8446f88990361e8fd9e2cb6f6f535a7496c389e8e for github.com/cert-manager/cert-manager/startupapicheck-binary
2024/02/01 17:33:34 Building github.com/cert-manager/cert-manager/startupapicheck-binary for linux/amd64
2024/02/01 17:33:37 Publishing ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-startupapicheck:v1.14.0-12-g241e64fd3019c2
2024/02/01 17:33:41 pushed blob: sha256:250c06f7c38e52dc77e5c7586c3e40280dc7ff9bb9007c396e06d96736cf8542
2024/02/01 17:33:42 pushed blob: sha256:0fcb2d3df8aa1922ba6665620093523120e7f73507e4d7cdab4c0ea5dd2d8601
2024/02/01 17:33:43 pushed blob: sha256:0e965d42d851d3be4fcb8b72dda14de0e42d4476ec68f1e4aea70b172185c060
2024/02/01 17:33:46 pushed blob: sha256:0ebae02c72e8afcca667a492184e95580299d25978435b054a970166cb626d34
2024/02/01 17:33:47 ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-startupapicheck:v1.14.0-12-g241e64fd3019c2: digest: sha256:56baa5a669e855a7c614f3dd2f376e697a71b911a575a9167aebb2eea0e90a72 size: 1211
2024/02/01 17:33:47 Published ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-startupapicheck:v1.14.0-12-g241e64fd3019c2@sha256:56baa5a669e855a7c614f3dd2f376e697a71b911a575a9167aebb2eea0e90a72
/home/richard/projects/cert-manager/cert-manager/_bin/tools/helm upgrade cert-manager _bin/cert-manager.tgz \
        --install \
        --create-namespace \
        --wait \
        --namespace jetstack-secure \
        --values values.yaml \
        --set image.repository="ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-controller" \
        --set image.digest="sha256:8ad8715aa6f3e27c09ecea9077d6692bc140568dec654f71408d5453bb1064ad" \
        --set cainjector.image.repository="ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-cainjector" \
        --set cainjector.image.digest="sha256:c128ad05e502ad0ce5c904980cf5710937083763fd7de573ea4064981b5a27dc" \
        --set webhook.image.repository="ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-webhook" \
        --set webhook.image.digest="sha256:d7ea2f704c3582c194faa5b83d013346fc6050f13578116b9693de2f9d9ee194" \
        --set startupapicheck.image.repository="ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-ctl" \
        --set startupapicheck.image.digest="sha256:a501818e3c0a45c30e991db8117e78f86a03d912ea79544e4fadcc42b962df27" \
        --set installCRDs=true \
        --set "extraArgs={--acme-http01-solver-image=ttl.sh/1843f20a-ffed-42a8-942b-7d2822f1906e/cert-manager-6706/cert-manager-acmesolver@sha256:dffa0e80a7f211a6f7445e97b468ee3a0c8ca39919d193539073e025a24c46ac}"
Release "cert-manager" does not exist. Installing it now.
NAME: cert-manager
LAST DEPLOYED: Thu Feb  1 17:33:47 2024
NAMESPACE: jetstack-secure
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
cert-manager v1.14.0-12-g241e64fd3019c2 has been deployed successfully!

In order to begin issuing certificates, you will need to set up a ClusterIssuer
or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).

More information on the different types of issuers and how to configure them
can be found in our documentation:

https://cert-manager.io/docs/configuration/

For information on how to configure cert-manager to automatically provision
Certificates for Ingress resources, take a look at the `ingress-shim`
documentation:

https://cert-manager.io/docs/usage/ingress/

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@inteon What testing have you done? Please paste any relevant evidence of testing in this PR.

And add comments to the code explaining how all these prerun functions interact and documenting the gotcha that you fixed in this PR.

Also update the PR description explaining what the bug is and how you fixed it.

@inteon
Copy link
Member Author

inteon commented Feb 2, 2024

These are the commands I used to verify that the backport works as expected.

$ _bin/cmctl/cmctl-linux-amd64 x install
...
NAME: cert-manager
LAST DEPLOYED: Fri Feb  2 09:44:55 2024
NAMESPACE: cert-manager
STATUS: deployed
REVISION: 1
DESCRIPTION: Cert-manager was installed using the cert-manager CLI
NOTES:
cert-manager v1.13.3 has been deployed successfully!
$ _bin/cmctl/cmctl-linux-amd64 x uninstall
...
I0202 09:47:09.886548  145276 settings.go:118] "purge requested for cert-manager" logger="cert-manager"
$ _bin/cmctl/cmctl-linux-amd64 check api -v=10 2>&1 | grep default
...
I0202 09:53:31.176878  147684 round_trippers.go:466] curl -v -XPOST  -H "Accept: application/json, */*" -H "Content-Type: application/json" -H "User-Agent: cmctl-linux-amd64/v0.0.0 (linux/amd64) kubernetes/$Format" 'https://127.0.0.1:43223/apis/cert-manager.io/v1/namespaces/default/certificates?dryRun=All'

I added the explanations for the fixes that were backported in the PR description.

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2024
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon, wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wallrj wallrj added this to the 1.14 milestone Feb 2, 2024
@jetstack-bot jetstack-bot merged commit c7b1e30 into cert-manager:release-1.14 Feb 2, 2024
7 checks passed
@jetstack-bot jetstack-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Feb 2, 2024
@jetstack-bot jetstack-bot removed the release-note-none Denotes a PR that doesn't merit a release note. label Feb 2, 2024
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Feb 4, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cert-manager](https://github.com/cert-manager/cert-manager) | minor | `v1.13.3` -> `v1.14.1` |

---

### Release Notes

<details>
<summary>cert-manager/cert-manager (cert-manager)</summary>

### [`v1.14.1`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.1)

[Compare Source](cert-manager/cert-manager@v1.14.0...v1.14.1)

cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters.

cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions.

> 📢 cert-manager `v1.14.1` fixes bugs found *during* the release of `v1.14.0`.
>
> When upgrading to cert-manager release 1.14, please skip `v1.14.0` and install this patch version instead.

##### Documentation

-   [Release notes](https://cert-manager.io/docs/releases/release-notes/release-notes-1.14)
-   [Upgrade notes](https://cert-manager.io/docs/releases/upgrading/upgrading-1.13-1.14)
-   [Installation instructions](https://cert-manager.io/docs/installation/)

##### Changes since `v1.14.0`

##### Bug or Regression

-   Fix broken cainjector image value in Helm chart ([#&#8203;6693](cert-manager/cert-manager#6693), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Fix bug in cmctl namespace detection which prevented it being used as a startupapicheck image in namespaces other than cert-manager. ([#&#8203;6706](cert-manager/cert-manager#6706), [@&#8203;inteon](https://github.com/inteon))
-   Fix bug in cmctl which caused `cmctl experimental install` to panic. ([#&#8203;6706](cert-manager/cert-manager#6706), [@&#8203;inteon](https://github.com/inteon))

### [`v1.14.0`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.0)

[Compare Source](cert-manager/cert-manager@v1.13.3...v1.14.0)

cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters.

cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions.

> ⚠️ This version has known issues. Please install `v1.14.1` instead.
>
> During the release of `v1.14.0`, the Helm chart was found to use the wrong OCI image for the `cainjector` Deployment,
> which caused the Helm installation and the static manifest based installation to fail.
> Upon discovery of this bug, the release of `v1.14.0` was paused before the Helm chart or GitHub release were published;
> but the Git tag and the OCI images had already been published.
>
> The cert-manager team next fixed the Helm chart and two other bugs which are listed in the "Known Issues" section below,
> and then released `v1.14.1`, which is the version that users are strongly advised to install when they upgrade to 1.14.
>
> In order to complete the stalled `v1.14.0` release,
> the Helm chart and static YAML installation files were regenerated on a team member's laptop,
> using exactly the same build scripts as are used in the automated release process,
> and using the `v1.14.1` version of the code.
> The working  `v1.14.0` Helm chart was published,
> and the working versions of the static manifest files attached to the draft `v1.14.0` GitHub release,
> and that was then published.
>
> For these reasons, users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead.

##### Known Issues

-   During the release of `v1.14.0`, the Helm chart for this version was found to use the wrong OCI image for the `cainjector` Deployment,
    which caused the Helm installation to fail.
    In order to complete the release, the cert-manager team have manually updated the Helm chart for this version,
    which contains all the Helm chart fixes which are in `v1.14.1`.
    But users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead.
-   A bug in cmctl namespace detection prevents it being used as a `startupapicheck` image in namespaces other than cert-manager.
-   A bug in cmctl causes `cmctl experimental install` to panic.

##### Breaking Changes

The startupapicheck job uses a new OCI image called "startupapicheck", instead of the ctl image.
If you run in an environment in which images cannot be pulled, be sure to include the new image.

The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob.

##### Major Themes

##### New X.509 Features

The cert-manager Certificate resource now allows you to configure a subset of "Other Name" SANs,
which are described in the [Subject Alternative Name section of RFC 5280](https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.6) (on page 37).

We specifically support any `otherName` type with a `UTF-8` value, such as the [User Principal Name](https://docs.venafi.com/Docs/current/TopNav/Content/Certificates/r-UEP-support-SANs.php) or [`sAMAccountName`](https://learn.microsoft.com/en-us/windows/win32/ad/naming-properties).
These are useful when issuing unique certificates for authenticating with LDAP systems such as Microsoft Active Directory.
For example you can create certificates with this block in the spec:

      otherNames:
        - oid: 1.3.6.1.4.1.311.20.2.3 # UPN OID
          utf8Value: upn@domain.local

The feature is still in alpha stage and requires you to [enable the `OtherName` feature flag in the controller and webhook components](../../installation/configuring-components.md#feature-gates).

##### New CA certificate Features

You can now specify the X.509 v3 Authority Information Accessors extension,
with URLs for certificates issued by the CA issuer.

Users can now use name constraints in CA certificates.
To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

##### Security

An ongoing security audit of the cert-manager code revealed some weaknesses which we have addressed in this release,
such as using more secure default settings in the HTTP servers that serve metrics, healthz and pprof endpoints.
This will help mitigate denial-of-service attacks against those important services.

All the cert-manager containers are now configured with read only root file system by default,
to prevent unexpected changes to the file system of the OCI image.

And it is now possible to configure the metrics server to use HTTPS rather than HTTP,
so that clients can verify the identity of the metrics server.

##### Other

The liveness probe of the cert-manager controller Pod is now enabled by default.

There is a new option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS.

##### Community

Thanks again to all open-source contributors with commits in this release, including:

-   [@&#8203;ABWassim](https://github.com/ABWassim)
-   [@&#8203;JoeNorth](https://github.com/JoeNorth)
-   [@&#8203;allenmunC1](https://github.com/allenmunC1)
-   [@&#8203;asapekia](https://github.com/asapekia)
-   [@&#8203;jeremycampbell](https://github.com/jeremycampbell)
-   [@&#8203;jkroepke](https://github.com/jkroepke)
-   [@&#8203;jsoref](https://github.com/jsoref)
-   [@&#8203;lauraseidler](https://github.com/lauraseidler)
-   [@&#8203;pevidex](https://github.com/pevidex)
-   [@&#8203;phillebaba](https://github.com/phillebaba)
-   [@&#8203;snorwin](https://github.com/snorwin)
-   [@&#8203;tanujd11](https://github.com/tanujd11)
-   [@&#8203;tberreis](https://github.com/tberreis)
-   [@&#8203;vinny](https://github.com/vinny)

Thanks also to the following cert-manager maintainers for their contributions during this release:

-   [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish)
-   [@&#8203;SpectralHiss](https://github.com/SpectralHiss)
-   [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot)
-   [@&#8203;hawksight](https://github.com/hawksight)
-   [@&#8203;inteon](https://github.com/inteon)
-   [@&#8203;maelvls](https://github.com/maelvls)
-   [@&#8203;wallrj](https://github.com/wallrj)

Equally thanks to everyone who provided feedback, helped users and raised issues on GitHub and Slack and joined our meetings!

Thanks also to the [CNCF](https://www.cncf.io/), which provides resources and support, and to the AWS open source team for being good community members and for their maintenance of the [PrivateCA Issuer](https://github.com/cert-manager/aws-privateca-issuer).

In addition, massive thanks to [Venafi](https://www.venafi.com/) for contributing developer time and resources towards the continued maintenance of cert-manager projects.

##### Changes

##### Feature

-   ACME challenge solver Pod for HTTP01 will get a default annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"`. You can provide an annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"` in your `podTemplate` if you don't like this. ([#&#8203;6349](cert-manager/cert-manager#6349), [@&#8203;jsoref](https://github.com/jsoref))
-   Added a clock skew detector liveness probe that will force a restart in case we detect a skew between the internal monotonic clock and the system clock of more than 5 minutes.
    Also, the controller's liveness probe is now enabled by default. ([#&#8203;6328](cert-manager/cert-manager#6328), [@&#8203;inteon](https://github.com/inteon))
-   Added a new flag (--dynamic-serving-leaf-duration) that can adjust the lifetime of the dynamic leaf certificates ([#&#8203;6552](cert-manager/cert-manager#6552), [@&#8203;allenmunC1](https://github.com/allenmunC1))
-   Added support for `otherName` SANS in Certificates ([#&#8203;6404](cert-manager/cert-manager#6404), [@&#8203;SpectralHiss](https://github.com/SpectralHiss))
-   Added the option to specify the  X.509 v3 Authority Information Accessors extension CA Issuers URLs for certificates issued by the CA issuer. ([#&#8203;6486](cert-manager/cert-manager#6486), [@&#8203;jeremycampbell](https://github.com/jeremycampbell-okta))
-   Adds cert-manager's new core infrastructure initiative badge! See more details on https://www.bestpractices.dev/projects/8079 ([#&#8203;6497](cert-manager/cert-manager#6497), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   All Pods are now configured with `readOnlyRootFilesystem` by default. ([#&#8203;6453](cert-manager/cert-manager#6453), [@&#8203;wallrj](https://github.com/wallrj))
-   MAYBE BREAKING: The startupapicheck job is now handled by an entirely new container called "startupapicheck". This replaces the previous ctl container. If you run in an environment in which images cannot be pulled, be sure to include the new container. ([#&#8203;6549](cert-manager/cert-manager#6549), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   New option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS[#&#8203;12](cert-manager/cert-manager#12) keystores. Fixes issues [#&#8203;5957](cert-manager/cert-manager#5957) and [#&#8203;6523](cert-manager/cert-manager#6523). ([#&#8203;6548](cert-manager/cert-manager#6548), [@&#8203;snorwin](https://github.com/snorwin))
-   The ACME HTTP01 solver Pod is now configured with `readOnlyRootFilesystem: true` ([#&#8203;6462](cert-manager/cert-manager#6462), [@&#8203;wallrj](https://github.com/wallrj))
-   Updates the AWS SDK for Go to 1.48.7 to support Amazon EKS Pod Identity ([#&#8203;6519](cert-manager/cert-manager#6519), [@&#8203;JoeNorth](https://github.com/JoeNorth))
-   Users can now use name constraints in CA certificates. To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10 ([#&#8203;6500](cert-manager/cert-manager#6500), [@&#8203;tanujd11](https://github.com/tanujd11))
-   ⚠️ potentially breaking ⚠️: The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob. ([#&#8203;6053](cert-manager/cert-manager#6053), [@&#8203;inteon](https://github.com/inteon))
-   Add TLS support to the metrics endpoint through either a certificate file or through dynamically issued certificates ([#&#8203;6574](cert-manager/cert-manager#6574), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Helm Chart: allow changing the default Deployment `revisionHistoryLimit` ([#&#8203;6248](cert-manager/cert-manager#6248), [@&#8203;tberreis](https://github.com/tberreis))
-   Security: Limit the size of the response body read from HTTP requests by cert-manager. ([#&#8203;6619](cert-manager/cert-manager#6619), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Support custom `spec.namespaceSelector` for webhooks ([#&#8203;6638](cert-manager/cert-manager#6638), [@&#8203;jkroepke](https://github.com/jkroepke))

##### Bug or Regression

-   BUGFIX\[helm]: Fix issue where webhook feature gates were only set if controller feature gates are set. ([#&#8203;6380](cert-manager/cert-manager#6380), [@&#8203;asapekia](https://github.com/asapekia))
-   Controller ConfigMap is now created only if `.Values.config` is set. ([#&#8203;6357](cert-manager/cert-manager#6357), [@&#8203;ABWassim](https://github.com/ABWassim))
-   Fix runaway bug caused by multiple Certificate resources that point to the same Secret resource. ([#&#8203;6406](cert-manager/cert-manager#6406), [@&#8203;inteon](https://github.com/inteon))
-   Fix(helm): templating of required value in controller and webhook ConfigMap resources ([#&#8203;6435](cert-manager/cert-manager#6435), [@&#8203;ABWassim](https://github.com/ABWassim))
-   Fixed a webhook validation error message when the key algorithm was invalid. ([#&#8203;6571](cert-manager/cert-manager#6571), [@&#8203;pevidex](https://github.com/pevidex))
-   Fixed error messaging when setting up vault issuer ([#&#8203;6433](cert-manager/cert-manager#6433), [@&#8203;vinny](https://github.com/vinny-sabatini))
-   `GHSA-vgf6-pvf4-34rq`: The webhook server now returns HTTP error 413 (Content Too Large) for requests with body size `>= 3MiB`. This is to mitigate DoS attacks that attempt to crash the webhook process by sending large requests that exceed the available memory.
    The webhook server now returns HTTP error 400 (Bad Request) if the request contains an empty body.
    The webhook server now returns HTTP error 500 (Internal Server Error) rather than crashing, if the code panics while handling a request. ([#&#8203;6498](cert-manager/cert-manager#6498), [@&#8203;inteon](https://github.com/inteon))
-   Increase the default webhook timeout to its maximum value of 30 seconds, so that the underlying timeout error message has more chance of being returned to the end user. ([#&#8203;6488](cert-manager/cert-manager#6488), [@&#8203;wallrj](https://github.com/wallrj))
-   Listeners that do not support TLS on Gateway resources will now not raise `BadConfig` warnings anymore ([#&#8203;6347](cert-manager/cert-manager#6347), [@&#8203;lauraseidler](https://github.com/lauraseidler))
-   Mitigate potential Slowloris attacks by setting `ReadHeaderTimeout` in all `http.Server` instances ([#&#8203;6534](cert-manager/cert-manager#6534), [@&#8203;wallrj](https://github.com/wallrj))
-   The Venafi issuer now properly resets the certificate and should no longer get stuck with `WebSDK CertRequest Module Requested Certificate` or `This certificate cannot be processed while it is in an error state. Fix any errors, and then click Retry.`. ([#&#8203;6398](cert-manager/cert-manager#6398), [@&#8203;maelvls](https://github.com/maelvls))
-   Update experimental install and uninstall commands to have flag parity with the rest of the CLI ([#&#8203;6562](cert-manager/cert-manager#6562), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Webhook ConfigMap if now created only if `.Values.webhook.config` is set. ([#&#8203;6360](cert-manager/cert-manager#6360), [@&#8203;ABWassim](https://github.com/ABWassim))
-   BUGFIX: Ensure `otherName` SAN changes in Certificate resources trigger re-issuance. ([#&#8203;6620](cert-manager/cert-manager#6620), [@&#8203;SpectralHiss](https://github.com/SpectralHiss))
-   Bugfix: Publish the `startupapicheck` image to `quay.io` ([#&#8203;6609](cert-manager/cert-manager#6609), [@&#8203;wallrj](https://github.com/wallrj))

##### Other (Cleanup or Flake)

-   Cert-manager is now built with Go 1.21.5 ([#&#8203;6545](cert-manager/cert-manager#6545), [@&#8203;wallrj](https://github.com/wallrj))
-   Bump Go to `1.21.3` to address `CVE-2023-39325`. Also bumps base images. ([#&#8203;6410](cert-manager/cert-manager#6410), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Bump `golang.org/x/net v0.15.0 => v0.17.0` as part of addressing `CVE-2023-44487` / `CVE-2023-39325` ([#&#8203;6427](cert-manager/cert-manager#6427), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Check code for unintended use of `crypto/md5`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G501). ([#&#8203;6581](cert-manager/cert-manager#6581), [@&#8203;wallrj](https://github.com/wallrj))
-   Check code for unintended use of `crypto/sha1`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G505). ([#&#8203;6579](cert-manager/cert-manager#6579), [@&#8203;wallrj](https://github.com/wallrj))
-   Check code for unintended use of weak random number generator (`math/rand` instead of `crypto/rand`); using `golangci-lint` / `gosec` (G404). ([#&#8203;6582](cert-manager/cert-manager#6582), [@&#8203;wallrj](https://github.com/wallrj))
-   Cleanup: Restrict MutatingWebhookConfiguration to only CertificateRequest resources ([#&#8203;6311](cert-manager/cert-manager#6311), [@&#8203;hawksight](https://github.com/hawksight))
-   Deprecated `pkg/util.RandStringRunes` and `pkg/controller/test.RandStringBytes`. Use `k8s.io/apimachinery/pkg/util/rand.String` instead. ([#&#8203;6585](cert-manager/cert-manager#6585), [@&#8203;wallrj](https://github.com/wallrj))
-   Enabled verbose logging in startupapicheck by default, so that if it fails, users can know exactly what caused the failure. ([#&#8203;6495](cert-manager/cert-manager#6495), [@&#8203;wallrj](https://github.com/wallrj))
-   Fix gosec G601: Implicit memory aliasing of items from a range statement ([#&#8203;6551](cert-manager/cert-manager#6551), [@&#8203;wallrj](https://github.com/wallrj))
-   Fix handling of serial numbers in literal certificate subjects. Previously a serial number could be specified in `subject.serialNumber` while using a literal certificate subject. This was a mistake and has been fixed. ([#&#8203;6533](cert-manager/cert-manager#6533), [@&#8203;inteon](https://github.com/inteon))
-   The end-to-end tests can now test the cert-manager Vault Issuer on an OpenShift cluster. ([#&#8203;6391](cert-manager/cert-manager#6391), [@&#8203;wallrj](https://github.com/wallrj))
-   Update cert-manager's distroless base images from Debian 11 to Debian 12. This should have no practical effects on users. ([#&#8203;6583](cert-manager/cert-manager#6583), [@&#8203;inteon](https://github.com/inteon))
-   Updated all code using GatewayAPI to use the now GA v1 APIs ([#&#8203;6559](cert-manager/cert-manager#6559), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Upgrade Go from 1.20.7 to 1.20.8. ([#&#8203;6369](cert-manager/cert-manager#6369), [@&#8203;inteon](https://github.com/inteon))
-   Upgrade `github.com/emicklei/go-restful/v3` to `v3.11.0` because `v3.10.2` is labeled as "DO NOT USE". ([#&#8203;6366](cert-manager/cert-manager#6366), [@&#8203;inteon](https://github.com/inteon))
-   Use the new generic `sets.Set` type in place of the deprecated `sets.String`. ([#&#8203;6586](cert-manager/cert-manager#6586), [@&#8203;wallrj](https://github.com/wallrj))
-   cert-manager is now built with Go `v1.21.6` ([#&#8203;6628](cert-manager/cert-manager#6628), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Update the Azure SDK and remove deprecated `autorest` dependency ([#&#8203;5452](cert-manager/cert-manager#5452), [@&#8203;phillebaba](https://github.com/phillebaba))
-   The cert-manager E2E tests can now be run on Kubernetes 1.29 ([#&#8203;6641](cert-manager/cert-manager#6641), [@&#8203;wallrj](https://github.com/wallrj))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE2NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: https://git.home/nrdufour/home-ops/pulls/358
Co-authored-by: Renovate <renovate@ptinem.io>
Co-committed-by: Renovate <renovate@ptinem.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.14: cmctl panics on install
4 participants