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

Add support for maintenance window on google_container_cluster #670

Conversation

michaelbannister
Copy link
Contributor

@michaelbannister michaelbannister commented Nov 2, 2017

Fixes #526

This is my first venture into both the Go language and the internals of Terraform. Please be forthcoming with feedback but don't be too harsh if I've done something dumb! ;)

I have run my own standalone test creating a cluster with a maintenance window set, but I haven't yet run the acceptance tests, because the readme says it costs money but gives no indication of how much money that might be!

@michaelbannister michaelbannister changed the title Add support for maintenance window on google_container_cluster (#526) Add support for maintenance window on google_container_cluster Nov 2, 2017
@michaelbannister
Copy link
Contributor Author

michaelbannister commented Nov 3, 2017

@danawillow I can merge master to my branch to resolve conflicts - or would you prefer I rebase it? (I'm aware of the dangers of doing this if someone has already cloned it.)

@danawillow
Copy link
Contributor

I'm fine with either!

@michaelbannister
Copy link
Contributor Author

Great - I'll do it this evening (UK time)

@michaelbannister michaelbannister force-pushed the container-cluster-maintenance-window branch from 2d81bde to 6bc7cc8 Compare November 7, 2017 21:43
@michaelbannister michaelbannister force-pushed the container-cluster-maintenance-window branch from 6bc7cc8 to 25bb227 Compare November 7, 2017 21:45
@michaelbannister
Copy link
Contributor Author

@danawillow I've rebased and look forward to any feedback you or others may have.

@danawillow danawillow self-requested a review November 7, 2017 21:48
@danawillow danawillow self-assigned this Nov 7, 2017
Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, @michaelbannister! Just a few super-quick changes and then this will be good to go.

After making the test change I noted:

$ make testacc TEST=./google TESTARGS='-run=TestAccContainerCluster_withMaintenanceWindow'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccContainerCluster_withMaintenanceWindow -timeout 120m
=== RUN   TestAccContainerCluster_withMaintenanceWindow
--- PASS: TestAccContainerCluster_withMaintenanceWindow (357.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	357.679s

Schema: map[string]*schema.Schema{
"daily_maintenance_window": {
Type: schema.TypeList,
Required: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the sake of future-proofing, let's go ahead and ForceNew: true this one too

Config: testAccContainerCluster_withMaintenanceWindow("03:00"),
Check: resource.ComposeTestCheckFunc(
testAccCheckContainerCluster(
"google_container_cluster.primary"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be "google_container_cluster.with_maintenance_window" to match the resource name in the test config

@@ -243,6 +260,10 @@ exported:
* `instance_group_urls` - List of instance group URLs which have been assigned
to the cluster.

* `maintenance_policy.daily_maintenance_window.duration` - Duration of the time window, automatically chosen to be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nested fields are fun! This is actually maintenance_policy.0.daily_maintenance_window.0.duration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes - I see this was recently updated for the master_auth stuff (this explains why it didn't work when I tried to use those attributes without the 0 index recently!)

- Set ForceNew: true on the schema element daily_maintenance_window
- Correct resource name in acceptance test
- Correct documentation of resource attribute maintenance_policy.0.daily_maintenance_window.0.duration
@michaelbannister
Copy link
Contributor Author

Thanks, Dana!

@danawillow
Copy link
Contributor

You're welcome, thanks for the quick turnaround!

@danawillow danawillow merged commit 12060f9 into hashicorp:master Nov 7, 2017
@pdecat
Copy link
Contributor

pdecat commented Nov 10, 2017

Hi, thanks for that!

Just came across an issue though:

      maintenance_policy.#:                                       "1" => "1"                 
      maintenance_policy.0.daily_maintenance_window.#:            "1" => "1"                                                                                                              
      maintenance_policy.0.daily_maintenance_window.0.duration:   "PT4H0M0S" => <computed>                                                                                                
      maintenance_policy.0.daily_maintenance_window.0.start_time: "6:00" => "06:00" (forces new resource)                                                                                 

Will open an issue.

@michaelbannister michaelbannister deleted the container-cluster-maintenance-window branch November 11, 2017 10:18
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
…corp#670)

* Add support for maintenance window on google_container_cluster (hashicorp#526)

* Address review comments

- Set ForceNew: true on the schema element daily_maintenance_window
- Correct resource name in acceptance test
- Correct documentation of resource attribute maintenance_policy.0.daily_maintenance_window.0.duration
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for maintenance windows on google_container_cluster
3 participants