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

chore(updatecli) fix UBI9 manifest #907

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

gounthar
Copy link
Contributor

@gounthar gounthar commented Nov 27, 2024

This is a follow-up PR to #906 by @dduportal.
I started from his work and altered the jq query.

Testing done

updatecli diff --debug --config ./updatecli/updatecli.d/rhel-ubi9.yaml --values ./updatecli/values.github-action.yaml 2>&1

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@gounthar gounthar requested a review from a team as a code owner November 27, 2024 16:31
dduportal
dduportal previously approved these changes Nov 27, 2024
Comment on lines 40 to 41
# Trim spaces
unique_tag=$(echo "$unique_tag" | xargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

same (non-blocking) suggestion as #906 (comment): simplify the script to pipe a trim on the unique result from the curl | jq command then only test if it's empty before exiting 0.

(reposting as the previous discussion has been automatically hidden)

Copy link
Contributor

@lemeurherveCB lemeurherveCB Nov 27, 2024

Choose a reason for hiding this comment

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

Then maybe your query can return multiple and duplicated tags in some cases? IDK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my query will return several tags, including 9.5 and 9.5-1731517889, which will appear multiple times in the output. This repetition is typical of the data we are handling:

 "tags": [
            {
              "added_date": "2024-11-13T18:11:46.455000+00:00",
              "name": "9.5",
              "_links": {
                "tag_history": {
                  "href": "/v1/tag-history/registry/registry.access.redhat.com/repository/ubi9/tag/9.5"
                }
              }
            },
            {
              "added_date": "2024-11-13T18:11:46.455000+00:00",
              "name": "9.5-1731517889",
              "_links": {
                "tag_history": {
                  "href": "/v1/tag-history/registry/registry.access.redhat.com/repository/ubi9/tag/9.5-1731517889"
                }
              }
            },
            {
              "added_date": "2024-11-13T18:11:46.455000+00:00",
              "name": "latest",
              "_links": {
                "tag_history": {
                  "href": "/v1/tag-history/registry/registry.access.redhat.com/repository/ubi9/tag/latest"
                }
              }
            }
          ],

Copy link
Contributor

Choose a reason for hiding this comment

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

though: can this query be more precise to return only the latest tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, I'm not sure how to proceed with that task. 🤷
Feel free to give it a try, as I'm not proficient with jq. 😉

Copy link
Contributor

@dduportal dduportal left a comment

Choose a reason for hiding this comment

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

Approving and merging to fix the failing builds. Feel free to open a PR proposing a better change or to revert if it breaks anything.

@dduportal dduportal merged commit dff7227 into jenkinsci:master Dec 2, 2024
10 checks passed
@gounthar
Copy link
Contributor Author

gounthar commented Dec 2, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants