Percona Operator for MongoDB verison 1.23.1 upgrade issue

Description:

With an Openshift deployment of Percona Operator for MongoDB v 1.23.0 and the matching v1.23.0 psmdb-db helm chart. The operator was upgraded to v1.23.1.
So the crVersion is 1.23.0 in the helm chart.
The images in the psmdb-db chart were referencing the sha256 images in a private Red Hat Quay repository.
The initContainer image was not overriding what is in the chart which is commented out by default.
When the mongodb pod restarted an event/error occurred which stated that the image with tag 1.23.0 could not be parsed.

Failed to apply default image tag “registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256:1.23.0”: couldn’t parse image name “registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256:1.23.0”: invalid reference format

Previously no issue here with Operator v1.23.0.

Steps to Reproduce:

Percona Operator for MongoDB v1.23.0 upgraded to v1.23.1

Nothing yet done to Percona Server for Mongodb (psmdb-db) helm chart installation.

Mongodb Pod happens to restart, and the error as describes with the inicontainer image is encountered.

Version:

Operator 1.23.0 upgraded to 1.23.1
Helm chart psmdb-db chart version remaining on 1.23.0

Logs:

ailed to apply default image tag “registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256:1.23.0”: couldn’t parse image name “registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256:1.23.0”: invalid reference format

Expected Result:

Percona Operator for MongoDB upgraded from v1.23.0 to v1.23.1 with no issue
Percona Server for MongoDB (helm chart psmdb-db v1.23.0) continues to work as expected.

Actual Result:

MongoDB pods fail to start due to initContainer version issue.

Additional Information:

Openshift v 4.20

Hi @nick1,

Thanks for the report. I reproduced this and raised K8SPSMDB-1890.

Operator 1.23.0 to 1.23.1, with the psmdb-db chart left at 1.23.0, so crVersion stays 1.23.0. The operator builds mongo-init as:

registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256:1.23.0

That is not a valid image, so the pod stays in Init:InvalidImageName.

Set initImage in the psmdb-db values. The chart writes it as repository:tag, so split the digest across the two fields:

initImage:
  repository: registry.connect.redhat.com/percona/percona-server-mongodb-operator@sha256
  tag: <64-character checksum>

You can take it from the operator deployment:

kubectl get deploy -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.template.spec.containers[0].image}{"\n"}{end}' | grep percona-server-mongodb-operator

Put the part after @sha256: in tag.

If a pod is already Init:InvalidImageName, delete it after the change. The StatefulSet will not replace it on its own.

Let us know how it goes.