jtopjian / terraform-provider-sensu

A Terraform provider for Sensu Go
21 stars 11 forks source link

support apikey resource #48

Closed fgouteroux closed 3 years ago

fgouteroux commented 3 years ago

Hi @jtopjian

Adding support of apikey management.

However I have a question: does I need to open a PR to https://github.com/sensu/sensu-go to update the apikey client file, or the update of vendor file is enough (vendor/github.com/sensu/sensu-go/cli/client/apikey.go)

Also CI is failing, when updating the username of apikey, I cannot reproduce it in my environment. Do you have some idea ?

jtopjian commented 3 years ago

@fgouteroux Thanks!

If the vendor / client library needs modified then yeah, it'll need to be done in a PR for that repo.

The vendor/ directory is an exact clone of the upstream libraries. It's just bundled into the repo for ease of "pinning".

jtopjian commented 3 years ago

@fgouteroux Here's the documentation about vendoring with Go modules: https://golang.org/ref/mod#vendoring

Let me know if you have any questions about it. Vendoring isn't absolutely required, but it was used in some other projects I used to help with, so I carried the pattern over.

fgouteroux commented 3 years ago

Thanks for the explanation. In the meanwhile I have open the PR https://github.com/sensu/sensu-go/pull/4336 I'm not sure if sensu will accept it and when. Concerning the ci test failing I tried with sensu 6 and the test is passing. I don't Know why maybe the sensu version as in ci this is the version 5.21 but i'm not sure

jtopjian commented 3 years ago

@fgouteroux Sounds good. I'll poke around with the CI tests and see if I can figure it out. 🙂

fgouteroux commented 3 years ago

@jtopjian good news, sensu have accepted and merged the PR https://github.com/sensu/sensu-go/pull/4336. So I've updated the go.mod file and I got the error

github.com/jtopjian/terraform-provider-sensu imports
    github.com/hashicorp/terraform-plugin-sdk/plugin imports
    github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery imports
    github.com/hashicorp/go-getter imports
    cloud.google.com/go/storage imports
    google.golang.org/api/option imports
    google.golang.org/api/internal imports
    google.golang.org/grpc/naming: module google.golang.org/grpc@latest found (v1.39.0), but does not contain package google.golang.org/grpc/naming

As explained here https://github.com/etcd-io/etcd/issues/12124, I add a replace statement to fix the error. Let me know if it's ok.

jtopjian commented 3 years ago

@fgouteroux I'm very sorry for the late reply. I think the replace statement is fine.

This PR looks good to me. Let me know if you wanted to do any additional work or if it's good to merge.

fgouteroux commented 3 years ago

@jtopjian no worries, it's ok for the merge