Problems with int32 conversion?

Aperta
#975 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
kubernetes, ruby
Ambito
cli, devops

Direzione di ricerca

Reproduce the failure with krane-3.6.0 using the Grafana Tanka JSON shown, then inspect the deployment path that generates the displayed YAML and converts value to "1e+06". Done means the generated PriorityClass preserves value as a Kubernetes-compatible integer and the deployment succeeds.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Ruby
Stelle
1.4k
Fork
119
Merge medio
1h 7m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Shopify/krane

Tutte le issue di Shopify/krane

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.