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

Fix "Invalid index" creating private cluster #422

Conversation

endorama
Copy link
Contributor

@endorama endorama commented Feb 6, 2020

Provide a fix for #419 Invalid index error when creating a private cluster.

Closes #419

endorama and others added 2 commits February 6, 2020 12:57
As google_container_cluster.primary.private_cluster_config may be empty,
we check its length before trying to access it.

When creating a new private cluster, a "Invalid index" error was showing
up during the planning.

By checking for variable length before trying to access it the plan (and
apply) works as expected.

Issue: [terraform-google-modules#419]

Co-authored-by: Morgante Pell <morgantep@google.com>
@endorama endorama changed the title Fix Invalid index creating private cluster Fix "Invalid index" creating private cluster Feb 6, 2020
Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@morgante morgante merged commit cc53d1c into terraform-google-modules:master Feb 6, 2020
@endorama endorama deleted the fix-private-cluster-endpoint branch February 6, 2020 16:28
@endorama endorama restored the fix-private-cluster-endpoint branch February 6, 2020 16:28
@endorama endorama deleted the fix-private-cluster-endpoint branch February 6, 2020 16:28
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this pull request Jul 15, 2024
…m-google-modules#422)

* fix Invalid index error when creating a private cluster

As google_container_cluster.primary.private_cluster_config may be empty,
we check its length before trying to access it.

When creating a new private cluster, a "Invalid index" error was showing
up during the planning.

By checking for variable length before trying to access it the plan (and
apply) works as expected.

Issue: [terraform-google-modules#419]

Co-authored-by: Morgante Pell <morgantep@google.com>

* perform generation

Co-authored-by: Morgante Pell <morgante.pell@morgante.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

given key is not an element when using latest private-cluter
2 participants