Repository: openshift/assisted-service (language: python)

Issue:
NO-ISSUE: rename docker image for postgres 12 as latest tag disappeared
```$ podman pull quay.io/centos7/postgresql-12-centos7:latest
Trying to pull quay.io/centos7/postgresql-12-centos7:latest...
WARN[0001] Failed, retrying in 1s ... (1/3). Error: initializing source docker://quay.io/centos7/postgresql-12-centos7:latest: reading manifest latest in quay.io/centos7/postgresql-12-centos7: unknown: Tag latest was deleted or has expired. To pull, revive via time machine
WARN[0003] Failed, retrying in 1s ... (2/3). Error: initializing source docker://quay.io/centos7/postgresql-12-centos7:latest: reading manifest latest in quay.io/centos7/postgresql-12-centos7: unknown: Tag latest was deleted or has expired. To pull, revive via time machine
WARN[0006] Failed, retrying in 1s ... (3/3). Error: initializing source docker://quay.io/centos7/postgresql-12-centos7:latest: reading manifest latest in quay.io/centos7/postgresql-12-centos7: unknown: Tag latest was deleted or has expired. To pull, revive via time machine
Error: initializing source docker://quay.io/centos7/postgresql-12-centos7:latest: reading manifest latest in quay.io/centos7/postgresql-12-centos7: unknown: Tag latest was deleted or has expired. To pull, revive via time machine
```
```$ podman pull quay.io/sclorg/postgresql-12-c8s:latest
Trying to pull quay.io/sclorg/postgresql-12-c8s:latest...
Getting image source signatures
Copying blob 0c2ad7c16e40 done   |
Copying blob 9516588f908c skipped: already exists
Copying blob e9d33304e2e9 done   |
Copying config 1dc9bf4b68 done   |
Writing manifest to image destination
1dc9bf4b68aee4972b5f39a7f2f3797dfd1a895c1a7c1b50c65d7e095aa6bd4b
```
https://quay.io/repository/centos7/postgresql-12-centos7?tab=tags&tag=latest
<!--
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

You can refer to [Kubernetes community documentation] on writing good commit messages, which provides good tips and ideas.

Some PRs address specific issues. Please, refer to the [CONTRIBUTING] documentation for more
information on how to link a PR to an existing issue.

It's recommended to take a few extra minutes to provide more information about
how this code was tested. Here are some questions that may be worth answering:

- Should this PR be tested by the reviewer?
- Is this PR relying on CI for an e2e test run?
- Should this PR be tested in a specific environment?
- Any logs, screenshots, etc that can help with the review process?

-->

## List all the issues related to this PR

- [ ] New Feature <!-- new functionality -->
- [ ] Enhancement <!-- refactor, code changes, improvement, that won't add new features -->
- [ ] Bug fix
- [ ] Tests
- [ ] Documentation
- [ ] CI/CD <!-- Notice that changes for Dockerfiles/Jenkinsfiles aren't tested in CI due to a known bug. -->

## What environments does this code impact?

- [ ] Automation (CI, tools, etc)
- [ ] Cloud
- [ ] Operator Managed Deployments
- [x] None

## How was this code tested?

<!-- Please, select one or more if needed: -->

- [ ] assisted-test-infra environment
- [ ] dev-scripts environment
- [ ] Reviewer's test appreciated
- [ ] Waiting for CI to do a full test run
- [ ] Manual (Elaborate on how it was tested)
- [x] No tests needed

## Checklist

- [ ] Title and description added to both, commit and PR.
- [ ] Relevant issues have been associated (see [CONTRIBUTING] guide)
- [ ] This change does not require a documentation update (docstring, `docs`, README, etc)
- [ ] Does this change include unit-tests (note that code changes require unit-tests)

## Reviewers Checklist

- Are the title and description (in both PR and commit) meaningful and clear?
- Is there a bug required (and linked) for this change?
- Should this PR be backported?

[Kubernetes community documentation]: https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#commit-message-guidelines
[CONTRIBUTING]: https://github.com/openshift/assisted-service/blob/master/CONTRIBUTING.md



Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index 5917142b3e1..1b51773911c 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ DEBUG_SERVICE_PORT := $(or ${DEBUG_SERVICE_PORT},40000)
 SERVICE := $(or ${SERVICE},${ASSISTED_ORG}/assisted-service:${ASSISTED_TAG})
 IMAGE_SERVICE := $(or ${IMAGE_SERVICE},${ASSISTED_ORG}/assisted-image-service:${ASSISTED_TAG})
 ASSISTED_UI := $(or ${ASSISTED_UI},${ASSISTED_ORG}/assisted-installer-ui:${ASSISTED_TAG})
