Skip to content

Add extra_values param to app_chart#665

Merged
koonpeng merged 14 commits into
mainfrom
koonpeng/token-vendor-resources
May 19, 2026
Merged

Add extra_values param to app_chart#665
koonpeng merged 14 commits into
mainfrom
koonpeng/token-vendor-resources

Conversation

@koonpeng
Copy link
Copy Markdown
Contributor

@koonpeng koonpeng commented Apr 29, 2026

Not sure if this is a good way to implement it. iiuc token-vendor is using some base values.yaml (like deploy_environment). If I define values file in the app_chart it fails to render unless I copy and extend the base values.

Add extra_values param to app_chart. Unlike values which overrides the default values, extra_values append to it instead.

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
@koonpeng koonpeng requested a review from drigz April 29, 2026 09:14
- --key-store=KUBERNETES
- --namespace=app-token-vendor
{{- end }}
{{- if and .Values.token_vendor .Values.token_vendor.resources }}
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.

Are you saying that if you create values.yaml adjacent to BUILD and refer to it from this target then something breaks? Can you share the exact error? I'd expect that to work:

You might need to copy-paste

registry: "gcr.io/my-gcp-project"
for the default values? Or at least a subset like in this example: https://github.com/googlecloudrobotics/core/blob/270d1786d30af37814accd73ea27640013bb3884/src/app_charts/k8s-relay/values-cloud.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, like k8s-relay. This is the error if I do not copy the base values

INFO: Analyzed target //src/app_charts/token-vendor:token-vendor-cloud (698 packages loaded, 24751 targets configured).
INFO: From Action src/app_charts/token-vendor/token-vendor-cloud-0.0.1.tgz:
Error: 1 chart(s) linted, 1 chart(s) failed
==> Linting token-vendor-cloud
[ERROR] templates/: render error in "token-vendor-cloud/templates/token-vendor.yaml": template: token-vendor-cloud/templates/token-vendor.yaml:31:7: executing "token-vendor-cloud/templates/token-vendor.yaml" at <eq .Values.deploy_environment "GCP-testing">: error calling eq: incompatible types for comparison

INFO: Found 1 target...
Target //src/app_charts/token-vendor:token-vendor-cloud up-to-date:
  bazel-bin/src/app_charts/token-vendor/token-vendor-cloud-0.0.1.tgz
INFO: Elapsed time: 1.540s, Critical Path: 0.31s
INFO: 3 processes: 564 action cache hit, 1 internal, 2 linux-sandbox.
INFO: Build completed successfully, 3 total actions

bazel still thinks the build succeeded, but I don't think it actually succeeded.

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
@koonpeng koonpeng requested a review from drigz April 30, 2026 03:13
@koonpeng
Copy link
Copy Markdown
Contributor Author

koonpeng commented Apr 30, 2026

Added extra_values option in app_chart to append additional values on top of the base. This allows us to keep 1 SOT while having documentation by example.

…-resources

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Comment thread bazel/app_chart.bzl
name: string. Must be in the format {app}-{chart}, where chart is
robot, cloud, or cloud-per-robot.
values: file. The values.yaml file.
extra_values: list of files. Extra values files to append to values.yaml.
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.

TBH. I do not understand we we need 2 values files. If we need to, it should be crystal clear from the code how it would be used and why it is beneficial.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If a values file is not given, a default values file will be used. token-vendor use values in the default values file so if we want to add more values, we need to copy and extend the default. It's just a rare case that if we want to change the default, there is no longer any single SOT.

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.

I guess Stefan is asking for a cleanup that migrates the other charts to use extra_values. Otherwise people will have the same problem as before: if they copy-paste the example from k8s-relay to a chart that uses values that are not in k8s-relay's values-cloud.yaml, they'll get the same error you did.

Copy link
Copy Markdown
Contributor

@ensonic ensonic Apr 30, 2026

Choose a reason for hiding this comment

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

A cleanup can be in a followup, but I like to have more details on the bazel rule that explains the need.

Eg. when I look at https://github.com/googlecloudrobotics/core/tree/main/src/app_charts/token-vendor
it does not yet have any values.yaml at all.

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.

What is now the usecase for specifying values? If no rule is doing this anymore and everything is using extra_values, we can keep the attribute name to be called "values" and prepend the defaults?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These targets cannot be migrated to use extra_values because they override some base values.

values = "values-cloud.yaml",

values = "values.yaml",

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.

@koonpeng Please decouple the helm_chart change from the token-vendor change: Copy the full list of required values or the subset of required values to token-vendor/values.yaml, and if you still want to make the "create a new values.yaml" flow easier for future developers, create a new PR that adds extra_values.yaml (or just changes the docs to explain where to copy the base values from for full compatibility).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made another PR that cherry picked #672 the tv changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@drigz Now that #672 is merged, this PR should now be a refactor will no functionality changes.

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
@koonpeng koonpeng requested a review from ensonic April 30, 2026 08:52
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
…-resources

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
…-resources

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
@koonpeng koonpeng changed the title add optional token-vendor resources Add extra_values param to app_chart May 12, 2026
koonpeng added 2 commits May 14, 2026 13:16
…-resources

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Signed-off-by: Teo Koon Peng <koonpeng@google.com>
Copy link
Copy Markdown
Contributor

@drigz drigz left a comment

Choose a reason for hiding this comment

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

Thanks, seems like a safe improvement to me. Since I misunderstood @ensonic's comment before I'll defer approval to him.

Copy link
Copy Markdown
Contributor

@ensonic ensonic left a comment

Choose a reason for hiding this comment

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

If this works for all charts please merge. If it causes issues for some, please file a ticket, so that we can think about the required changes.

…-resources

Signed-off-by: Teo Koon Peng <koonpeng@google.com>
@koonpeng koonpeng merged commit 4d7f954 into main May 19, 2026
7 checks passed
@koonpeng koonpeng deleted the koonpeng/token-vendor-resources branch May 19, 2026 01:00
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.

3 participants