debug options
parent
74c1029d9f
commit
9af84a7d95
2
Makefile
2
Makefile
|
@ -693,7 +693,7 @@ upload-preloaded-images-tar: out/minikube out/upload-preload # Upload the preloa
|
||||||
|
|
||||||
.PHONY: generate-preloaded-images-tar
|
.PHONY: generate-preloaded-images-tar
|
||||||
generate-preloaded-images-tar: out/minikube out/upload-preload # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
|
generate-preloaded-images-tar: out/minikube out/upload-preload # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
|
||||||
./out/upload-preload --no-upload --force
|
./out/upload-preload --no-upload --force --limit 5
|
||||||
|
|
||||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||||
IMAGE = $(REGISTRY)/storage-provisioner
|
IMAGE = $(REGISTRY)/storage-provisioner
|
||||||
|
|
|
@ -46,6 +46,7 @@ var (
|
||||||
k8sVersion = flag.String("kubernetes-version", "", "desired Kubernetes version, for example `v1.17.2`")
|
k8sVersion = flag.String("kubernetes-version", "", "desired Kubernetes version, for example `v1.17.2`")
|
||||||
noUpload = flag.Bool("no-upload", false, "Do not upload tarballs to GCS")
|
noUpload = flag.Bool("no-upload", false, "Do not upload tarballs to GCS")
|
||||||
force = flag.Bool("force", false, "Generate the preload tarball even if it's already exists")
|
force = flag.Bool("force", false, "Generate the preload tarball even if it's already exists")
|
||||||
|
limit = flag.Int("limit", 0, "Limit the number of tarballs to generate")
|
||||||
)
|
)
|
||||||
|
|
||||||
type preloadCfg struct {
|
type preloadCfg struct {
|
||||||
|
@ -73,10 +74,17 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exit("Unable to get recent k8s versions: %v\n", err)
|
exit("Unable to get recent k8s versions: %v\n", err)
|
||||||
}
|
}
|
||||||
var toGenerate []preloadCfg
|
|
||||||
|
|
||||||
|
var toGenerate []preloadCfg
|
||||||
|
var i int
|
||||||
|
|
||||||
|
out:
|
||||||
for _, kv := range k8sVersions {
|
for _, kv := range k8sVersions {
|
||||||
for _, cr := range containerRuntimes {
|
for _, cr := range containerRuntimes {
|
||||||
|
if *limit > 0 && i >= *limit {
|
||||||
|
break out
|
||||||
|
}
|
||||||
|
i++
|
||||||
if *force || !download.PreloadExists(kv, cr) {
|
if *force || !download.PreloadExists(kv, cr) {
|
||||||
toGenerate = append(toGenerate, preloadCfg{kv, cr})
|
toGenerate = append(toGenerate, preloadCfg{kv, cr})
|
||||||
fmt.Printf("A preloaded tarball for k8s version %s - runtime %q already exists, skipping generation.\n", kv, cr)
|
fmt.Printf("A preloaded tarball for k8s version %s - runtime %q already exists, skipping generation.\n", kv, cr)
|
||||||
|
|
Loading…
Reference in New Issue