Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tk diff interpreting null as 0 resulting in error #897

Open
strowi opened this issue Aug 4, 2023 · 0 comments
Open

tk diff interpreting null as 0 resulting in error #897

strowi opened this issue Aug 4, 2023 · 0 comments
Labels
kind/bug Something isn't working

Comments

@strowi
Copy link
Contributor

strowi commented Aug 4, 2023

Hi,

i have included a helm chart in my tanka deployment where i need to remove the resources cpu limit. So i tried the following:

chart: helm.template(
        'victoriametrics', '../../charts/victoria-metrics-operator', {
          namespace: 'victoriametrics',
          values: {
            logLevel: 'error',
...
            resources: {
              limits: {
                cpu: null,
                memory: '320Mi',
              },
              requests: {
                cpu: '80m',
                memory: '120Mi',
              },
            },
...

While tk show and tk apply both seem to correctly result in:

...
    resources:
      limits:
        memory: 320Mi
      requests:
        cpu: 80m
        memory: 120Mi

a diff --diff-strategy validate --with-prune --summarize environment/xyz seems to incorrectly interpret null as 0:

~> tk diff --diff-strategy validate --with-prune --summarize environments/$DEPLOY_ENV
Warning: Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
{"level":"info","time":"2023-08-04T09:33:05Z","message":"Finding orphaned resources to prune"}
{"level":"info","time":"2023-08-04T09:33:06Z","message":"creating list of UIDs from known resources (those generated by the env)"}
{"level":"info","duration_ms":15877.509326,"count":116,"time":"2023-08-04T09:33:21Z","message":"done creating list of UIDs"}
{"level":"info","time":"2023-08-04T09:33:21Z","message":"fetching resources previously created by this env"}
{"level":"info","duration_ms":18319.49993,"count":164,"time":"2023-08-04T09:33:40Z","message":"done fetching previously created resources"}
Warning: Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
The Deployment "victoriametrics-victoria-metrics-operator" is invalid: spec.template.spec.containers[0].resources.requests: Invalid value: "80m": must be less than or equal to cpu limit of 0
Error: exit status 2
@zerok zerok added the kind/bug Something isn't working label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants