From 8b34fcbe944eec3c433386980319e55bbe8ded07 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Sat, 18 Jan 2025 23:07:20 +0200 Subject: [PATCH] fix: remove redundant error check in push command 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 --- internal/commands/push.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/commands/push.go b/internal/commands/push.go index e84f126469..75a6841a90 100644 --- a/internal/commands/push.go +++ b/internal/commands/push.go @@ -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)