Skip to content

Resource google_container_cluster always enables legacy authorization #1116

Closed
@mrparkers

Description

@mrparkers

I'm not sure if this would be classified as a bug, but I was advised by @paddycarver to report it.

According to the GKE docs, GKE clusters with a version of 1.8 or higher will have legacy authorization disabled by default. Reference:

Kubernetes Engine clusters running Kubernetes version 1.8 and later disable the legacy authorization system by default, and thus role-based access control permissions take effect with no special action required.

However, it looks like this resource will always enable legacy authorization by default, regardless of the k8s version used: https://github.com/terraform-providers/terraform-provider-google/blob/master/google/resource_container_cluster.go#L160.

Also, the docs for this resource don't specify that the default value for the enable_legacy_abac argument is true: https://www.terraform.io/docs/providers/google/r/container_cluster.html#enable_legacy_abac

I suppose the fix for this would be to make the default value of the enable_legacy_abac argument depend on the value of node_version. I'm not sure if it makes sense for the provider to use different default values for this argument depending on another argument, but that is the behavior I was expecting as a user.

I'll happily submit a PR for whatever change that seems to be the most appropriate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions