-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop relying on lastAppliedConfig annotation fix #94
Currently, the provider relies on the lastAppliedConfig annotation. The read method reads the annotation and stores its value as the manifest in the Terraform state. This means, Terraform only detects drift for Kubernetes resources managed by the Kustomization provider, if there is a diff between what's in the lastAppliedConfig annotation and what's in the Terraform files. Not all `kubectl` commands however update the annotation, e.g. scale doesn't, so such drift is never corrected, even if replicas was specified in the Terraform files. Additionally, there are a number of issues (e.g. #136) that although I have a hard time reproducing them reliably, I strongly suspect to be a result of the current implementation here too. This change, stop relying on the annotation and instead uses similar but reverse patching logic to the diff and upate method to determine which attributes of the configuration in the Terraform files / from YAML are different on the API server. This is then stored in the state. And now drift is determined between the values of all attributes set in TF/YAML and what the API last returned for them.
- Loading branch information
Showing
7 changed files
with
67 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters