Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag images with 'latest' and release tags #226

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Sep 2, 2024

This will help with generating the CSV file with the "latest" image SHAs

Here is how it will be used openshift-knative/serverless-operator#2826

@openshift-ci openshift-ci bot added the approved label Sep 2, 2024
@pierDipi pierDipi changed the title [WIP] Tag images with 'latest' and release tags Tag images with 'latest' and release tags Sep 2, 2024
Signed-off-by: Pierangelo Di Pilato <[email protected]>
@pierDipi
Copy link
Member Author

pierDipi commented Sep 2, 2024

/cc @creydr @mgencur @rudyredhat1

@@ -181,7 +181,9 @@ func Generate(cfg Config) error {
Nudges: append(cfg.Nudges, cfg.NudgesFunc(c.ReleaseBuildConfiguration, ib)...),
Pipeline: pipeline,
AdditionalTektonCELExpression: cfg.AdditionalTektonCELExpressionFunc(c.ReleaseBuildConfiguration, ib),
Tags: []string{"latest"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably miss something, but just to be sure here: as we use the same pipeline for on-push and on-pr, wouldn't we tag images from PRs also with latest?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the parameter is only added for push pipeline

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    {{{- if eq .Event "push" }}}
    - name: additional-tags
      value: [{{{ range $tag := .Tags }}} {{{ $tag }}}, {{{ end }}}]
    {{{- end }}}

Copy link
Member Author

@pierDipi pierDipi Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

spec:
  params:
    - name: dockerfile
      value: olm-catalog/serverless-operator/index/Dockerfile
    - name: git-url
      value: '{{source_url}}'
    - name: image-expires-after
      value: 5d
    - name: output-image
      value: quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-index:on-pr-{{revision}}
    - name: revision
      value: '{{revision}}'
  params:
    - name: dockerfile
      value: olm-catalog/serverless-operator/index/Dockerfile
    - name: git-url
      value: '{{source_url}}'
    - name: output-image
      value: quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-index:{{revision}}
    - name: revision
      value: '{{revision}}'
    - name: additional-tags
      value: [ latest, ]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're injecting parameters for the pipeline run and we have one pipeline run per event (push and PR separate)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice 👍

Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link

openshift-ci bot commented Sep 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit e9f6e14 into openshift-knative:main Sep 3, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants