datadrivers/terraform-provider-nexus

apt hosted signing info not handled by data source

scop opened this issue ยท 1 comments

scop commented

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.6.5

Nexus Provider Version

1.22.0

Nexus Version

3.61.0

Affected Resource(s)/Data Source(s)

repository_apt_hosted

Terraform Configuration Files

resource "nexus_repository_apt_hosted" "my_repo" {
  name         = "my-repo"
  distribution = "my"
  signing {
    keypair    = var.apt_signing.key
    passphrase = var.apt_signing.passphrase
  }
  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
    write_policy                   = "ALLOW_ONCE"
  }
}

Debug Output/Panic Output

# nexus_repository_apt_hosted.my_repo will be updated in-place
  ~ resource "nexus_repository_apt_hosted" "my_repo" {
        id           = "my-repo"
        name         = "my-repo"
        # (2 unchanged attributes hidden)

      + signing {
          + keypair    = (sensitive value)
          + passphrase = (sensitive value)
        }

        # (2 unchanged blocks hidden)
    }

Expected Behaviour

It seems as if the signing block would be added (not modified), even though it is present in the config. The variables are set to the same values as they are in Nexus.

Looking into the apt hosted data source code, it appears the data source does not handle aptSigning data from Nexus at all. The related data source test has signing data populated in its fixture, but it's not tested.

Actual Behaviour

Signing block not marked for creation/modification.

Steps to Reproduce

terraform plan

References

No response

This was fixed in v2.0.0.

Notice the provider now ignores the missing values, since nexus never returns the keypair and passphrase via the api.