nikhilsbhat / terraform-provider-gocd

Terraform provider for GoCD, which helps in performing certain operations on GoCD
https://registry.terraform.io/providers/nikhilsbhat/gocd/latest
MIT License
4 stars 1 forks source link

Minor provider field changes #1

Closed Rwwn closed 1 year ago

Rwwn commented 1 year ago

First off I'd like to thank you for creating this provider. The fact it lets me manage elastic agent configurations is invaluable. I've yet to see any other config as code tool allow that in GoCD. Please keep it up.

I've got three changes I'd like to suggest here:

  1. A small fix to the log level defaults which was using the password field's default by mistake.
  2. Changing the default for ca_file to nil and making it optional. If I'm not mistaken, the current default was inadvertently causing this if statement to evaluate to true, so the client would try to use the "some_ca_context" default value as a certificate, causing it to fail. I believe the desired behaviour is for it to evaluate to false, and skip strict TLS checking. This fixes the errorx509: certificate signed by unknown authority I'm seeing when trying to use the provider without a ca_cert field.
  3. Changing the propertiesSchemaResource so that changes to the settings of cluster profiles and elastic agent profiles doesn't force a rebuild of the profiles. There's no reason these can't be updated in place, and replacing them each time is a problem since they can't be deleted if they're associated with a pipeline.

I haven't tested these changes as I'm not sure on how I'd do that exactly. I've tested this by using a local version of the provider with my changes, and it's all working, at least with my configuration.

This is my first time contributing to a Terraform provider. I'm happy to take any suggestions if you have them.

nikhilsbhat commented 1 year ago

@Rwwn good to know that this provider is helpful for you.

The changes looks good too. I will test it once and merge it ASAP.

nikhilsbhat commented 1 year ago

Thank you for this contribution @Rwwn

Rwwn commented 1 year ago

Thanks for merging it @nikhilsbhat. Will it be included in a release soon so I can start using it?

nikhilsbhat commented 1 year ago

yes @Rwwn, I'm working on it. Fixing few more feedback that I received.