-
Notifications
You must be signed in to change notification settings - Fork 95
fix: do not null fields if Argo CD API doesn't return fields #701
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
fix: do not null fields if Argo CD API doesn't return fields #701
Conversation
Potentially fixes argoproj-labs#697. Signed-off-by: Blake Pettersson <[email protected]>
c36ab5a
to
b10f2dd
Compare
Signed-off-by: Blake Pettersson <[email protected]>
Just do the conversions directly without any checks Signed-off-by: Blake Pettersson <[email protected]>
5eec0de
to
6840140
Compare
For some reason this always suffixes a newline. If I add a newline, then it adds yet another newline, etc etc. Signed-off-by: Blake Pettersson <[email protected]>
result.Name = data.Name | ||
result.Username = data.Username | ||
result.GitHubAppID = data.GitHubAppID | ||
result.GitHubAppInstallationID = data.GitHubAppInstallationID | ||
result.GitHubAppEnterpriseBaseURL = data.GitHubAppEnterpriseBaseURL | ||
result.TLSClientCertData = data.TLSClientCertData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking... Are all of these treated as sensitive by ArgoCD? Surely the ArgoCD API at least returns Name
? I would also think it potentially returns Username
, GitHubAppEnterpriseBaseURL
and TLSClientCertData
.
To stay more true to the former implementation (pre terraform-plugin-framework) we should just load the state, and make any prerequisite modifications from the API if necessary. This also resolves the issues coming from the tf-plugin-framework migration. Signed-off-by: Blake Pettersson <[email protected]>
979827c
to
82d9c3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @blakepettersson!
Similar to what has been done in argoproj-labs#701, add consistency tests to verify that there won't be any inconsistent state after doing a few applies. Signed-off-by: Blake Pettersson <[email protected]>
Potentially fixes #697.