LoadImageToKindCluster loads a local docker image to the kind cluster
(name string)
| 105 | |
| 106 | // LoadImageToKindCluster loads a local docker image to the kind cluster |
| 107 | func LoadImageToKindClusterWithName(name string) error { |
| 108 | cluster := "kind" |
| 109 | if v, ok := os.LookupEnv("KIND_CLUSTER"); ok { |
| 110 | cluster = v |
| 111 | } |
| 112 | kindOptions := []string{"load", "docker-image", name, "--name", cluster} |
| 113 | cmd := exec.Command("kind", kindOptions...) |
| 114 | _, err := Run(cmd) |
| 115 | return err |
| 116 | } |
| 117 | |
| 118 | // GetNonEmptyLines converts given command output string into individual objects |
| 119 | // according to line breakers, and ignores the empty elements in it. |