scaleway/scaleway-cli

Creating Kubernetes cluster fails

Closed this issue · 0 comments

Description:

I want my Kubernetes cluster to launch when I run my script.

How to reproduce:

The script :

`#!/bin/bash

scw k8s cluster create
type=kapsule
name="test"
description="Managed cluster for architectural and configs tests"
version=1.23.13
cni="cilium"
pools.0.name="pool-test-cluster"
pools.0.node-type="GP1-S"
pools.0.autoscaling="false"
pools.0.autohealing="false"
pools.0.size="3"
auto-upgrade.enable="false"
private-network-id="5f0abccb-a1b9-46eb-a9f9-1eea9c7fc108"
autoscaler-config.scale-down-disabled="true"
region="fr-par"
-p alban`

Command attempted

sh my_script.sh

Expected Behavior

Setup the cluster

Actual Behavior

runtime error: invalid memory address or nil pointer dereference
stacktrace from panic:
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x64
main.cleanup(0x140004cd110)
github.com/scaleway/scaleway-cli/v2/cmd/scw/main.go:42 +0xbc
panic({0x101b3d300, 0x102835230})
runtime/panic.go:884 +0x204
github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1.clusterCreateBuilder.func2({0x101d7bc20, 0x140002db0e0}, {0x101a62dc0?, 0x140004ca900})
github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1/custom_cluster.go:135 +0x134
github.com/scaleway/scaleway-cli/v2/internal/core.run.func1({0x101d7bc20?, 0x140002db0e0?}, {0x101a62dc0?, 0x140004ca900?})
github.com/scaleway/scaleway-cli/v2/internal/core/cobra_utils.go:156 +0x38
github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1.clusterCreateBuilder.func1({0x101d7bc20?, 0x140002db0e0?}, {0x101a62dc0?, 0x140004ca900?}, 0x14000727418?)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1/custom_cluster.go:107 +0x148
github.com/scaleway/scaleway-cli/v2/internal/core.combineCommandInterceptor.func1.1({0x101d7bc20?, 0x140002db0e0?}, {0x22?, 0x100?})
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:30 +0x38
github.com/scaleway/scaleway-cli/v2/internal/core.sdkStdTypeInterceptor({0x101d7bc20, 0x140002db0e0}, {0x101a62dc0?, 0x140004ca900?}, 0x140005cbc20?)
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:123 +0x34
github.com/scaleway/scaleway-cli/v2/internal/core.combineCommandInterceptor.func1.1({0x101d7bc20?, 0x140002db0e0?}, {0x101b21260?, 0x14000727528?})
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:30 +0x38
github.com/scaleway/scaleway-cli/v2/internal/core.sdkStdErrorInterceptor({0x101d7bc20?, 0x140002db0e0?}, {0x101a62dc0?, 0x140004ca900?}, 0x14000727748?)
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:39 +0x3c
github.com/scaleway/scaleway-cli/v2/internal/core.combineCommandInterceptor.func1({0x101d7bc20, 0x140002db0e0}, {0x101a62dc0?, 0x140004ca900?}, 0x140002db350)
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:29 +0xec
github.com/scaleway/scaleway-cli/v2/internal/core.combineCommandInterceptor.func1({0x101d7bc20, 0x140002db0e0}, {0x101a62dc0?, 0x140004ca900?}, 0x140004d96d0)
github.com/scaleway/scaleway-cli/v2/internal/core/command_interceptor.go:29 +0xec
github.com/scaleway/scaleway-cli/v2/internal/core.run({0x101d7bc20, 0x140002db0e0}, 0x14000502ea0?, 0x14000026500, {0x14000149600, 0xe, 0x10})
github.com/scaleway/scaleway-cli/v2/internal/core/cobra_utils.go:155 +0x218
github.com/scaleway/scaleway-cli/v2/internal/core.cobraRun.func1(0x1400036d800?, {0x14000149600, 0xe, 0x10})
github.com/scaleway/scaleway-cli/v2/internal/core/cobra_utils.go:46 +0x498
github.com/spf13/cobra.(*Command).execute(0x1400036d800, {0x14000149100, 0x10, 0x10})
github.com/spf13/cobra@v1.7.0/command.go:940 +0x5c8
github.com/spf13/cobra.(*Command).ExecuteC(0x14000470c00)
github.com/spf13/cobra@v1.7.0/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.7.0/command.go:992
github.com/scaleway/scaleway-cli/v2/internal/core.Bootstrap(0x14000727eb0)
github.com/scaleway/scaleway-cli/v2/internal/core/bootstrap.go:263 +0x1010
main.main()
github.com/scaleway/scaleway-cli/v2/cmd/scw/main.go:74 +0x364

runtime error: invalid memory address or nil pointer dereference%

More info

Maybe because my previous cluster, which was deleted about 1 hour ago, had the same name ?

[EDIT] When I remove the private-network argument, it works.

Version

Version 2.19.0
BuildDate unknown
GoVersion go1.20.6
GitBranch unknown
GitCommit unknown
GoArch arm64
GoOS darwin