Skip to content

Commit

Permalink
chore: update tests to use 1.0 image and update compat note (#965)
Browse files Browse the repository at this point in the history
* feat: update tests and readme for 1.0

* autogen fmt

* ignore lockfile

* build

* swap cloudbuild images

* test serial create

* sensitive vals in root mod fixtures

* mark wrapped op as sensitive

* fix_headers

* Update README.md

* regen docs
  • Loading branch information
bharathkkb authored Aug 13, 2021
1 parent 5d25e15 commit bb36cbf
Show file tree
Hide file tree
Showing 71 changed files with 537 additions and 269 deletions.
14 changes: 14 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

releaseType: terraform-module
handleGHRelease: true
14 changes: 14 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Close stale issues"
on:
schedule:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Session.vim
*.tfstate
*.tfstate.*

# tf lock file
.terraform.lock.hcl

# Crash log files
crash.log

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.13
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.0
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Sub modules are provided for creating private clusters, beta private clusters, a

## Compatibility

This module is meant for use with Terraform 0.12. If you haven't
[upgraded][terraform-0.12-upgrade] and need a Terraform
0.11.x-compatible version of this module, the last released version
intended for Terraform 0.11.x is [3.0.0].
This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=0.13`, please open an issue.

If you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [12.3.0].

## Usage
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:
Expand Down Expand Up @@ -293,5 +295,5 @@ In order to operate with the Service Account you must activate the following API
- Kubernetes Engine API - container.googleapis.com

[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
[3.0.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/3.0.0
[terraform-0.12-upgrade]: https://www.terraform.io/upgrade-guides/0-12.html
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
14 changes: 8 additions & 6 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ The implications of this are that:
{% endif %}
## Compatibility

This module is meant for use with Terraform 0.12. If you haven't
[upgraded][terraform-0.12-upgrade] and need a Terraform
0.11.x-compatible version of this module, the last released version
intended for Terraform 0.11.x is [3.0.0].
This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=0.13`, please open an issue.

If you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [12.3.0].

## Usage
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:
Expand Down Expand Up @@ -260,5 +262,5 @@ In order to operate with the Service Account you must activate the following API
{% else %}
[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
{% endif %}
[3.0.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/3.0.0
[terraform-0.12-upgrade]: https://www.terraform.io/upgrade-guides/0-12.html
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
6 changes: 3 additions & 3 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ resource "google_container_cluster" "primary" {

addons_config {
http_load_balancing {
disabled = ! var.http_load_balancing
disabled = !var.http_load_balancing
}

horizontal_pod_autoscaling {
disabled = ! var.horizontal_pod_autoscaling
disabled = !var.horizontal_pod_autoscaling
}

network_policy_config {
disabled = ! var.network_policy
disabled = !var.network_policy
}
{% if beta_cluster %}

Expand Down
6 changes: 3 additions & 3 deletions autogen/main/dns.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
module "gcloud_delete_default_kube_dns_configmap" {
source = "terraform-google-modules/gcloud/google//modules/kubectl-wrapper"
version = "~> 2.1.0"
enabled = (local.custom_kube_dns_config || local.upstream_nameservers_config) && ! var.skip_provisioners
enabled = (local.custom_kube_dns_config || local.upstream_nameservers_config) && !var.skip_provisioners
cluster_name = google_container_cluster.primary.name
cluster_location = google_container_cluster.primary.location
project_id = var.project_id
Expand All @@ -42,7 +42,7 @@ module "gcloud_delete_default_kube_dns_configmap" {
Create kube-dns confimap
*****************************************/
resource "kubernetes_config_map" "kube-dns" {
count = local.custom_kube_dns_config && ! local.upstream_nameservers_config ? 1 : 0
count = local.custom_kube_dns_config && !local.upstream_nameservers_config ? 1 : 0

metadata {
name = "kube-dns"
Expand All @@ -67,7 +67,7 @@ EOF
}

resource "kubernetes_config_map" "kube-dns-upstream-namservers" {
count = ! local.custom_kube_dns_config && local.upstream_nameservers_config ? 1 : 0
count = !local.custom_kube_dns_config && local.upstream_nameservers_config ? 1 : 0

metadata {
name = "kube-dns"
Expand Down
8 changes: 4 additions & 4 deletions autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ locals {
cluster_monitoring_service = local.cluster_output_monitoring_service
cluster_node_pools_names = local.cluster_output_node_pools_names
cluster_node_pools_versions = local.cluster_output_node_pools_versions
cluster_network_policy_enabled = ! local.cluster_output_network_policy_enabled
cluster_http_load_balancing_enabled = ! local.cluster_output_http_load_balancing_enabled
cluster_horizontal_pod_autoscaling_enabled = ! local.cluster_output_horizontal_pod_autoscaling_enabled
workload_identity_enabled = ! (var.identity_namespace == null || var.identity_namespace == "null")
cluster_network_policy_enabled = !local.cluster_output_network_policy_enabled
cluster_http_load_balancing_enabled = !local.cluster_output_http_load_balancing_enabled
cluster_horizontal_pod_autoscaling_enabled = !local.cluster_output_horizontal_pod_autoscaling_enabled
workload_identity_enabled = !(var.identity_namespace == null || var.identity_namespace == "null")
cluster_workload_identity_config = ! local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
identity_namespace = "${var.project_id}.svc.id.goog" }] : [{ identity_namespace = var.identity_namespace
}]
Expand Down
Loading

0 comments on commit bb36cbf

Please sign in to comment.