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

Error updating status of newly created SealedSecrets resources #1354

Closed
tewfik-ghariani opened this issue Oct 27, 2023 · 6 comments · Fixed by #1360 or #1370
Closed

Error updating status of newly created SealedSecrets resources #1354

tewfik-ghariani opened this issue Oct 27, 2023 · 6 comments · Fixed by #1360 or #1370
Labels
backlog Issues/PRs that will be included in the project roadmap bug

Comments

@tewfik-ghariani
Copy link
Contributor

tewfik-ghariani commented Oct 27, 2023

Which component:
controller v0.24.2

Describe the bug

Hi, we have recently noticed that the operator complains about updating the status of newly created SealedSecrets resources, even though the unsealing operation is successful:

Event(v1.ObjectReference{Kind:"SealedSecret", Namespace:"playground-dev", 
Name:"mock-secret", UID:"d07fdf8e-2ef7-4916-b2e0-0e10a7985a77", 
APIVersion:"bitnami.com/v1alpha1", ResourceVersion:"1869049268", FieldPath:""}): 
type: 'Normal' reason: 'Unsealed' SealedSecret unsealed successfully
Error updating SealedSecret playground-dev/mock-secret status:
SealedSecret.bitnami.com "mock-secret" is invalid:
status.conditions[0].lastTransitionTime: Invalid value: "null": 
status.conditions[0].lastTransitionTime in body must be of type string: "null"

As a result, the corresponding secret resource is created but the SealedSecret resource doesn't have any status entry and the SYNCED field is not set to true

 $ k get sealedsecrets.bitnami.com mock-secret
NAME          STATUS   SYNCED   AGE
mock-secret                     2m24s
 $ k -o yaml get sealedsecrets.bitnami.com mock-secret | yq 'keys'
- apiVersion
- kind
- metadata
- spec

To Reproduce
Steps to reproduce the behavior:

  1. Generate any random secret
kubectl create secret generic mock-secret --dry-run=client --from-literal=foo=bar -o yaml > mock.secret.yml
  1. Seal it via kubeseal
kubeseal --cert https://internal.operator.com/v1/cert.pem --scope strict --format yaml < mock.secret.yml > sealed.mock.secret.yml
  1. Apply it to k8s
kubectl apply -f sealed.mock.secret.yml
  1. Look for the status field in the SealedSecret resource
kubectl -o yaml get sealedsecrets.bitnami.com mock-secret | yq 'keys'
  1. See error in the logs of the sealed-secrets operator pod
kubectl logs sealed-secrets-controller-639n770jd6-s52lm

Expected behavior
It is expected that the status field is shown as in v0.24.0 and no warnings are emitted in the logs

 $ k get sealedsecrets.bitnami.com
NAME             STATUS   SYNCED   AGE
another-secret            True     4s
 $ k -o yaml get sealedsecrets.bitnami.com another-secret | tail -n7
status:
  conditions:
  - lastTransitionTime: "2023-10-27T18:17:32Z"
    lastUpdateTime: "2023-10-27T18:17:32Z"
    status: "True"
    type: Synced
  observedGeneration: 1

Version of Kubernetes:

Client Version: v1.28.3
Server Version: v1.26.9

Additional context
I confirm that this bug did not exist in v0.24.0 after testing it, and I have doubts that it might be due to this change: #1295 that was introduced in v0.24.2 as per the release notes

@tewfik-ghariani tewfik-ghariani added the triage Issues/PRs that need to be reviewed label Oct 27, 2023
@fculpo
Copy link

fculpo commented Oct 30, 2023

Hi,

Same here, recent sealedsecrets get stuck in fluxcd reconciliation InProgress in 0.24.2
0.24.0 unlocks reconciliation immediately

@alvneiayu
Copy link
Collaborator

hi everyone, we are investigating this bug. We will come back as soon as possible with fix/information about it.

Sorry for the inconveniences

Álvaro

@agarcia-oss agarcia-oss added bug backlog Issues/PRs that will be included in the project roadmap and removed triage Issues/PRs that need to be reviewed labels Oct 31, 2023
@seb-metacommerce
Copy link

hi everyone, we are investigating this bug. We will come back as soon as possible with fix/information about it.

Sorry for the inconveniences

Álvaro

Hi Alvaro,

Check out #1355, I explained what is happening and what I think is missing for everything to work :)

Regards,

Sebastien

@tewfik-ghariani
Copy link
Contributor Author

Unfortunately, I am still observing the same behavior :(

controller version: 0.24.3
2023/11/08 08:54:33 Starting sealed-secrets controller version: 0.24.3
Error updating SealedSecret namespace/mock-secret status: 
SealedSecret.bitnami.com "rnamespace/mock-secret" is invalid: 
status.conditions[0].lastTransitionTime: Invalid value: "null": 
status.conditions[0].lastTransitionTime in body must be of type string: "null"
NAME                                    STATUS   SYNCED   AGE
mock-secret                                              4h14m

@alvneiayu
Copy link
Collaborator

hi @tewfik-ghariani, let me check it. Thanks for notifying it

@tewfik-ghariani
Copy link
Contributor Author

It is fixed with v0.24.4 release, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues/PRs that will be included in the project roadmap bug
Projects
None yet
5 participants