Skip to content

fix: Replace deprecated kubernetes_service_account with kubernetes_service_account_v1#2560

Open
nacholiya wants to merge 7 commits intoterraform-google-modules:mainfrom
nacholiya:fix/kubernetes-sa-deprecation
Open

fix: Replace deprecated kubernetes_service_account with kubernetes_service_account_v1#2560
nacholiya wants to merge 7 commits intoterraform-google-modules:mainfrom
nacholiya:fix/kubernetes-sa-deprecation

Conversation

@nacholiya
Copy link
Copy Markdown

Description

Replaced deprecated kubernetes_service_account with kubernetes_service_account_v1 in workload-identity module.

Type of Change

  • Bug fix

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 23, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug by updating a deprecated resource in the workload-identity module. The change ensures compatibility and avoids potential issues arising from using deprecated features.

Highlights

  • Bug Fix: Replaces the deprecated kubernetes_service_account resource with kubernetes_service_account_v1 in the workload-identity module.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the deprecated kubernetes_service_account resource to kubernetes_service_account_v1. To ensure the module remains consistent and functional, the documentation and examples need to be updated. A comment has been added to highlight the specific files requiring updates.

}

resource "kubernetes_service_account" "main" {
resource "kubernetes_service_account_v1" "main" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The change to kubernetes_service_account_v1 requires updates to the module's documentation and examples to maintain consistency and functionality. Specifically:

  • modules/workload-identity/README.md: Update examples and error message snippets to reflect the use of kubernetes_service_account_v1.
  • examples/workload_identity/main.tf: Update to use kubernetes_service_account_v1 and remove the secret block, as it's not supported and deprecated in recent Kubernetes versions.

@nacholiya nacholiya force-pushed the fix/kubernetes-sa-deprecation branch from f80aea1 to 09503aa Compare March 23, 2026 12:32
@nacholiya
Copy link
Copy Markdown
Author

@gcp-terraform-admins Could you please trigger the Cloud Build check (/gcbrun)? I've addressed all review feedback.

@nacholiya
Copy link
Copy Markdown
Author

@gcp-terraform-admins Could you please trigger the Cloud Build check (/gcbrun)? I've addressed all review feedback.

Copy link
Copy Markdown
Collaborator

@apeabody apeabody 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 the contribution @nacholiya!

@apeabody
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the kubernetes_service_account resource to kubernetes_service_account_v1 across the examples, README, and the main module. A logical error was identified where the output_k8s_namespace local variable in modules/workload-identity/main.tf was incorrectly changed to reference the service account's name instead of its namespace.

@nacholiya
Copy link
Copy Markdown
Author

Hi maintainers, I've addressed the requested changes and triggered /gcbrun.
Could you please approve and run the workflow? Thanks!

@apeabody
Copy link
Copy Markdown
Collaborator

/gemini review

@apeabody
Copy link
Copy Markdown
Collaborator

/gcbrun

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Terraform configuration to use the kubernetes_service_account_v1 resource instead of the deprecated kubernetes_service_account resource across the main module and examples. I have no feedback to provide as the changes correctly implement the required resource migration.

@nacholiya
Copy link
Copy Markdown
Author

Hi maintainers, could you please trigger the CI by running /gcbrun? I have addressed the requested changes. Thank you!

@apeabody
Copy link
Copy Markdown
Collaborator

/gcbrun

@nacholiya
Copy link
Copy Markdown
Author

Hi maintainers, I’ve addressed the remaining changes including removing version pinning in the examples. Could you please trigger the CI again with /gcbrun? Thanks!

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.

2 participants