Commit 1f57518e authored by Christopher Harm's avatar Christopher Harm

Removing the sha1sum requirement for kind provider

parent 37ffb957
Pipeline #89199 passed with stages
in 1 minute
......@@ -58,7 +58,6 @@ kind:
workers: 2
k8s:
version: v1.15.7
sha1sum: e2df133f80ef633c53c0200114fce2ed5e1f6947477dbc83261a6a921169488d
build:
skipCompile: false
runTests: true
......
......@@ -45,10 +45,10 @@ const (
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:%s@sha256:%s
image: kindest/node:%s
`
kindConfigWorkerTemplate = `- role: worker
image: kindest/node:%s@sha256:%s
image: kindest/node:%s
`
)
......@@ -88,12 +88,6 @@ func init() {
panic("invalid arg")
}
startCmd.PersistentFlags().StringP("kind-k8s-sha1sum", "", "", "kubernetes sha1sum for kind")
err = viper.BindPFlag("kind.k8s.sha1sum", startCmd.PersistentFlags().Lookup("kind-k8s-sha1sum"))
if err != nil {
panic("invalid arg")
}
startCmd.PersistentFlags().StringP("kind-name", "n", "", "kind cluster name")
viper.SetDefault("kind.name", "devtool")
err = viper.BindPFlag("kind.name", startCmd.PersistentFlags().Lookup("kind-name"))
......@@ -163,19 +157,18 @@ func start() {
if !kindRunning() {
k8sVersion := viper.GetString("kind.k8s.version") //"v1.15.7"
k8sSha1sum := viper.GetString("kind.k8s.sha1sum") //"e2df133f80ef633c53c0200114fce2ed5e1f6947477dbc83261a6a921169488d"
args := []string{"create", "cluster", "--name", clusterName}
if k8sVersion != "" && k8sSha1sum != "" {
if k8sVersion != "" {
file, err := ioutil.TempFile("/tmp", "devtool")
if err != nil {
log.Fatal(err)
}
defer os.Remove(file.Name())
config := fmt.Sprintf(kindConfigTemplate, k8sVersion, k8sSha1sum)
config := fmt.Sprintf(kindConfigTemplate, k8sVersion)
for i := 0; i < viper.GetInt("kind.workers"); i++ {
config += fmt.Sprintf(kindConfigWorkerTemplate, k8sVersion, k8sSha1sum)
config += fmt.Sprintf(kindConfigWorkerTemplate, k8sVersion)
}
_, err = file.WriteString(config)
if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment