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 fleet field to google_container_cluster resource #6610

Conversation

modular-magician
Copy link
Collaborator

Changes in this PR:

  • Support fleet field in google_container_cluster resource. Example usage:

    • Set fleet config eg.fleet {project = "my-project"}.
    • Remove fleet config by removing the fleet block.
  • Add DiffSuppressFunc for fleet field when fleet.pre_registered = true:

    • Today Fleet config could be generated by server (and fleet.pre-registered will be true in this case). Suppress diff for this case.
  • Mark binary_authorization.evaluation_mode field as computed:

    • When creating the cluster resource with fleet config, container API server will populate value for binary_authorization.evaluation_mode. So we need to mark this field as computed.

Release Note Template for Downstream PRs (will be copied)

container: added `fleet` field to `google_container_cluster` resource
container: marked `binary_authorization.evaluation_mode` field as computed and optional in `google_container_cluster` resource

Derived from GoogleCloudPlatform/magic-modules#9385

* Add fleet field in resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* Update resource_container_cluster.go.erb

* mark evaluation_mode as computed.

* Update resource_container_cluster_test.go.erb

* Update resource_container_cluster_test.go.erb

* update documentation for fleet field

* fixed fleet documentation

* fixed fleet unit test

* fixed fleet unit test

* fixed fleet unit test - add a mutation test

* fixed expected error for fleet mutation

* fixed fleet mutation unit test
[upstream:38a2a08f6c5741200fb81bc9dfe21fee95771e3b]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit c2933ea into hashicorp:main Nov 7, 2023
@modular-magician modular-magician deleted the downstream-pr-38a2a08f6c5741200fb81bc9dfe21fee95771e3b branch November 16, 2024 02:20
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.

1 participant