-
Notifications
You must be signed in to change notification settings - Fork 90
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: Add DiffSuppressFunc on argocd_cluster.server #353
fix: Add DiffSuppressFunc on argocd_cluster.server #353
Conversation
Thanks for opening this up. That test is notoriously flaky and has been a bother for quite some time. There is, however, already some handling for this case here. That said, this approach may be the better option. Unfortunately, I don't really have the bandwidth to give it the consideration it requires at this point. So, I hope you don't mind this PR languishing for a little while until I can do so. Have merged your other PR and will ensure that that fix is released ASAP. |
What I tested is this here manually with the provider version 6.0.3: $ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# argocd_cluster.cluster_with_trailing_slash will be created
+ resource "argocd_cluster" "cluster_with_trailing_slash" {
+ id = (known after apply)
+ info = (known after apply)
+ name = "server"
+ server = "https://kubernetes.default.svc.cluster.local/"
+ config {
+ bearer_token = (sensitive value)
+ tls_client_config {
+ ca_data = <<-EOT
-----BEGIN CERTIFICATE-----
REDACTED
-----END CERTIFICATE-----
EOT
+ insecure = false
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
argocd_cluster.cluster_with_trailing_slash: Creating...
argocd_cluster.cluster_with_trailing_slash: Creation complete after 2s [id=https://kubernetes.default.svc.cluster.local/server]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. and plan again: $ terraform apply
argocd_cluster.cluster_with_trailing_slash: Refreshing state... [id=https://kubernetes.default.svc.cluster.local/server]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# argocd_cluster.cluster_with_trailing_slash will be updated in-place
~ resource "argocd_cluster" "cluster_with_trailing_slash" {
id = "https://kubernetes.default.svc.cluster.local/server"
name = "server"
~ server = "https://kubernetes.default.svc.cluster.local" -> "https://kubernetes.default.svc.cluster.local/"
# (2 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: Since the remove of trailing |
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
not stale. ping @onematchfox |
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Not stale... Been away. Hoping to get around to this soon. |
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
not stale |
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.
Sorry for the delay in getting to this. Such a small change. I hate that we need to do this but I do think it will do the job until such time as we look at migrating this resource to the plugin framework where we can look at custom types (e.g. URL) which provide a mechanism for checking semantic equality.
…urce (#357) * feat(argocd_applicationset): add ignore_application_differences attribute * feat(argocd_applicationset): remove unnecessary if condition * doc(argocd_applicationset): fix documentation application_set * chores(argocd): add ArgoCD 2.9.3 to matrix test * build(deps): Bump github.com/go-git/go-git/v5 from 5.7.0 to 5.11.0 (#361) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.7.0 to 5.11.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](go-git/go-git@v5.7.0...v5.11.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump github.com/argoproj/argo-cd/v2 from 2.8.3 to 2.8.8 (#365) Bumps [github.com/argoproj/argo-cd/v2](https://github.com/argoproj/argo-cd) from 2.8.3 to 2.8.8. - [Release notes](https://github.com/argoproj/argo-cd/releases) - [Changelog](https://github.com/argoproj/argo-cd/blob/master/CHANGELOG.md) - [Commits](argoproj/argo-cd@v2.8.3...v2.8.8) --- updated-dependencies: - dependency-name: github.com/argoproj/argo-cd/v2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Add DiffSuppressFunc on argocd_cluster.server (#353) * build(deps): Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#358) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0. - [Commits](golang/crypto@v0.14.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 (#364) Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7. - [Release notes](https://github.com/cloudflare/circl/releases) - [Commits](cloudflare/circl@v1.3.3...v1.3.7) --- updated-dependencies: - dependency-name: github.com/cloudflare/circl dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump test versions of ArgoCD to latest patch versions * build(deps-dev): bump test versions of k8s * build(deps): bump github.com/argoproj/argo-cd/v2 from 2.9.3 to 2.9.9 * build(deps): bump k8s modules to align with argocd version * fix: call cluster list endpoint with trimmed server * fix: add diff suppression for empty sync policy on application --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Maurer (-Kilchhofer) <[email protected]> Co-authored-by: Brian Fox <[email protected]>
While working on this PR here:
spec.info
if list is empty #349, I saw that the build is already broken on
master
branch:It seems that the test is failing due to inconsistent handling of a trailing
/
.I am not familiar with the provider internals here but it seems that putting a diff-ignore function could help here. It is already present on the cluster create function:
https://github.com/oboukili/terraform-provider-argocd/blob/b42b92267a212b108537caf32a462c133f21813d/argocd/resource_argocd_cluster.go#L55
FYI @onematchfox