Skip to content

Comments

Robot Upgrade: submariner-operator chart upgrade from 0.19.2 to 0.22.1#3917

Open
weizhoublue wants to merge 1 commit intomainfrom
upgrade/submariner-operator/0.22.1
Open

Robot Upgrade: submariner-operator chart upgrade from 0.19.2 to 0.22.1#3917
weizhoublue wants to merge 1 commit intomainfrom
upgrade/submariner-operator/0.22.1

Conversation

@weizhoublue
Copy link
Member

I am robot, upgrade: project submariner-operator chart upgrade from 0.19.2 to 0.22.1

@gemini-code-assist
Copy link

Summary of Changes

Hello @weizhoublue, 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 primarily focuses on upgrading the submariner-operator Helm chart to a newer version, bringing with it significant refactoring of Kubernetes Role-Based Access Control (RBAC) and service account definitions. The changes aim to enhance the maintainability and clarity of the chart's security configurations by breaking down large, generic RBAC files into smaller, component-specific ones. This modular approach simplifies the management of permissions for different Submariner components.

Highlights

  • Chart Version Upgrade: The submariner-operator Helm chart has been upgraded from version 0.19.2 to 0.22.1, reflecting updates across various configuration and chart definition files.
  • RBAC and Service Account Refactoring: The monolithic rbac.yaml and svc-acct.yaml files have been removed and their functionalities modularized into dedicated RBAC files for gateway, globalnet, openshift-monitoring, operator, routeagent, and service-discovery components. This improves organization and clarity of access controls.
  • Helm Template Simplification: Several helper templates for generating chart names and service account names were removed from _helpers.tpl, indicating a shift towards more direct naming conventions or simplified logic within the new RBAC definitions.
  • Operator Deployment Configuration Update: The operator deployment manifest was updated to remove a redundant component: gateway label, change the container entrypoint from command to args with --leader-elect, and directly specify submariner-operator as the service account name.

🧠 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/submariner-operator/config
    • Updated the VERSION environment variable from 0.19.2 to 0.22.1.
  • charts/submariner-operator/submariner-operator/Chart.yaml
    • Updated the appVersion and version fields from 0.19.2 to 0.22.1.
    • Updated the dependency version for submariner-operator to 0.22.1.
  • charts/submariner-operator/submariner-operator/README.md
    • Removed documentation entries for rbac.create and various serviceAccounts parameters.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/Chart.yaml
    • Updated the appVersion and version fields from 0.19.2 to 0.22.1.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/README.md
    • Removed documentation entries for rbac.create and various serviceAccounts parameters.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/_helpers.tpl
    • Removed the submariner.name helper definition.
    • Removed several helper definitions for service account names (e.g., submariner.operatorServiceAccountName, submariner.gatewayServiceAccountName).
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/gateway-rbac.yaml
    • Added a new file defining ServiceAccount, Role, RoleBinding, ClusterRole, and ClusterRoleBinding for the submariner-gateway component.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/globalnet-rbac.yaml
    • Added a new file defining ServiceAccount, Role, RoleBinding, ClusterRole, and ClusterRoleBinding for the submariner-globalnet component, conditionally enabled by broker.globalnet.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/openshift-monitoring-rbac.yaml
    • Added a new file defining a Role and RoleBinding for submariner-metrics-reader to allow Prometheus to access metrics in OpenShift environments.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/operator-deployment.yaml
    • Removed the component: gateway label from the operator deployment metadata.
    • Changed the container entrypoint from command to args and added the --leader-elect argument.
    • Updated the serviceAccountName to a static submariner-operator instead of using a template.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/operator-rbac.yaml
    • Added a new file defining ServiceAccount, Role, RoleBinding, ClusterRole, and ClusterRoleBinding for the submariner-operator itself.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/rbac.yaml
    • Removed the entire file, as RBAC definitions have been refactored into separate, component-specific files.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/routeagent-rbac.yaml
    • Added a new file defining ServiceAccount, Role, RoleBinding, ClusterRole, and ClusterRoleBinding for the submariner-routeagent component.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/service-discovery-rbac.yaml
    • Added a new file defining ServiceAccounts, Roles, RoleBindings, ClusterRoles, and ClusterRoleBindings for submariner-lighthouse-agent and submariner-lighthouse-coredns, conditionally enabled by submariner.serviceDiscovery.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/templates/svc-acct.yaml
    • Removed the entire file, as service account definitions have been moved into the new RBAC files.
  • charts/submariner-operator/submariner-operator/charts/submariner-operator/values.yaml
    • Removed the rbac.create field.
    • Removed the entire serviceAccounts section.
  • charts/submariner-operator/submariner-operator/values.yaml
    • Updated the submariner-operator.images.tag and submariner-operator.operator.image.tag fields from 0.19.2 to 0.22.1.
    • Removed the rbac.create field.
    • Removed the entire serviceAccounts section.
