Skip to content

Commit

Permalink
move images to organization repo (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
vassilismourikis authored Nov 24, 2023
1 parent b68744f commit babe7d0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion controllers/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var _ = Describe("WebServer controller", func() {
ApplicationName: "test-tomcat-demo",
Replicas: int32(2),
WebImage: &webserversv1alpha1.WebImageSpec{
ApplicationImage: "quay.io/jfclere/tomcat-demo",
ApplicationImage: "quay.io/web-servers/tomcat-demo",
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion controllers/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ func (r *WebServerReconciler) generateSelectorLabelsForWeb(webServer *webservers
}

// sortPodListByName sorts the pod list by number in the name
// expecting the format which the StatefulSet works with which is `<podname>-<number>`
//
// expecting the format which the StatefulSet works with which is `<podname>-<number>`
func (r *WebServerReconciler) sortPodListByName(podList *corev1.PodList) *corev1.PodList {
sort.SliceStable(podList.Items, func(i, j int) bool {
return podList.Items[i].ObjectMeta.Name < podList.Items[j].ObjectMeta.Name
Expand Down
2 changes: 1 addition & 1 deletion controllers/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = Describe("WebServer controller", func() {
ApplicationName: name,
Replicas: int32(2),
WebImage: &webserversv1alpha1.WebImageSpec{
ApplicationImage: "quay.io/jfclere/tomcat-demo",
ApplicationImage: "quay.io/web-servers/tomcat-demo",
},
},
}
Expand Down
12 changes: 6 additions & 6 deletions controllers/webServerApplicationImageBasic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ var _ = Describe("WebServer controller", func() {
thetest.Fatal(err)
}

Expect(webserverstests.WebServerApplicationImageSourcesScriptBasicTest(k8sClient, ctx, thetest, namespace, "sourcesscriptbasictest", "quay.io/jfclere/tomcat10:latest", "https://github.com/jfclere/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/jfclere/tomcat10-buildah", randemo)).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageSourcesScriptBasicTest(k8sClient, ctx, thetest, namespace, "sourcesscriptbasictest", "quay.io/web-servers/tomcat10:latest", "https://github.com/web-servers/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/web-servers/tomcat10-buildah", randemo)).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageBasicTest(k8sClient, ctx, thetest, namespace, "rhregistrybasictest", "registry.redhat.io/jboss-webserver-5/jws56-openjdk11-openshift-rhel8", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageBasicTest(k8sClient, ctx, thetest, namespace, "basictest", "quay.io/jfclere/tomcat10:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageScaleTest(k8sClient, ctx, thetest, namespace, "scaletest", "quay.io/jfclere/tomcat10:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageUpdateTest(k8sClient, ctx, thetest, namespace, "updatetest", "quay.io/jfclere/tomcat10:latest", "quay.io/vmouriki/tomcat10:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageSourcesBasicTest(k8sClient, ctx, thetest, namespace, "sourcesbasictest", "quay.io/jfclere/tomcat10:latest", "https://github.com/jfclere/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/jfclere/tomcat10-buildah", randemo)).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageSourcesScaleTest(k8sClient, ctx, thetest, namespace, "sourcesscaletest", "quay.io/jfclere/tomcat10:latest", "https://github.com/jfclere/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/jfclere/tomcat10-buildah", randemo)).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageBasicTest(k8sClient, ctx, thetest, namespace, "basictest", "quay.io/web-servers/tomcat10:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageScaleTest(k8sClient, ctx, thetest, namespace, "scaletest", "quay.io/web-servers/tomcat10:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageUpdateTest(k8sClient, ctx, thetest, namespace, "updatetest", "quay.io/web-servers/tomcat10:latest", "quay.io/web-servers/tomcat10update:latest", "/health")).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageSourcesBasicTest(k8sClient, ctx, thetest, namespace, "sourcesbasictest", "quay.io/web-servers/tomcat10:latest", "https://github.com/web-servers/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/web-servers/tomcat10-buildah", randemo)).Should(Succeed())
Expect(webserverstests.WebServerApplicationImageSourcesScaleTest(k8sClient, ctx, thetest, namespace, "sourcesscaletest", "quay.io/web-servers/tomcat10:latest", "https://github.com/web-servers/demo-webapp", "jakartaEE", "quay.io/"+username+"/test", "secretfortests", "quay.io/web-servers/tomcat10-buildah", randemo)).Should(Succeed())
isopenshift := webserverstests.WebServerHaveRoutes(k8sClient, ctx, thetest)
if isopenshift {

Expand Down
27 changes: 15 additions & 12 deletions test/framework/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

/* Result for the demo webapp
{
"counter": 2,
"id": "2244ED88EBC16E2956F63107405D7CC9",
"new": false,
"server": "10.129.2.169",
"hostname": "test-app-1-psvcz",
"newtest": "2020"
}
/*
Result for the demo webapp
{
"counter": 2,
"id": "2244ED88EBC16E2956F63107405D7CC9",
"new": false,
"server": "10.129.2.169",
"hostname": "test-app-1-psvcz",
"newtest": "2020"
}
*/
type DemoResult struct {
Counter int
Expand Down Expand Up @@ -168,7 +170,7 @@ func PrometheusTest(clt client.Client, ctx context.Context, t *testing.T, namesp
ApplicationName: "prometheus-test",
Replicas: int32(1),
WebImage: &webserversv1alpha1.WebImageSpec{
ApplicationImage: "quay.io/jfclere/tomcat-prometheus",
ApplicationImage: "quay.io/web-servers/tomcat-prometheus",
},
},
}
Expand Down Expand Up @@ -403,7 +405,7 @@ func HPATest(clt client.Client, ctx context.Context, t *testing.T, namespace str
ApplicationName: "hpa-test",
Replicas: int32(4),
WebImage: &webserversv1alpha1.WebImageSpec{
ApplicationImage: "quay.io/jfclere/tomcat-demo",
ApplicationImage: "quay.io/web-servers/tomcat-demo",
},
Resources: &corev1.ResourceRequirements{
Limits: corev1.ResourceList{
Expand Down Expand Up @@ -1205,7 +1207,8 @@ func isOperatorLocal() bool {
}

// generateLabelsForWebServer return a map of labels that are used for identification
// of objects belonging to the particular WebServer instance
//
// of objects belonging to the particular WebServer instance
func generateLabelsForWebServer(webServer *webserversv1alpha1.WebServer) map[string]string {
labels := map[string]string{
"deploymentConfig": webServer.Spec.ApplicationName,
Expand Down

0 comments on commit babe7d0

Please sign in to comment.