Merged
Conversation
This was referenced May 11, 2025
7e9a34e to
2eb0fd6
Compare
2eb0fd6 to
c7c68f1
Compare
bhanurp
requested changes
May 22, 2025
Comment on lines
+139
to
+142
| if err != nil || buildInfoModule == nil { | ||
| return err | ||
| } |
Collaborator
There was a problem hiding this comment.
handle both err and buildInfoModule conditions separately
if err != nil {
return errorutils.CheckError(fmt.Errorf("failed to build module info: %w", err))
}
if buildInfoModule == nil {
return errorutils.CheckErrorf("build info module is nil")
}
| if pc.IsValidateSha() { | ||
| log.Info("Performing SHA-based validation for Docker push...") | ||
| // Get image SHA from the container manager | ||
| imageSha2, err := cm.Id(pc.image) |
Collaborator
There was a problem hiding this comment.
Suggested change
| imageSha2, err := cm.Id(pc.image) | |
| imageSha256, err := cm.Id(pc.image) |
is it imageSHA256 ?
| return err | ||
| } | ||
| if err = build.SaveBuildInfo(buildName, buildNumber, pc.BuildConfiguration().GetProject(), buildInfoModule); err != nil { | ||
| return err |
Collaborator
There was a problem hiding this comment.
Suggested change
| return err | |
| return errorutils.CheckError(fmt.Errorf("failed to save build info: %w", err)) |
Comment on lines
+150
to
+156
| _, err = remoteBuilder.Build("") | ||
| if err != nil { | ||
| return err | ||
| } |
Collaborator
There was a problem hiding this comment.
Suggested change
| _, err = remoteBuilder.Build("") | |
| if err != nil { | |
| return err | |
| } | |
| if _, err = remoteBuilder.Build(""); err != nil { | |
| return errorutils.CheckError(fmt.Errorf("failed to build summary info: %w", err)) | |
| } |
nit picking
|
|
||
| // Docker specific commands flags | ||
| skipLogin: components.NewBoolFlag(skipLogin, "[Default: false] Set to true if you'd like the command to skip performing docker login.", components.WithBoolDefaultValueFalse()), | ||
| validateSha: components.NewBoolFlag(validateSha, "[Default: false] Set to true to enable SHA validation during Docker push.", components.WithBoolDefaultValueFalse()), |
Collaborator
There was a problem hiding this comment.
flag documentation has to be updated in jfrog/jfrog-documentation?
Collaborator
Author
There was a problem hiding this comment.
Yes, will add this there as well.
Collaborator
Author
There was a problem hiding this comment.
de829b9 to
342dbcf
Compare
…e-file" This reverts commit 51678d2.
08d064f to
1e1af0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
--validate-shaflag for Docker push commandDescription
This PR adds support for the new
--validate-shaflag to the Docker push command. When enabled, the flag allows the CLI to use the image's SHA digest for validation instead of the tag name during Docker push operations. This is particularly useful when pushing to virtual repositories where the tag might exist with different content in higher priority repositories.Changes
cliutils/flagkit/flags.gocommands/container/containermanagerbase.goto add validateSha field and methodscommands/container/push.goto implement the SHA-based validation logicTesting
Related PRs