Skip to content

panic on type conversion in context.ReplaceVariablesย #72

@jaypipes

Description

@jaypipes

Hit a panic in this code:

gdt/cmd/gdt on ๎‚  main [?] via ๐Ÿน v1.24.6 using โ˜๏ธ  default/sidar-personal-usage using โ˜๏ธ Chkk Research Team Subscription 
โžœ ./gdt run --debug /Users/abdul/Downloads/kk/repo/readiness-checks/guided/addons/prometheus-alertmanager/resource.health.yaml

loading scenario from file "/Users/abdul/Downloads/kk/repo/readiness-checks/guided/addons/prometheus-alertmanager/resource.health.yaml" ...
panic: interface conversion: interface {} is int64, not int

goroutine 147 [running]:
github.com/gdt-dev/core/context.ReplaceVariables({0x105cbd6c8?, 0x140007a5030?}, {0x14000042480, 0xc})
	/Users/abdul/go/pkg/mod/github.com/gdt-dev/core@v1.10.4/context/getter.go:132 +0x31c
github.com/gdt-dev/kube.(*Action).get(0x140000b2a20, {0x105cbd6c8, 0x140007a5030}, 0x14000483530, {0x1400027aab8, 0x5}, 0x14000053d00)
	/Users/abdul/go/pkg/mod/github.com/gdt-dev/kube@v1.10.3/action.go:126 +0x60
github.com/gdt-dev/kube.(*Action).Do(0x105cbd6c8?, {0x105cbd6c8?, 0x140007a5030?}, 0x1400027aab8?, {0x1400027aab8?, 0x1046819ec?}, 0x14000567cc8?)
	/Users/abdul/go/pkg/mod/github.com/gdt-dev/kube@v1.10.3/action.go:104 +0xb8
github.com/gdt-dev/kube.(*Spec).Eval(0x140000c2d80, {0x105cbd6c8, 0x140007a5030})
	/Users/abdul/go/pkg/mod/github.com/gdt-dev/kube@v1.10.3/eval.go:37 +0x1e8
github.com/gdt-dev/core/scenario.(*Scenario).execSpec(0x0?, {0x105cbd6c8, 0x140007a5030}, 0x140007a4fc0, 0x140002406c0, 0x0?, {0x105cbf320, 0x140000c2d80})
	/Users/abdul/go/pkg/mod/github.com/gdt-dev/core@v1.10.4/scenario/run.go:369 +0x3ac1

The test scenario definition looks like this:

  - name: discover alertmanager statefulset
    kube.get:
      type: statefulsets
      labels:
        app.kubernetes.io/name: alertmanager
    require:
      len: 1
    var:
      SS_NAME:
        from: $[0].metadata.name
      DESIRED_REPLICAS:
        from: $[0].spec.replicas

 - name: verify alertmanager statefulset ready
   kube.get: statefulsets/$$SS_NAME
   require:
     matches:
       status:
         readyReplicas: $$DESIRED_REPLICAS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions