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

Update semver to v3.2.1 #282

Closed
blentz opened this issue May 19, 2023 · 1 comment
Closed

Update semver to v3.2.1 #282

blentz opened this issue May 19, 2023 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@blentz
Copy link

blentz commented May 19, 2023

The Masterminds/semver being used is very old (v1.5.0). The latest is v3.2.1. Due to the old dependency, the provider does not support setting version ranges, as documented in the ArgoCD docs.

Please update this dependency.

Terraform Version, ArgoCD Provider Version and ArgoCD Version

Terraform v1.4.6 on darwin_arm64
ArgCD v2.7.2
ArgoCD Provider v5.3.0

Affected Resource(s)

  • argocd_application

Terraform Configuration Files

resource "argocd_application" "myapp" {
  metadata {
    name      = local.app_name
    namespace = "argocd"
    labels = {
      environment = local.app_environment
    }
  }

  cascade = true

  spec {
    revision_history_limit = 3

    destination {
      server    = "https://kubernetes.default.svc"
      namespace = local.app_namespace
    }

    source {
      repo_url        = argocd_repository.helm-charts.repo
      chart           = local.app_name
      target_revision = local.chart_revision # we'd like to always use latest chart by setting this to ">0.0.0",
      helm {
        release_name = local.app_environment
      }
  }
}

Error Output

Setting target_revision to any valid range (>2.0,<3.0) or glob pattern (v2.0.* or *) results in an error:

2023-05-19T12:11:20.083-0400 [ERROR] provider.terraform-provider-argocd_v5.3.0: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/internal/diag/diagnostics.go:55 @module=sdk.proto diagnostic_severity=ERROR tf_resource_type=argocd_application tf_rpc=ApplyResourceChange diagnostic_detail="rpc error: code = InvalidArgument desc = application spec for myapp is invalid: InvalidSpecError: Unable to generate manifests in .: rpc error: code = Unknown desc = unable to get tags: failed to get tags: unable to decode json: invalid character '<' looking for beginning of value" diagnostic_summary="application myapp could not be updated" tf_proto_version=5.3 tf_provider_addr=registry.terraform.io/oboukili/argocd tf_req_id=ed7d257e-1751-7bcc-1ba4-d235f67acada timestamp=2023-05-19T12:11:20.082-0400
2023-05-19T12:11:20.086-0400 [ERROR] vertex "argocd_application.myapp" error: application myapp could not be updated
╷
│ Error: application myapp could not be updated
│ 
│   with argocd_application.myapp,
│   on k8s-powerai.tf line 15, in resource "argocd_application" "myapp":
│   15: resource "argocd_application" "myapp" {
│ 
│ rpc error: code = InvalidArgument desc = application spec for myapp is invalid: InvalidSpecError: Unable to generate manifests in .: rpc error: code = Unknown desc = unable to get tags: failed to get tags: unable to
│ decode json: invalid character '<' looking for beginning of value

Steps to Reproduce

  1. create an argocd_application
  2. set the target_revision to any supported range or glob pattern
  3. terraform apply --> ERROR

Expected Behavior

The provider should not produce an error when using valid helm version ranges or globs.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@blentz blentz added the bug Something isn't working label May 19, 2023
blentz added a commit to blentz/terraform-provider-argocd that referenced this issue May 19, 2023
blentz added a commit to blentz/terraform-provider-argocd that referenced this issue May 19, 2023
blentz added a commit to blentz/terraform-provider-argocd that referenced this issue May 19, 2023
blentz added a commit to blentz/terraform-provider-argocd that referenced this issue May 19, 2023
@onematchfox
Copy link
Collaborator

Hi @blentz,

I'm afraid I don't think this is an issue with the provider since we aren't doing any form of validation on target_revision. As indicated by the fact that this is an rpc error, the error is coming from ArgoCD itself. (FWIW, I also confirmed this by running the tests you added to the PR you opened).

I did find this issue in the ArgoCD repo which looks remarkably similar. Are you using an OCI repository? If so, then you'll need to wait for that fix to be released.

@onematchfox onematchfox added the invalid This doesn't seem right label May 20, 2023
@blentz blentz closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants