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 support for legacyAbac to google_container_cluster #261

Merged
merged 3 commits into from
Jul 31, 2017

Conversation

danawillow
Copy link
Contributor

Fixes #219.

Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

I believe we need to add this field to it's own ForceSendFields, and then I think we need to consider using default value.

Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Required: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect we want a default value here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -409,6 +424,12 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
cluster.Description = v.(string)
}

if _, ok := d.GetOk("legacy_abac"); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

if the user specifies false, this block won't get triggered, right? So we'll never send false, if I recall correctly

Copy link
Contributor

@catsby catsby Jul 28, 2017

Choose a reason for hiding this comment

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

In addition, LegacyAbac.Enabled is a boolean that's marshaled with omitempty, so even if we do go in here, we won't actually send false unless this field is added to the LegacyAbac.ForceSendFields slice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Fixed.

@@ -149,6 +149,21 @@ func resourceContainerCluster() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
},

"legacy_abac": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any other parameters here? Should we simplify this for the users into a simple toggle?
enable_legacy_abac ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was leaving the option open in case any others get added, but realistically I don't think they will so I went ahead and made the change.

@@ -291,6 +317,7 @@ func testAccCheckContainerCluster(n string) resource.TestCheckFunc {
{"description", cluster.Description},
{"endpoint", cluster.Endpoint},
{"instance_group_urls", igUrls},
{"legacy_abac.0.enabled", strconv.FormatBool(cluster.LegacyAbac.Enabled)},
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this is accurately testing this as the code stands. We can't send false, so we never actually change the value. The test doesn't seem to verify that the value is now false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, you're right. Fixed.

Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

LGTM took it for a spin and everything checked out, thanks!

@danawillow danawillow merged commit 32d7c3f into hashicorp:master Jul 31, 2017
@danawillow danawillow deleted the is-219 branch July 31, 2017 18:09
z1nkum pushed a commit to z1nkum/terraform-provider-google that referenced this pull request Aug 15, 2017
* revendor container api

* Add support for legacyAbac to `google_container_cluster`

* change to single enabled field
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* revendor container api

* Add support for legacyAbac to `google_container_cluster`

* change to single enabled field
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @Chupaka
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
flozzone pushed a commit to flozzone/terraform-provider-google that referenced this pull request Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow creating RBAC google container clusters
2 participants