Commit Graph

100 Commits

Author SHA1 Message Date
The Magician
da338edfba use the cluster subnet to look up the node cidr block (#3654)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-05-20 14:31:38 -07:00
The Magician
189a617987 fix TestAccContainerCluster_errorCleanDanglingCluster (#3586)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-05-08 13:58:41 -07:00
The Magician
4688b0d33f Fix explicitly setting the default network + subnetwork in GKE (#3492)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-04-26 15:31:16 -07:00
The Magician
58a58c769f Use attr syntax on cluster-specific GKE fields. (#3448)
<!-- This change is generated by MagicModules. -->
Original Author: @rileykarson
2019-04-16 16:10:29 -07:00
The Magician
20391bd842 Add location / node_locations fields to GKE (#3114)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-03-13 09:32:46 -07:00
The Magician
705a9a754d Just don't set remove_node_pool on import (#3180)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-03-04 18:03:58 -08:00
The Magician
749e6b0281 Make VPC Native configurable in GKE (#3174)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-03-04 14:08:40 -08:00
The Magician
1a5624c8ea Specify CIDR block sizes for GKE cluster subnets (#3145)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-28 21:19:29 -08:00
The Magician
77c086de1c [TF] GKE Cluster - fix import on some convenience fields (#3146)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-28 13:08:55 -08:00
The Magician
b2f501754f Clean up failed cluster creation (#3044)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-14 10:29:34 -08:00
The Magician
92d8995699 Fix GKE specific IP test (#3022)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-08 16:11:15 -08:00
The Magician
6cb21b34b0 Various CI test fixes (#3018)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-02-08 12:05:39 -08:00
The Magician
b58053fe5d Bring forwards/backwards compatible 0.12 syntax to HEAD (#2984)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-02-01 14:45:29 -08:00
The Magician
43d8943745 Restore name_prefix for node pools (#2975)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-02-01 11:34:45 -08:00
The Magician
5a06139281 fixes to updating node versions (#2872)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-01-18 09:59:11 -08:00
The Magician
2ab6d1995f Add = to map declarations in examples/tests (#2755)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-27 07:51:23 -08:00
The Magician
29c665d865 Various linter cleanups (conversions, unused, misspellings) (#2681)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
The Magician
c605b0bc4b [Terraform]: Apply gofmt -s to all files managed by MM (#2676)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
The Magician
0ec1001bfe Remove beta fields from GA Container resources (#2601)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
Paddy
7a182b070d Remove the ContainerCluster_sharedVpc test 2018-12-20 17:22:22 -08:00
The Magician
b807d04e10 Fix for permadiff in container cluster caused by beta resource. (#2488) 2018-12-20 17:22:22 -08:00
The Magician
9ff5284d15 Container cluster changes ancillary to beta support for autoprovisioning. (#2415) 2018-12-20 17:22:22 -08:00
The Magician
7c3445229c Make removals in google_container_cluster (#2395) 2018-12-20 17:22:22 -08:00
The Magician
0f5c81ce65 regional and private clusters are in GA now (#2364)
<!-- This change is generated by MagicModules. -->
/cc @danawillow 

Fixes #2286
2018-12-20 17:22:22 -08:00
Chris Stephens
ce78bb0ce8 Remove name_prefix from container node pool 2018-12-20 17:22:22 -08:00
Chris Stephens
f85dc70b20 Fix ci tests 2018-12-20 17:22:22 -08:00
The Magician
9da993f663 Magic Modules changes. (#2297) 2018-12-20 17:22:22 -08:00
Nathan McKinley
902675c324 Reverting 1.20 and 1.19 cherrypick branches. 2018-12-20 17:22:22 -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
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
Nathan McKinley
ab4eef468c
Fix _withPrivateCluster container test. (#2041) 2018-09-12 17:58:11 -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
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
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
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
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
Paddy
0eb723ec32
Merge pull request #1665 from vishen/container_cluster_disk_type
container_cluster: added disk_type node configuration
2018-07-06 05:16:12 -07:00
Gareth Evans
bf7c70b392 Minor code changes as requested 2018-06-25 09:55:27 +01:00
Jonathan Pentecost
d0890dc2b7 container_cluster: added disk_type node configuration
Added node config 'disk_type' which can either be 'pd-standard' or
'pd-ssd', if left blank 'pd-standard' will be the default used by google
cloud.

Closes: #1656
2018-06-15 21:21:51 +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
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
Dana Hoffman
d78725f866
fix ipallocationpolicy test (#1465) 2018-05-09 16:57:01 -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
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