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

Observed Generation Not Set to -1, Causing Incorrect Readiness Status #825

Closed
3 tasks
chanwit opened this issue Aug 1, 2023 · 1 comment · Fixed by #867
Closed
3 tasks

Observed Generation Not Set to -1, Causing Incorrect Readiness Status #825

chanwit opened this issue Aug 1, 2023 · 1 comment · Fixed by #867
Assignees
Labels

Comments

@chanwit
Copy link
Collaborator

chanwit commented Aug 1, 2023

The observed generation is not set to -1 in the Terraform object's status, causing Kubernetes kstatus to consider it ready even when it is still applying.

When a Terraform resource is created, its status does not have the observed generation set to -1. This results in Kubernetes kstatus considering the Terraform resource as ready, even though it is still in the process of applying changes.

  1. Code reference in GitRepository types: https://github.com/fluxcd/source-controller/blob/main/api/v1/gitrepository_types.go#L270
  2. Code reference in Terraform types: https://github.com/weaveworks/tf-controller/blob/main/api/v1alpha2/terraform_types.go#L402
  3. Example usage in Kustomization Controller: https://github.com/fluxcd/kustomize-controller/blob/main/internal/controller/kustomization_controller.go#L172

Acceptance Criteria

  • Upon creation of a Terraform resource, the observedGeneration should be initialized to -1.
  • Once the Terraform resource has successfully applied changes, kstatus should recognize it as ready.
  • LastHandledReconcileAt should contain a proper timestamp value.
@lasomethingsomething
Copy link
Contributor

lasomethingsomething commented Aug 10, 2023

Proposed ACs:

  • The observed generation status of a Terraform resource is set to -1 upon resource creation.
  • The Flux runtime package applies an observedGeneration on each condition each time it observes that condition for that generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants