Commit Graph

97 Commits

Author SHA1 Message Date
Riley Karson
4a0ee14304
Duplicate what tpgb does for master_ipv4_cidr_block (#2661)
Looks like we missed a couple lines while cherrypicking; copied these from tpgb.
2018-12-13 10:56:59 -08:00
The Magician
a138701b75 Fix for permadiff in container cluster caused by beta resource. (#2488) 2018-12-12 17:23:35 -08:00
The Magician
a5f1e6002c Container cluster changes ancillary to beta support for autoprovisioning. (#2415) 2018-12-12 17:23:35 -08:00
The Magician
b08884f49e regional and private clusters are in GA now (#2364)
<!-- This change is generated by MagicModules. -->
/cc @danawillow

Fixes #2286
2018-12-12 17:23:35 -08:00
The Magician
b7801660c9 add retries on create for container cluster (#2352)
<!-- This change is generated by MagicModules. -->
/cc @danawillow
2018-12-12 17:23:35 -08:00
The Magician
4a4a33da8a Output from magician generating into ga and beta providers (#2271)
<!-- This change is generated by MagicModules. -->
/cc @danawillow
2018-12-12 17:23:35 -08:00
Riley Karson
5512f8a961 Guard against nil empty typelists. 2018-10-11 09:48:19 -07:00
Paddy Carver
9a3dd8db6e Fix provider_versions.html link. 2018-10-03 18:46:20 -07:00
Riley Karson
ee67a87a65 Change deprecation message. 2018-10-03 12:58:52 -07:00
Riley Karson
a8747b4909 Deprecate handwritten beta fields. 2018-10-02 14:44:09 -07:00
Alex Barron
70faf686b5 Add "enable_tpu" flag to google_container_cluster (#1974)
* add enable_tpu flag

* missed one

* add docs

* fix test

* tabs

* update tests to new format

* formatting

* formatting
2018-10-01 09:41:54 -07:00
Dana Hoffman
9960e2fa62
Simplify GKE cluster code (#2105)
We don't need quite so many `GetOk`s since the client library will ignore any fields that are set to the zero value for that type. I left a few that involved error-handling or things that had to be set before other things, but this at least should make the code a bit nicer to look at.

Tests are passing except the ones that were already failing in CI.
2018-09-25 11:42:37 -07:00
Nathan McKinley
9065b5a624 Addition of create_subnetwork and other fields relevant for Alias IPs (#1921)
* Addition of create_subnetwork and use_ip_aliases.

* add fields for [cluster|services]_ipv4_cidr_block and subnetwork_name
2018-09-05 09:52:06 -07:00
Dana Hoffman
d90e7fb4f6
fix panic on gke binauth (#1924) 2018-08-22 12:47:43 -07:00
David Asabina
bf7626a5c6 Fix panic on empty list for authorized masters' cidr_blocks (#1904)
* test empty authorized masters' cidr_blocks

When the `cidr_block` isn't simply blank but contains an empty list as in

```
master_authorized_networks_config {
  cidr_blocks = []
}
```

a panic occurs looking something like

```
goroutine 26 [running]:
github.com/terraform-providers/terraform-provider-google/google.expandMasterAuthorizedNetworksConfig(0x15a4f80, 0xc4202586e0, 0x21)
	/tmp/GOPATH/src/github.com/terraform-providers/terraform-provider-google/google/resource_container_cluster.go:1355 +0x4f2
github.com/terraform-providers/terraform-provider-google/google.resourceContainerClusterCreate(0xc420146a80, 0x16b1800, 0xc4200b8000, 0x0, 0x0)
	/tmp/GOPATH/src/github.com/terraform-providers/terraform-provider-google/google/resource_container_cluster.go:520 +0x2848
github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc420495490, 0xc420341310, 0xc4202582c0, 0x16b1800, 0xc4200b8000, 0x1, 0xc42024eae0, 0xc4201e3650)
	/tmp/GOPATH/src/github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:227 +0x364
github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc4204c6700, 0xc4203412c0, 0xc420341310, 0xc4202582c0, 0x14ee1441a000, 0x0, 0x18)
	/tmp/GOPATH/src/github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0xa4
github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc4202d7c40, 0xc42035de80, 0xc42025c160, 0x0, 0x0)
	/tmp/GOPATH/src/github.com/terraform-providers/terraform-provider-google/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:527 +0x57
reflect.Value.call(0xc4203feae0, 0xc42000e038, 0x13, 0x19e88a8, 0x4, 0xc42015ff20, 0x3, 0x3, 0xc420047ee8, 0xc4204c6798, ...)
	/usr/local/go/src/reflect/value.go:434 +0x905
reflect.Value.Call(0xc4203feae0, 0xc42000e038, 0x13, 0xc420047f20, 0x3, 0x3, 0xc400000001, 0x0, 0x0)
	/usr/local/go/src/reflect/value.go:302 +0xa4
net/rpc.(*service).call(0xc420418600, 0xc42007c140, 0xc42001e798, 0xc4200c4000, 0xc4202d6c40, 0x1557f80, 0xc42035de80, 0x16, 0x1557fc0, 0xc42025c160, ...)
	/usr/local/go/src/net/rpc/server.go:381 +0x142
created by net/rpc.(*Server).ServeCodec
	/usr/local/go/src/net/rpc/server.go:475 +0x36b
```

which we trigger by altering the first step to contain the HCL notation
for an empty list instead of simply an empty string.

In order to accomplish this, the tests had to be modified to accept an
emptyValue string as well which contains the content of the
`emptyValue` string when the cidrBlocks array is empty. This maintains
the old behavior of the original tests when `emptyValue` is an empty
string, while also facilating differing behavior for the new testcase by
setting `emptyValue` to whichever string we want to test instead. I
don't think this is very clean, but I guess it's pragmatic enough.

I'll hear if this is a thorn in the side to someone 😏.

* avoid panic on cidr_block type assertion

This is basically the fix. Since the value can be nil, we want to ensure
we handle a failure during the assertion since we know that asserting
`nil` conforms to `map[string]interface{}` will cause a run-time panic.

* flatten to config on empty list for cidr_blocks

since an empty list for cidrBlocks constitutes valid input, one should
return a map containing an empty list for the cidr_blocks field instead
of a nil value.

The nil value is only appropriate when the input Config is also nil.
2018-08-20 19:29:37 -07:00
Dana Hoffman
d1bf585724
Add support for binary authorization in GKE (#1884)
* revendor container/v1beta1

* add support for binauthz in gke

* update description
2018-08-16 17:51:03 -07:00
Nathan McKinley
f9f95e444d
Correctly update regional resource. (#1887) 2018-08-16 13:57:41 -07:00
Alexey Medvedchikov
3fc71ee432 Don't recreate google_container_cluster on master_auth change (#1873)
* Update google_container_cluster master_auth username and password without recreation of cluster, using setMasterAuth method

* Add tests to update and disable master_auth password and username values
2018-08-15 12:50:17 -07:00
Walker
c810e4b408 provider: Ensures schema.TypeMap elements are schema.Schema (#1835) 2018-08-14 16:53:39 -07:00
Dana Hoffman
00e5bd5363
allow updating node image types (#1843)
Fixes #1702.

@chrisst I'm putting you as a reviewer, but no rush. Feel free to ask as many questions as you have! Also feel free to offer suggestions 😃 (or just say it's perfect as-is, that works too)
2018-08-07 14:07:28 -07:00
Dan Isla
bb6c757ad1 Container cluster delete timeout to 30 min. (#1745)
Matches Create operation timeout. Should reduce timeouts when deleting regional clusters.
2018-07-26 10:22:39 -07:00
Paddy Carver
c404cd740b Use map helper. 2018-07-13 14:14:00 -07:00
Paddy Carver
0435b1f387 Fix crash when updating container cluster resource labels.
We had a bad type coercion in the code to update container cluster
resource labels. This fixes the coercion.

We didn't notice this because there was no test exercising the update
code path. I've added the test, which reproduced the panic before this
PR was applied and passes successfully now that the coercion is fixed.
2018-07-13 02:27:40 -07:00
Renzo Toma
90eabdec15 Increase max number of master_authorized_networks to 20, per GKE docs.
See https://cloud.google.com/kubernetes-engine/docs/how-to/authorized-networks#setting_up_an_authorized_network
2018-07-05 22:10:17 +02:00
Paddy
cf72a65aa5
Merge pull request #1663 from garethjevans/resourcelabels
Added ability to configure resource labels on a GKE cluster
2018-07-02 11:50:25 -07:00
Emily Ye
6b0dbf5bbe check d.Set errors for complex values for container cluster 2018-06-22 10:35:46 -07:00
Emily Ye
f3b092b3ca make sure TypeList keys still have empty values 2018-06-20 16:45:49 -07:00
emily
a2b95e35e6
Add diff suppress for empty/default pod_security_policy_config (#1670)
* add diff suppress for pod_security_policy_config

* change key comparison to exact
2018-06-19 16:37:10 -07:00
Gareth Evans
fee1c7f682 Type conversion issue 2018-06-15 11:39:08 +01:00
Gareth Evans
e14aa8bf39 Added ability to configure resource labels on a GKE cluster 2018-06-15 11:10:25 +01:00
Dana Hoffman
ac6e30d335
allow beta kubernetes logging; add monitoring validation (#1589)
Fixes #1577
2018-06-04 15:09:52 -07:00
Dana Hoffman
974c3f7646
Add GKE Shared VPC support (#1528)
All this needed was to allow setting the network/subnetwork to a self link.

~WIP for now because I want to run the tests in CI.~ Tests are passing.
2018-05-23 16:47:17 -07:00
Nathan McKinley
e37c25abe5
Can't move from region to region without a recreate. (#1456) 2018-05-09 12:55:28 -07:00
Dana Hoffman
8907321d60
Roll forward beta scaffolding PR (#1453)
* Revert "Merge pull request #1434 from terraform-providers/paddy_revert_beta"

This reverts commit 118cd71201, reversing
changes made to d59fcbbc59.

* add ConvertSelfLinkToV1 calls to places where beta links are stored
2018-05-09 11:24:40 -07:00
Vincent Roseberry
9cb159f992
ValidateFunc accepts blank value for cluster_ipv4_cidr (#1446)
* ValidateFunc accepts blank value for cluster_ipv4_cidr in google_container_cluster

* Simplify tests
2018-05-07 15:34:56 -07:00
Paddy Carver
f91c62d598 Revert "remove switch statements between api versions for container"
This reverts commit 9c85e57b8c7e84de385995df7ca04dd93e843f5b.
2018-05-04 07:52:42 -07:00
Dana Hoffman
d59fcbbc59
Remove switch statements between api versions for container; clean up dead version code (#1427)
* remove switch statements between api versions for container

* remove dead api version code and move things around
2018-05-03 21:51:54 -07:00
emily
ac64624adc
Add issue_client_certificate to cluster (#1396) 2018-04-27 18:06:26 -07:00
Darren Haken
2b1b668953 #1300 Supporting regional clusters for node pools (#1320)
This PR also switched us to using the beta API in all cases, and that had a side effect which is worth noting, note included here for posterity.

=====
The problem is, we add a GPU, and as per the docs, GKE adds a taint to
the node pool saying "don't schedule here unless you tolerate GPUs",
which is pretty sensible.

Terraform doesn't know about that, because it didn't ask for the taint
to be added. So after apply, on refresh, it sees the state of the world
(1 taint) and the state of the config (0 taints) and wants to set the
world equal to the config. This introduces a diff, which makes the test
fail - tests fail if there's a diff after they run.

Taints are a beta feature, though. :) And since the config doesn't
contain any taints, terraform didn't see any beta features in that node
pool ... so it used to send the request to the v1 API. And since the v1
API didn't return anything about taints (since they're a beta feature),
terraform happily checked the state of the world (0 taints I know about)
vs the config (0 taints), and all was well.

This PR makes every node pool refresh request hit the beta API. So now
terraform finds out about the taints (which were always there) and the
test fails (which it always should have done).

The solution is probably to write a little bit of code which suppresses
the report of the diff of any taint with value 'nvidia.com/gpu', but
only if GPUs are enabled. I think that's something that can be done.
2018-04-24 17:55:21 -07:00
Nathan McKinley
de9363502b
Fix for networkPolicyEnabled test - must explicitly add default network policy. (#1363) 2018-04-20 11:39:20 -07:00
Nathan McKinley
039e82cf6d
Regional cluster update support for additional zones (#1359) 2018-04-19 14:17:38 -07:00
Nathan McKinley
92d98fc8e1
Make sure that additional zones are added-then-removed instead of all at once. (#1354) 2018-04-18 17:29:07 -07:00
Ben Galvin
1c992ab241 Use correct project id regex in instanceGroupManagerURL (#1311) 2018-04-10 09:52:54 -07:00
ashish-amarnath
f488a6e6bf Add support for regional GKE clusters in google_container_cluster (#1181)
* Add support for regional GKE clusters in google_container_cluster:

* implement operation wait for v1beta1 api
* implement container clusters get for regional clusters
* implement container clusters delete for regional cluster
* implement container clusters update for regional cluster
* simplify logic by using generic 'location' instead of 'zone' and 'region'
* implement a method to generate the update function and refactor
* rebase and fix

* reorder container_operation fns

* cleanup

* add import support and docs

* additional locations cleanup
2018-04-05 14:51:35 -07:00
Michael Parker
b8adcc28fe Updates container_cluster to set enable_legacy_abac to false by default (#1281)
* Updates the default GKE legacy ABAC setting to false

* Updates docs for container_cluster

* Update test comments

* Format fix

* Adds ImportState test step to default legacy ABAC test
2018-04-04 10:58:08 -07:00
emily
360260d8d0
Add project to container cluster import name. (#1282)
* allow import of container cluster by project as well

* update docs for importing container cluster with project

* combine tests
2018-04-03 13:39:28 -07:00
Janos Lenart
1840363c74 Adding private_cluster (#1250)
* Updated google.golang.org/api/container/v1beta1

* Added support for private_cluster and master_ipv4_cidr

This is to implement #1174. See
https://groups.google.com/forum/#!topic/google-cloud-sdk-announce/GGW3SQSANIc

* Added simple test for private_cluster and master_ipv4_cidr

* Review replies

* Added some documentation for private_cluster
2018-03-30 10:10:25 -07:00
Dana Hoffman
42cca119eb add gke taints 2018-03-27 14:55:42 -07:00
Dana Hoffman
685842410e
Add update support for pod security policy (#1195)
* move setid calls back

* Revert "move setid calls back"

This reverts commit 0c7b2dbf92aff33dac8c5beb95568c2bc86dd7de.

* add update support for pod security policy

* update test

* add comment about updates
2018-03-23 11:27:37 -07:00
Dana Hoffman
95f96674a8
add ability to delete the default node pool (#1245) 2018-03-22 17:22:44 -07:00