opendevstack / ods-jenkins-shared-library

Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
Apache License 2.0
72 stars 57 forks source link

ods-deployments file repeats image in mono repository setup #1011

Closed albertpuente closed 5 months ago

albertpuente commented 1 year ago

Describe the bug When using a single component with multiple images being built with odsComponentStageBuildOpenShiftImage() and deployed via Helm, the ods-deployments file does not properly reflect the names and hashes of the different images.

To Reproduce Steps to reproduce the behavior:

  1. Create a component with multiple images being built.
  2. Use helm as the tool to deploy such component by adding a chart.
  3. Deploy the comoponent to dev.

Expected behavior The ods-deployments.json file of the component should contain different images instead of repeating the first image.

Log Output (ensure to remove any confidential information like tokens, project names, etc. See excerpts below:

{
    "deployments": {
        "pid-backend": {
            "containers": {
                "backend": "pid-backend@sha256:786b248f3e783777f1ea6eb2243cba975ff28ed8ee7fd0fc7f951a463fbde242"
            },
            "deploymentMean": {
                "type": "helm",
                ...
            }
        },
        "pid-frontend": {
            "containers": {
                "backend": "pid-backend@sha256:786b248f3e783777f1ea6eb2243cba975ff28ed8ee7fd0fc7f951a463fbde242"
            },
            "deploymentMean": {
                "type": "helm",
                ...
            }
        },
        "pid-cache": {
            "containers": {
                "backend": "pid-backend@sha256:786b248f3e783777f1ea6eb2243cba975ff28ed8ee7fd0fc7f951a463fbde242"
            },
            "deploymentMean": {
                "type": "helm",
                ...
            }
        }
    },
    "CREATED_BY_BUILD": "0.1.2/1324"
}

Affected version (please complete the following information):

Additional context This problem was reported by @gerardcl.

metmajer commented 1 year ago

Hi @serverhorror, looks like we have a bug. Can you look into this?

serverhorror commented 1 year ago

@metmajer Sure thing! Who from the core dev team should I work with so you can better maintain this in the future?

metmajer commented 1 year ago

@serverhorror we have a good amount of topics to work on. We don't expect that many bugs come up from your integration, do we? Overall, ownership remains on you for the time being.

serverhorror commented 1 year ago

I think #1023, #1025 and #1026 might all be related.

@jafarre-bi, @jorge-romero, @hrcornejo -- can you provide feedback on this?

(I hope I pinged the right people).

serverhorror commented 1 year ago

I think https://github.com/opendevstack/ods-jenkins-shared-library/pull/1023, https://github.com/opendevstack/ods-jenkins-shared-library/issues/1025 and https://github.com/opendevstack/ods-jenkins-shared-library/pull/1026 might all be related.

@metmajer, @jafarre-bi, @jorge-romero, @hrcornejo -- can you provide feedback on this?