Skip to content

Conversation

@PhennyOpsta
Copy link

Improve the ServiceAccount creation process and update how it is referenced and configured within the PodSpec.

nakarin-s and others added 2 commits February 6, 2026 17:30
The serviceAccount values were changed to a (create/name), but the podspec was still expecting a flat string. This fix restores the correct serviceAccountName mapping.
@gemini-code-assist
Copy link

Summary of Changes

Hello @PhennyOpsta, 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 streamlines the management of Kubernetes ServiceAccounts within the Helm chart ecosystem. It introduces a more direct way to specify ServiceAccount names, moving from a nested object structure to a simple string value. This change simplifies the ServiceAccount creation template and its integration into PodSpecs, ensuring a more consistent and easier-to-manage configuration across various applications leveraging the common chart.

Highlights

  • ServiceAccount Configuration Refactor: The logic for creating and naming ServiceAccounts in the common chart has been refactored. It now expects a direct string value for the ServiceAccount name instead of a nested object with 'create' and 'name' properties.
  • Helm Chart Version Updates: The charts/common chart version has been incremented to 0.9.0. Consequently, all dependent charts (cron-job, onechart, static-site) have updated their common chart dependency to this new version.
  • Schema and Value File Alignment: The values.schema.json and values.yaml files in charts/onechart have been updated to align with the new string-based ServiceAccount configuration, removing the old object structure.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • charts/common/Chart.yaml
    • Updated the chart version from 0.8.0 to 0.9.0.
  • charts/common/templates/_podSpec.yaml
    • Removed a trailing newline character for minor formatting consistency.
  • charts/common/templates/_serviceaccount.yaml
    • Modified the ServiceAccount creation condition to check for the existence of .Values.serviceAccount (string) instead of .Values.serviceAccount.create (boolean).
    • Changed the ServiceAccount name derivation to directly use .Values.serviceAccount.
    • Removed the labels section from the ServiceAccount metadata.
  • charts/cron-job/Chart.lock
    • Updated the common chart dependency version to 0.9.0 and regenerated digest.
  • charts/cron-job/Chart.yaml
    • Decremented the chart's own version from 0.78.0 to 0.77.0.
    • Updated the common chart dependency version to 0.9.0.
  • charts/onechart/Chart.lock
    • Updated the common chart dependency version to 0.9.0 and regenerated digest.
  • charts/onechart/Chart.yaml
    • Decremented the chart's own version from 0.78.0 to 0.77.0.
    • Updated the common chart dependency version to 0.9.0.
  • charts/onechart/values.schema.json
    • Added a new top-level serviceAccount property of type string to define the Kubernetes ServiceAccount name, replacing the previous object structure.
  • charts/onechart/values.yaml
    • Removed the deprecated object-based serviceAccount configuration block.
  • charts/static-site/Chart.lock
    • Updated the common chart dependency version to 0.9.0 and regenerated digest.
  • charts/static-site/Chart.yaml
    • Decremented the chart's own version from 0.78.0 to 0.77.0.
    • Updated the common chart dependency version to 0.9.0.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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

@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 aims to simplify the ServiceAccount configuration. However, a potential YAML injection vulnerability was identified in the ServiceAccount template where user-supplied values are used without proper quoting, which could allow for the injection of malicious metadata. Additionally, the current implementation introduces a significant regression by removing the ability to use pre-existing ServiceAccounts and also removes standard labels from created resources. Several chart versions have also been incorrectly decremented, which needs to be addressed.

# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.78.0
version: 0.77.0

Choose a reason for hiding this comment

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

critical

The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.

version: 0.79.0

# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.78.0
version: 0.77.0

Choose a reason for hiding this comment

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

critical

The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.

version: 0.79.0

# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.78.0
version: 0.77.0

Choose a reason for hiding this comment

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

critical

The chart version has been decremented from 0.78.0 to 0.77.0. This violates Semantic Versioning principles and can break dependency management and deployment pipelines. The version should be incremented to reflect the new changes. Given this is a feature change, a minor version bump is appropriate.

version: 0.79.0

kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name | default (include "onechart.fullname" .) }}
name: {{ .Values.serviceAccount }}

Choose a reason for hiding this comment

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

security-medium medium

A YAML injection vulnerability exists here as the user-provided value .Values.serviceAccount is rendered directly without quoting, potentially allowing for malicious metadata injection. It is critical to use the quote function to prevent this. Furthermore, the current ServiceAccount creation logic in this block introduces a regression by removing the ability to use existing ServiceAccounts and omitting standard labels, which are essential for resource management.

  name: {{ .Values.serviceAccount | quote }}

"$id": "#/properties/serviceAccount",
"type": "string",
"title": "The name of service account",
"description": "Name of the Kubernetes ServiceAccount to associate with this workload. If not specified, the chart will automatically create one.",

Choose a reason for hiding this comment

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

medium

The description for serviceAccount is misleading. It states "If not specified, the chart will automatically create one." However, the template logic in _serviceaccount.yaml ({{- if .Values.serviceAccount }}) will only create a service account if a name is provided. If it's not specified (i.e., an empty string), no service account is created. The description should be updated to accurately reflect the actual behavior of the chart.

Suggested change
"description": "Name of the Kubernetes ServiceAccount to associate with this workload. If not specified, the chart will automatically create one.",
"description": "Name of the Kubernetes ServiceAccount to associate with this workload. If a name is provided, a new ServiceAccount will be created with that name. If not specified, no ServiceAccount will be created or used.",

@PhennyOpsta PhennyOpsta closed this Feb 9, 2026
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