diff --git a/go.mod b/go.mod index 853e76f252..6f758062dd 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/replicatedhq/embedded-cluster-kinds v1.3.10 - github.com/replicatedhq/kotskinds v0.0.0-20240617103853-2058b19a0c7c + github.com/replicatedhq/kotskinds v0.0.0-20240621084729-1eb1e3eac6f2 github.com/replicatedhq/kurlkinds v1.5.0 github.com/replicatedhq/troubleshoot v0.92.2 github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq diff --git a/go.sum b/go.sum index 245753f565..95f20d64b1 100644 --- a/go.sum +++ b/go.sum @@ -1310,8 +1310,8 @@ github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/replicatedhq/embedded-cluster-kinds v1.3.10 h1:nANfyym6NGwkdY9jVhRR4zClQT2YBskIjs60g+VfFfs= github.com/replicatedhq/embedded-cluster-kinds v1.3.10/go.mod h1:AwopUvvGcaWO4mn9DkbPj5RnLuOy756CNLrcaAlmjMo= -github.com/replicatedhq/kotskinds v0.0.0-20240617103853-2058b19a0c7c h1:CwPf225IhH7JAMQgwa9F5XYoaB6c21s4hla6jVCyAoc= -github.com/replicatedhq/kotskinds v0.0.0-20240617103853-2058b19a0c7c/go.mod h1:QjhIUu3+OmHZ09u09j3FCoTt8F3BYtQglS+OLmftu9I= +github.com/replicatedhq/kotskinds v0.0.0-20240621084729-1eb1e3eac6f2 h1:xL4u2RHhMaGDgz7Lol5MhVYLnWahV3sCJZbfebpPao0= +github.com/replicatedhq/kotskinds v0.0.0-20240621084729-1eb1e3eac6f2/go.mod h1:QjhIUu3+OmHZ09u09j3FCoTt8F3BYtQglS+OLmftu9I= github.com/replicatedhq/kurlkinds v1.5.0 h1:zZ0PKNeh4kXvSzVGkn62DKTo314GxhXg1TSB3azURMc= github.com/replicatedhq/kurlkinds v1.5.0/go.mod h1:rUpBMdC81IhmJNCWMU/uRsMETv9P0xFoMvdSP/TAr5A= github.com/replicatedhq/termui/v3 v3.1.1-0.20200811145416-f40076d26851 h1:eRlNDHxGfVkPCRXbA4BfQJvt5DHjFiTtWy3R/t4djyY= diff --git a/pkg/image/airgap.go b/pkg/image/airgap.go index 2a5b399ed7..f546e612ce 100644 --- a/pkg/image/airgap.go +++ b/pkg/image/airgap.go @@ -241,7 +241,6 @@ func PushECImagesFromTempRegistry(airgapRootDir string, airgap *kotsv1beta1.Airg defer wc.Close() } - totalImages := len(imageInfos) var imageCounter int for imageID, imageInfo := range imageInfos { srcRef, err := tempRegistry.SrcRef(imageID) @@ -288,7 +287,10 @@ func PushECImagesFromTempRegistry(airgapRootDir string, airgap *kotsv1beta1.Airg }, } imageCounter++ - fmt.Printf("Pushing embedded cluster images (%d/%d)\n", imageCounter, totalImages) + fmt.Printf( + "Pushing embedded cluster artifacts (%d/%d)\n", + imageCounter, airgap.Spec.EmbeddedClusterArtifacts.Total(), + ) if err := pushImage(pushImageOpts); err != nil { return errors.Wrapf(err, "failed to push image %s", imageID) } @@ -854,6 +856,11 @@ func PushEmbeddedClusterArtifacts(airgapBundle string, artifactsToPush *kotsv1be artifacts = append(artifacts, dstFilePath) } + var alreadyPushedArtifacts int + if artifactsToPush != nil { + alreadyPushedArtifacts = len(artifactsToPush.Registry.SavedImages) + } + for i, dstFilePath := range artifacts { ociArtifactPath := imageutil.NewEmbeddedClusterOCIArtifactPath(dstFilePath, imageutil.EmbeddedClusterArtifactOCIPathOptions{ RegistryHost: opts.Registry.Endpoint, @@ -878,7 +885,8 @@ func PushEmbeddedClusterArtifacts(airgapBundle string, artifactsToPush *kotsv1be HTTPClient: opts.HTTPClient, } - fmt.Printf("Pushing embedded cluster artifacts (%d/%d)\n", i+1, len(artifacts)) + currentArtifact := i + 1 + alreadyPushedArtifacts + fmt.Printf("Pushing embedded cluster artifacts (%d/%d)\n", currentArtifact, artifactsToPush.Total()) if err := pushOCIArtifact(pushOCIArtifactOpts); err != nil { return errors.Wrapf(err, "failed to push oci artifact %s", ociArtifactPath.Name) }