-PSQL_IMAGE := $(or ${PSQL_IMAGE},quay.io/centos7/postgresql-12-centos7:latest)
+PSQL_IMAGE := $(or ${PSQL_IMAGE},quay.io/sclorg/postgresql-12-c8s:latest)
 BUNDLE_IMAGE := $(or ${BUNDLE_IMAGE},${ASSISTED_ORG}/assisted-service-operator-bundle:${ASSISTED_TAG})
 INDEX_IMAGE := $(or ${INDEX_IMAGE},${ASSISTED_ORG}/assisted-service-index:${ASSISTED_TAG})
 
diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml
index 546dcb409eb..d6c7e96eab0 100644
--- a/config/manager/manager.yaml
+++ b/config/manager/manager.yaml
@@ -35,7 +35,7 @@ spec:
           - name: IMAGE_SERVICE_IMAGE
             value: quay.io/edge-infrastructure/assisted-image-service:latest
           - name: DATABASE_IMAGE
-            value: quay.io/centos7/postgresql-12-centos7:latest
+            value: quay.io/sclorg/postgresql-12-c8s:latest
           - name: AGENT_IMAGE
             value: quay.io/edge-infrastructure/assisted-installer-agent:latest
           - name: CONTROLLER_IMAGE
diff --git a/config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml b/config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml
index 5ff09f6b5f8..4a502dd83e2 100644
--- a/config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml
+++ b/config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml
@@ -158,7 +158,7 @@ spec:
     name: controller
   - image: quay.io/edge-infrastructure/assisted-image-service:latest
     name: image-service
-  - image: quay.io/centos7/postgresql-12-centos7:latest
+  - image: quay.io/sclorg/postgresql-12-c8s:latest
     name: postgresql
   - image: quay.io/edge-infrastructure/assisted-installer:latest
     name: installer
diff --git a/deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml b/deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml
index 4b66a7f0915..cd3491972e3 100644
--- a/deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml
+++ b/deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml
@@ -981,7 +981,7 @@ spec:
                 - name: IMAGE_SERVICE_IMAGE
                   value: quay.io/edge-infrastructure/assisted-image-service:latest
                 - name: DATABASE_IMAGE
-                  value: quay.io/centos7/postgresql-12-centos7:latest
+                  value: quay.io/sclorg/postgresql-12-c8s:latest
                 - name: AGENT_IMAGE
                   value: quay.io/edge-infrastructure/assisted-installer-agent:latest
                 - name: CONTROLLER_IMAGE
@@ -1119,7 +1119,7 @@ spec:
     name: controller
   - image: quay.io/edge-infrastructure/assisted-image-service:latest
     name: image-service
-  - image: quay.io/centos7/postgresql-12-centos7:latest
+  - image: quay.io/sclorg/postgresql-12-c8s:latest
     name: postgresql
   - image: quay.io/edge-infrastructure/assisted-installer:latest
     name: installer
diff --git a/deploy/podman/pod-persistent-disconnected.yml b/deploy/podman/pod-persistent-disconnected.yml
index dd46150e07d..f5d69b6b57b 100644
--- a/deploy/podman/pod-persistent-disconnected.yml
+++ b/deploy/podman/pod-persistent-disconnected.yml
@@ -8,7 +8,7 @@ spec:
   containers:
   - args:
     - run-postgresql
-    image: quay.io/centos7/postgresql-12-centos7:latest
+    image: quay.io/sclorg/postgresql-12-c8s:latest
     name: db
     envFrom:
     - configMapRef:
diff --git a/deploy/podman/pod-persistent.yml b/deploy/podman/pod-persistent.yml
index a89f28f5373..d28eeab9f92 100644
--- a/deploy/podman/pod-persistent.yml
+++ b/deploy/podman/pod-persistent.yml
@@ -8,7 +8,7 @@ spec:
   containers:
   - args:
     - run-postgresql
-    image: quay.io/centos7/postgresql-12-centos7:latest
+    image: quay.io/sclorg/postgresql-12-c8s:latest
     name: db
     envFrom:
     - configMapRef:
diff --git a/deploy/podman/pod.yml b/deploy/podman/pod.yml
index ea6ae03b432..b965182e75e 100644
--- a/deploy/podman/pod.yml
+++ b/deploy/podman/pod.yml
@@ -8,7 +8,7 @@ spec:
   containers:
   - args:
     - run-postgresql
-    image: quay.io/centos7/postgresql-12-centos7:latest
+    image: quay.io/sclorg/postgresql-12-c8s:latest
     name: db
     envFrom:
     - configMapRef:
diff --git a/deploy/podman/pod_tls.yml b/deploy/podman/pod_tls.yml
index be42a335a65..da716412ddf 100644
--- a/deploy/podman/pod_tls.yml
+++ b/deploy/podman/pod_tls.yml
@@ -8,7 +8,7 @@ spec:
   containers:
     - args:
         - run-postgresql
