Skip to content

add optional token-vendor resources#665

Open
koonpeng wants to merge 8 commits intomainfrom
koonpeng/token-vendor-resources
Open

add optional token-vendor resources#665
koonpeng wants to merge 8 commits intomainfrom
koonpeng/token-vendor-resources

Conversation

@koonpeng
Copy link
Copy Markdown
Contributor

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.

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?

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>
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