Skip to content

Commit

Permalink
adding error message (#626)
Browse files Browse the repository at this point in the history
* adding error message

Signed-off-by: Andrew Steurer <[email protected]>

* Apply suggestions from code review

---------

Signed-off-by: Andrew Steurer <[email protected]>
Co-authored-by: Itxaka <[email protected]>
  • Loading branch information
asteurer and Itxaka authored Dec 23, 2024
1 parent 71e8e5b commit 78c1090
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/config/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ func NewUpgradeSpec(cfg *Config) (*v1.UpgradeSpec, error) {
if err != nil {
return nil, fmt.Errorf("failed calculating size: %w", err)
}

if spec.Active.Source.IsDocker() {
cfg.Logger.Infof("Checking if OCI image %s exists", spec.Active.Source.Value())
_, err := crane.Manifest(spec.Active.Source.Value())
if err != nil {
if strings.Contains(err.Error(), "MANIFEST_UNKNOWN") {
return nil, fmt.Errorf("oci image %s does not exist", spec.Active.Source.Value())
}
return nil, err
}
}

return spec, nil
}

Expand Down

0 comments on commit 78c1090

Please sign in to comment.