-      image: quay.io/centos7/postgresql-12-centos7:latest
+      image: quay.io/sclorg/postgresql-12-c8s:latest
       name: db
       envFrom:
         - configMapRef:
diff --git a/deploy/postgres/postgres-deployment-ephemeral.yaml b/deploy/postgres/postgres-deployment-ephemeral.yaml
index 942c693102d..f881af55a13 100644
--- a/deploy/postgres/postgres-deployment-ephemeral.yaml
+++ b/deploy/postgres/postgres-deployment-ephemeral.yaml
@@ -15,7 +15,7 @@ spec:
     spec:
       containers:
         - name: postgres
-          image: quay.io/centos7/postgresql-12-centos7
+          image: quay.io/sclorg/postgresql-12-c8s
           imagePullPolicy: "IfNotPresent"
           ports:
             - containerPort: 5432
diff --git a/deploy/postgres/postgres-deployment.yaml b/deploy/postgres/postgres-deployment.yaml
index b9952e6bc51..8d5ee14d6ea 100644
--- a/deploy/postgres/postgres-deployment.yaml
+++ b/deploy/postgres/postgres-deployment.yaml
@@ -15,7 +15,7 @@ spec:
     spec:
       containers:
         - name: postgres
-          image: quay.io/centos7/postgresql-12-centos7
+          image: quay.io/sclorg/postgresql-12-c8s
           imagePullPolicy: "IfNotPresent"
           ports:
             - containerPort: 5432
diff --git a/internal/controller/controllers/images.go b/internal/controller/controllers/images.go
index 88f716b16ba..30e219a265e 100644
--- a/internal/controller/controllers/images.go
+++ b/internal/controller/controllers/images.go
@@ -33,7 +33,7 @@ func ImageServiceImage() string {
 }
 
 func DatabaseImage() string {
-	return getEnvVar("DATABASE_IMAGE", "quay.io/centos7/postgresql-12-centos7:latest")
+	return getEnvVar("DATABASE_IMAGE", "quay.io/sclorg/postgresql-12-c8s:latest")
 }
 
 func AgentImage() string {


Test patch:
diff --git a/docs/dev/testing.md b/docs/dev/testing.md
index 18774ef18c8..c182101d190 100644
--- a/docs/dev/testing.md
+++ b/docs/dev/testing.md
@@ -4,7 +4,7 @@ The assisted-installer tests are divided into 3 categories:
 
 * **Unit tests** - Focused on a module/function level while other modules are mocked.
 Unit tests are located in the package, where the code they are testing resides, using the pattern `<module_name>_test.go`.
-Unit tests needs a postgresql db container. The image for db container `quay.io/centos7/postgresql-12-centos7:latest` is built from `https://github.com/sclorg/postgresql-container`
+Unit tests needs a postgresql db container. The image for db container `quay.io/sclorg/postgresql-12-c8s:latest` is built from `https://github.com/sclorg/postgresql-container`
 
 * **Subsystem tests** - Focused on the component while mocking other component.
 For example, assisted-service subsystem tests mock the agent responses.
diff --git a/internal/common/common_unitest_db.go b/internal/common/common_unitest_db.go
index a59ade706d8..74fadcf03c2 100644
--- a/internal/common/common_unitest_db.go
+++ b/internal/common/common_unitest_db.go
@@ -131,7 +131,7 @@ func (c *K8SDBContext) Create() error {
 					Containers: []corev1.Container{
 						{
 							Name:  "psql",
-							Image: "quay.io/centos7/postgresql-12-centos7",
+							Image: "quay.io/sclorg/postgresql-12-c8s",
 							Ports: []corev1.ContainerPort{
 								{
 									Name:          "tcp-5432",
diff --git a/internal/common/testcontainers_db_context.go b/internal/common/testcontainers_db_context.go
index 00d4a75b329..25f899a6555 100644
--- a/internal/common/testcontainers_db_context.go
+++ b/internal/common/testcontainers_db_context.go
@@ -20,7 +20,7 @@ func (c *TestContainersDBContext) Create() error {
 	var err error
 	c.dbContainer, err = testcontainers.GenericContainer(c.ctx, testcontainers.GenericContainerRequest{
 		ContainerRequest: testcontainers.ContainerRequest{
-			Image:        "quay.io/centos7/postgresql-12-centos7:latest",
+			Image:        "quay.io/sclorg/postgresql-12-c8s:latest",
 			Env:          map[string]string{"POSTGRESQL_ADMIN_PASSWORD": "admin"},
 			ExposedPorts: []string{fmt.Sprintf("%s/tcp", dbDefaultPort)},
 			Name:         dbDockerName,