Skip to content

Instantly share code, notes, and snippets.

@mikouaj
Created April 7, 2022 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikouaj/cf1df1fa33a9d3638d9cfbfa5283fb4c to your computer and use it in GitHub Desktop.
Save mikouaj/cf1df1fa33a9d3638d9cfbfa5283fb4c to your computer and use it in GitHub Desktop.
gke-policy-automation panic on two clusters in a config
mstefaniak@mac~/devel/github/gke-policy-automation % ./gke-policy cluster review -c config.yaml
Reading policy files... [local directory: ./gke-policies]
Parsing REGO policies...
Fetching GKE cluster details... [projects/XXX/locations/europe-west2-a/clusters/public-zonal]
Evaluating policies against GKE cluster... [82e6fc61ea254dcc910504089b03e12c42d8f3e37ef246f1bab3ec88bd215120]
Fetching GKE cluster details... [projects/XXX/locations/europe-central2/clusters/private-regional-nochannel]
Evaluating policies against GKE cluster... [369825f81b3b43b688180a9d24791a8cfe86f3f6c5f84832ae88e8bc8a81f926]
GKE Cluster [projects/XXX/locations/europe-west2-a/clusters/public-zonal]:
Group "Security":
[✓] Enrollment in Release Channels: GKE cluster should be enrolled in release channels
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/google/gke-policy-automation/internal/app.(*PolicyAutomationApp).printEvaluationResults(0xc0004afa10, {0xc0007a5140, 0x2, 0xc00068f860})
/Users/mstefaniak/devel/github/gke-policy-automation/internal/app/app.go:206 +0x51f
github.com/google/gke-policy-automation/internal/app.(*PolicyAutomationApp).ClusterReview(0xc0004afa10)
/Users/mstefaniak/devel/github/gke-policy-automation/internal/app/app.go:125 +0x265
github.com/google/gke-policy-automation/internal/app.CreateClusterCommand.func1(0xc0004c4900)
/Users/mstefaniak/devel/github/gke-policy-automation/internal/app/cli.go:90 +0xec
github.com/urfave/cli/v2.(*Command).Run(0xc0004c4900, 0xc0004cc440)
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc0004be4e0, 0xc0004cc380)
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:434 +0x9a6
github.com/urfave/cli/v2.(*Command).startApp(0xc0004c47e0, 0xc0004cc380)
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/command.go:280 +0x76f
github.com/urfave/cli/v2.(*Command).Run(0xc0004b53b0, 0x7ff7bfeff935)
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/command.go:94 +0x7bc
github.com/urfave/cli/v2.(*App).RunContext(0xc0004be340, {0x1c39140, 0xc0001aa008}, {0xc0001ae000, 0x5, 0x5})
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:313 +0x81e
github.com/urfave/cli/v2.(*App).Run(...)
/Users/mstefaniak/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:224
main.main()
/Users/mstefaniak/devel/github/gke-policy-automation/main.go:25 +0x125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment