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

Problems with int32 conversion? #975

Open
strowi opened this issue Feb 17, 2025 · 0 comments
Open

Problems with int32 conversion? #975

strowi opened this issue Feb 17, 2025 · 0 comments

Comments

@strowi
Copy link
Contributor

strowi commented Feb 17, 2025

Hi,

running krane-3.6.0 i ran into the following issue:

Using grafana/tanka i get the following json to apply to k8s-1.30.

...
      "priority_class_postgres_operator_pod": {
        "apiVersion": "scheduling.k8s.io/v1",
        "description": "Use only for databases controlled by Postgres operator",
        "globalDefault": false,
        "kind": "PriorityClass",
        "metadata": {
          "labels": {
            "app.kubernetes.io/instance": "postgres-operator",
            "app.kubernetes.io/managed-by": "Helmraiser",
            "app.kubernetes.io/name": "postgres-operator",
            "helm.sh/chart": "postgres-operator-1.14.0"
          },
          "name": "postgres-operator-pod",
          "namespace": "app"
        },
        "preemptionPolicy": "PreemptLowerPriority",
        "value": 1000000
      },
...

But deploying with krane fails with the following error:

[FATAL][2025-02-17 12:00:50 +0000]	Invalid template: PriorityClass-postgres-operator-pod20250217-589-k00em4.yml
[FATAL][2025-02-17 12:00:50 +0000]	> Error message:
[FATAL][2025-02-17 12:00:50 +0000]	    Error from server (BadRequest): error when creating "/tmp/d20250217-589-vzxhvs/PriorityClass-postgres-operator-pod20250217-589-k00em4.yml": PriorityClass in version "v1" cannot be handled as a PriorityClass: json: cannot unmarshal string into Go struct field PriorityClass.value of type int32
[FATAL][2025-02-17 12:00:50 +0000]	> Template content:
[FATAL][2025-02-17 12:00:50 +0000]	    ---
[FATAL][2025-02-17 12:00:50 +0000]	    apiVersion: scheduling.k8s.io/v1
[FATAL][2025-02-17 12:00:50 +0000]	    description: Use only for databases controlled by Postgres operator
[FATAL][2025-02-17 12:00:50 +0000]	    globalDefault: false
[FATAL][2025-02-17 12:00:50 +0000]	    kind: PriorityClass
[FATAL][2025-02-17 12:00:50 +0000]	    metadata:
[FATAL][2025-02-17 12:00:50 +0000]	      labels:
[FATAL][2025-02-17 12:00:50 +0000]	        app.kubernetes.io/instance: postgres-operator
[FATAL][2025-02-17 12:00:50 +0000]	        app.kubernetes.io/managed-by: Helmraiser
[FATAL][2025-02-17 12:00:50 +0000]	        app.kubernetes.io/name: postgres-operator
[FATAL][2025-02-17 12:00:50 +0000]	        helm.sh/chart: postgres-operator-1.14.0
[FATAL][2025-02-17 12:00:50 +0000]	        tanka.dev/environment: 809e5090a4bc8f682ecfaf6007b78d885458f3576feecf7a
[FATAL][2025-02-17 12:00:50 +0000]	      name: postgres-operator-pod
[FATAL][2025-02-17 12:00:50 +0000]	      namespace: app
[FATAL][2025-02-17 12:00:50 +0000]	    preemptionPolicy: PreemptLowerPriority
[FATAL][2025-02-17 12:00:50 +0000]	    value: "1e+06"

Which looks to me like krane is converting the 10000 to a string "1e+06" which kubernetes doesn't like?

regards,
strowi

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

No branches or pull requests

1 participant