Activity
  • No human activity has been recorded on this pull request since its creation.
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 upgrades the submariner-operator chart from version 0.19.2 to 0.22.1. While the refactoring of RBAC resources into component-specific files is a positive step for maintainability, a security audit reveals critical concerns. Many defined roles and cluster roles violate the principle of least privilege, granting overly broad access to sensitive resources like secrets, configmaps, nodes, and network-related resources, which could lead to cluster-wide impact upon compromise. Furthermore, a weak default token is used in the values files. Additionally, a critical issue has been identified in the new RBAC configuration for OpenShift monitoring that will cause deployment failures if the chart is not installed in a specific namespace.

Comment on lines +142 to +151
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- get
- list
- watch
- update

Choose a reason for hiding this comment

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

security-critical critical

The submariner-operator ClusterRole has cluster-wide create, get, list, watch, and update permissions on ConfigMaps. The comment indicates this is for updating the CoreDNS config, but the permission is not restricted to a specific ConfigMap. A compromised operator could modify any ConfigMap in the cluster, leading to cluster-wide denial of service, configuration manipulation, or other attacks. This is a critical risk. The permission should be scoped to the specific coredns ConfigMap in the kube-system namespace by using resourceNames.

kind: Role
metadata:
name: submariner-metrics-reader
namespace: submariner-operator

Choose a reason for hiding this comment

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

critical

The namespace for the submariner-metrics-reader Role is hardcoded to submariner-operator. The associated RoleBinding (read-submariner-metrics) does not specify a namespace, so it will be created in the release namespace ({{ .Release.Namespace }}). A RoleBinding can only reference a Role in the same namespace. This will cause the Helm deployment to fail if the chart is installed in any namespace other than submariner-operator.

To fix this and allow the chart to be deployed in any namespace, the Role's namespace should be dynamically set to the release namespace.

  namespace: {{ .Release.Namespace }}

Comment on lines +53 to +63
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- update
- create
- watch
- delete
- list

Choose a reason for hiding this comment

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

security-high high

The submariner-gateway Role has overly broad permissions on Secrets within the namespace. It is granted get, update, create, watch, delete, and list permissions on all secrets. If the gateway component were to be compromised, an attacker could potentially read, modify, or delete all secrets in the release namespace, leading to privilege escalation and compromise of other components. According to the principle of least privilege, access should be restricted to only the specific secrets (using resourceNames) that the gateway requires.

Comment on lines +69 to +80
- apiGroups:
- ""
resources:
- services
- endpoints
verbs:
- create
- get
- list
- watch
- update
- delete

Choose a reason for hiding this comment

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

security-high high

The submariner-globalnet ClusterRole is granted broad permissions to manage services and endpoints across all namespaces (create, get, list, watch, update, delete). A compromise of the submariner-globalnet component could allow an attacker to modify, intercept, or redirect network traffic for any service in the cluster. This violates the principle of least privilege. If possible, these permissions should be restricted to specific namespaces or resources.

Comment on lines +22 to +33
- apiGroups:
- ""
resources:
# For syncing Secrets from the broker
- secrets
verbs:
- get
- list
- watch
- create
- update
- delete

Choose a reason for hiding this comment

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

security-high high

The submariner-operator Role is granted get, list, watch, create, update, and delete permissions on all secrets within its namespace. A compromised operator could exfiltrate or manipulate all secrets in the namespace, potentially leading to further privilege escalation. The comment states this is for syncing secrets from the broker. Access should be limited to only the specific secrets required for this function, using resourceNames or label selectors.

Comment on lines +96 to +105
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
# route agent needs to annotate nodes to prevent OVNK SNAT
- update

Choose a reason for hiding this comment

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

security-high high

The submariner-routeagent ClusterRole has update permission on all nodes in the cluster. The comment states this is for annotating nodes, but the permission is not restricted to only annotations. A compromised route agent could modify node specs, taints, or labels, potentially causing cluster-wide scheduling disruptions or other issues. The update permission should be replaced with patch and restricted to only the necessary fields if possible, or a more sophisticated mechanism like an admission controller should be used to limit the scope of changes.

Comment on lines +24 to +36
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
- endpointslices/restricted
verbs:
- create
- get
- list
- watch
- update
- delete
- deletecollection

Choose a reason for hiding this comment

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

security-high high

The submariner-lighthouse-agent ClusterRole has full create, update, and delete permissions on EndpointSlices cluster-wide. A compromise of this agent could allow an attacker to manipulate EndpointSlices for any service in the cluster, leading to traffic interception, redirection, or denial of service. While this may be required for multi-cluster service discovery, it represents a significant concentration of privilege.

tag: "0.19.2"
tag: "0.22.1"
registry: quay.m.daocloud.io
broker:

Choose a reason for hiding this comment

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

security-medium medium

The default value for broker.token is a weak, hardcoded placeholder ('test'). If an administrator deploys the chart without overriding this value, the broker connection will be authenticated with a well-known, insecure token. The default value should be changed to an empty string ("") to force the user to provide a strong, unique token.

  token: ""

@github-actions github-actions bot force-pushed the upgrade/submariner-operator/0.22.1 branch 7 times, most recently from c9eb66c to ae2e013 Compare February 19, 2026 20:18
@github-actions github-actions bot force-pushed the upgrade/submariner-operator/0.22.1 branch from ae2e013 to 4cb0c43 Compare February 20, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants