Skip to content

Commit

Permalink
simplify if statement to the context
Browse files Browse the repository at this point in the history
  • Loading branch information
prezha committed Nov 28, 2023
1 parent 1bb5b97 commit a5d281e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/minikube/cruntime/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ func (r *Containerd) Disable() error {
func (r *Containerd) ImageExists(name string, sha string) bool {
klog.Infof("Checking existence of image with name %q and sha %q", name, sha)
c := exec.Command("sudo", "ctr", "-n=k8s.io", "images", "check")
rr, err := r.Runner.RunCmd(c)
if err != nil ||
if rr, err := r.Runner.RunCmd(c); err != nil ||
!strings.Contains(rr.Output(), name) ||
(sha != "" && !strings.Contains(rr.Output(), sha)) {
return false
Expand Down

0 comments on commit a5d281e

Please sign in to comment.