Skip to content

Commit

Permalink
fix: remove redundant error check in push command
Browse files Browse the repository at this point in the history
Remove an unnecessary error check for configDesc creation in the push command.
The NewDescriptorFromBytes function does not return an error, so checking for
one was redundant and could never be triggered.

Signed-off-by: Ville Vesilehto <[email protected]>
thevilledev committed Jan 18, 2025
1 parent 5b3e926 commit 8b34fcb
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/commands/push.go
Original file line number Diff line number Diff line change
@@ -141,9 +141,6 @@ func pushBundle(ctx context.Context, repository, policyPath, dataPath string) (*

configBytes := []byte("{}")
configDesc := content.NewDescriptorFromBytes(oras.MediaTypeUnknownConfig, configBytes)
if err != nil {
return nil, fmt.Errorf("serializing manifest conifg: %w", err)
}

if err := dest.Push(ctx, configDesc, bytes.NewReader(configBytes)); err != nil && !errors.Is(err, errdef.ErrAlreadyExists) {
return nil, fmt.Errorf("pushing manifest conifg: %w", err)

0 comments on commit 8b34fcb

Please sign in to comment.