BCDevOps / backup-container

A simple container for a simple backup strategy.
Apache License 2.0
42 stars 56 forks source link

feat: replace deprecated deploymentconfig by deployment #136

Closed RMCampos closed 1 month ago

RMCampos commented 1 month ago

What

Dropped DeploymentConfig adding Deployment.

Why

DeploymentConfig is now deprecated.

References

RMCampos commented 1 month ago

spec.template.spec.containers.image should be parameterized, currently image: "".

@WadeBarnes I didn't remove the image. If you or someone else provide some guidance, I can push a commit adding the image. As you can see, there was changes regarding the image name or parameter.

WadeBarnes commented 1 month ago

spec.template.spec.containers.image should be parameterized, currently image: "".

@WadeBarnes I didn't remove the image. If you or someone else provide some guidance, I can push a commit adding the image. As you can see, there was changes regarding the image name or parameter.

@RMCampos, I know you did not change anything with respect to the code I identified. In it's current state as a DeploymentConfig, it's relying on the fact that OpenShift will populate the the field with an image spec based on what's defined in the triggers section. As a Deployment you need to explicitly define the image spec.

You'll need to change it to something like:

image: ${IMAGE_NAMESPACE}${SOURCE_IMAGE_NAME}:${TAG_NAME}
DerekRoberts commented 1 month ago

@RMCampos Try:

image: "${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/${SOURCE_IMAGE_NAME}:${IMAGE_TAG}"

With revised params:

parameters:
  - name: IMAGE_REGISTRY
    description: Container image registry
    value: docker.io
  - name: IMAGE_NAMESPACE
    description: The namespace of the OpenShift project containing the imagestream for the application.
    value: bcgovimages
  - name: SOURCE_IMAGE_NAME
    description: The name of the image to use for this resource.  Use 'backup-{database name}' depending on your database provider
    value: backup-container
  - name: IMAGE_TAG
    displayName: 
    description: Image tag name, e.g. latest
    value: latest

It should end up similar to:

image: "docker.io/bcgovimages/backup-container:latest"
WadeBarnes commented 1 month ago

Thanks @DerekRoberts