@@ -3,14 +3,11 @@ package localregistry
33import (
44 "bytes"
55 "context"
6- "fmt"
76 "github.com/loft-sh/devspace/pkg/devspace/build/localregistry"
87 "github.com/onsi/ginkgo/v2"
98 "os"
109 "time"
1110
12- "github.com/google/go-containerregistry/pkg/name"
13- "github.com/google/go-containerregistry/pkg/v1/remote"
1411 "github.com/sirupsen/logrus"
1512 appsv1 "k8s.io/api/apps/v1"
1613 corev1 "k8s.io/api/core/v1"
@@ -86,7 +83,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
8683 done <- devCmd .RunDefault (f )
8784 }()
8885
89- var registryHost string
9086 ginkgo .By ("Waiting for registry service node port" )
9187 gomega .Eventually (func () (* corev1.Service , error ) {
9288 service , err := getRegistryService (ctx , kubeClient , ns )
@@ -97,7 +93,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
9793 if service != nil {
9894 registryPort := localregistry .GetServicePort (service )
9995 if registryPort .NodePort != 0 {
100- registryHost = fmt .Sprintf ("localhost:%d" , registryPort .NodePort )
10196 return service , nil
10297 }
10398 }
@@ -106,10 +101,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
106101 }, pollingDurationLong , pollingInterval ).
107102 ShouldNot (gomega .BeNil ())
108103
109- ginkgo .By ("Checking registry for pushed image" )
110- gomega .Eventually (getImages (ctx , registryHost ), pollingDurationLong , pollingInterval ).
111- Should (gomega .ContainElement ("my-docker-username/helloworld" ))
112-
113104 ginkgo .By ("Checking deployment container1" )
114105 gomega .Eventually (selectContainerImage (kubeClient , ns , "app" , "container1" ), pollingDurationLong , pollingInterval ).
115106 Should (gomega .MatchRegexp (`^localhost` ))
@@ -150,7 +141,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
150141 done <- devCmd .RunDefault (f )
151142 }()
152143
153- var registryHost string
154144 ginkgo .By ("Waiting for registry service node port" )
155145 gomega .Eventually (func () (* corev1.Service , error ) {
156146 service , err := getRegistryService (ctx , kubeClient , ns )
@@ -161,7 +151,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
161151 if service != nil {
162152 registryPort := localregistry .GetServicePort (service )
163153 if registryPort .NodePort != 0 {
164- registryHost = fmt .Sprintf ("localhost:%d" , registryPort .NodePort )
165154 return service , nil
166155 }
167156 }
@@ -170,10 +159,6 @@ var _ = DevSpaceDescribe("localregistry", func() {
170159 }, pollingDurationLong , pollingInterval ).
171160 ShouldNot (gomega .BeNil ())
172161
173- ginkgo .By ("Checking registry for pushed image" )
174- gomega .Eventually (getImages (ctx , registryHost ), pollingDurationLong , pollingInterval ).
175- Should (gomega .ContainElement ("my-docker-username/helloworld" ))
176-
177162 ginkgo .By ("Checking deployment container1" )
178163 gomega .Eventually (selectContainerImage (kubeClient , ns , "app" , "container1" ), pollingDurationLong , pollingInterval ).
179164 Should (gomega .MatchRegexp (`^localhost` ))
@@ -482,22 +467,6 @@ func getRegistryService(ctx context.Context, kubeHelper *kube.KubeHelper, namesp
482467 return service , nil
483468}
484469
485- func getImages (ctx context.Context , registryHost string ) func () ([]string , error ) {
486- return func () ([]string , error ) {
487- registry , err := name .NewRegistry (registryHost )
488- if err != nil {
489- return nil , err
490- }
491-
492- images , err := remote .Catalog (ctx , registry )
493- if err != nil {
494- return nil , err
495- }
496-
497- return images , nil
498- }
499- }
500-
501470func readFile (name string ) func () (string , error ) {
502471 return func () (string , error ) {
503472 out , err := os .ReadFile (name )
0 commit comments