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

bug: support container image SHA256 version #1248

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

rollandf
Copy link
Member

@rollandf rollandf commented Jan 8, 2025

In OCP disconnected environment, the mirrored images are not using tags but SHA256.

This change support boths format in the NCP except for DOCA-Driver.

@coveralls
Copy link
Collaborator

coveralls commented Jan 8, 2025

Pull Request Test Coverage Report for Build 12883639910

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 60.74%

Files with Coverage Reduction New Missed Lines %
controllers/nicclusterpolicy_controller.go 3 79.08%
Totals Coverage Status
Change from base Build 12882709126: 0.2%
Covered Lines: 3351
Relevant Lines: 5517

💛 - Coveralls

@rollandf rollandf force-pushed the version-validation branch 2 times, most recently from bd84c13 to a981903 Compare January 8, 2025 20:30
@@ -103,6 +103,14 @@ func nindentPrefix(spaces int, prefix, v string) string {
return strings.Replace(nindent(spaces, prefix+v), " ", "", len(prefix))
}

// imagePath returns contaimer image path, supporting sha256 format
func imagePath(repository, image, version string) string {
Copy link
Collaborator

@e0ne e0ne Jan 15, 2025

Choose a reason for hiding this comment

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

Why do we need it as a template function instead of generating it in the code and pass the value into template? IMO, it makes templates more complicated without additional benefits

Copy link
Member Author

Choose a reason for hiding this comment

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

My thoughts that this way will require less changes.
In code, we will need for each state:

  • add a new field 'imagePath' to the ManifestRenderData
  • generate the value and add it in the ManifestRenderData
  • update the manifests to use the new 'imagePath'

I am OK to do the change if you prefer that way

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me to keep it as proposed now

e0ne
e0ne previously approved these changes Jan 15, 2025
@@ -103,6 +103,14 @@ func nindentPrefix(spaces int, prefix, v string) string {
return strings.Replace(nindent(spaces, prefix+v), " ", "", len(prefix))
}

// imagePath returns contaimer image path, supporting sha256 format
func imagePath(repository, image, version string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me to keep it as proposed now

almaslennikov
almaslennikov previously approved these changes Jan 15, 2025
@rollandf rollandf requested a review from adrianchiris January 20, 2025 07:51
adrianchiris
adrianchiris previously approved these changes Jan 21, 2025
@@ -103,6 +103,14 @@ func nindentPrefix(spaces int, prefix, v string) string {
return strings.Replace(nindent(spaces, prefix+v), " ", "", len(prefix))
}

// imagePath returns contaimer image path, supporting sha256 format
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: contaimer -> container :)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

In OCP disconnected environment, the mirrored images
are not using tags but SHA256.

This change support boths format in the NCP except for DOCA-Driver.

Signed-off-by: Fred Rolland <[email protected]>
@rollandf rollandf dismissed stale reviews from adrianchiris, almaslennikov, and e0ne via c12c6a7 January 21, 2025 09:12
@rollandf rollandf merged commit 3a57814 into Mellanox:master Jan 21, 2025
16 checks passed
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.

5 participants