diff --git a/pkg/cmd/repo_list.go b/pkg/cmd/repo_list.go index 5b6113a13..71324dc85 100644 --- a/pkg/cmd/repo_list.go +++ b/pkg/cmd/repo_list.go @@ -39,7 +39,7 @@ func newRepoListCmd(out io.Writer) *cobra.Command { ValidArgsFunction: noMoreArgsCompFunc, RunE: func(_ *cobra.Command, _ []string) error { f, _ := repo.LoadFile(settings.RepositoryConfig) - if len(f.Repositories) == 0 && !(outfmt == output.JSON || outfmt == output.YAML) { + if len(f.Repositories) == 0 && outfmt != output.JSON && outfmt != output.YAML { return errors.New("no repositories to show") } diff --git a/pkg/kube/ready.go b/pkg/kube/ready.go index 11df4371c..7a06c72f9 100644 --- a/pkg/kube/ready.go +++ b/pkg/kube/ready.go @@ -294,7 +294,7 @@ func (c *ReadyChecker) deploymentReady(rs *appsv1.ReplicaSet, dep *appsv1.Deploy } expectedReady := *dep.Spec.Replicas - deploymentutil.MaxUnavailable(*dep) - if !(rs.Status.ReadyReplicas >= expectedReady) { + if rs.Status.ReadyReplicas < expectedReady { slog.Debug("Deployment does not have enough pods ready", "namespace", dep.GetNamespace(), "name", dep.GetName(), "readyPods", rs.Status.ReadyReplicas, "totalPods", expectedReady) return false } @@ -328,7 +328,7 @@ func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool { } expectedReady := int(ds.Status.DesiredNumberScheduled) - maxUnavailable - if !(int(ds.Status.NumberReady) >= expectedReady) { + if int(ds.Status.NumberReady) < expectedReady { slog.Debug("DaemonSet does not have enough Pods ready", "namespace", ds.GetNamespace(), "name", ds.GetName(), "readyPods", ds.Status.NumberReady, "totalPods", expectedReady) return false } diff --git a/pkg/lint/rules/template.go b/pkg/lint/rules/template.go index 4d421f5bf..81a18b411 100644 --- a/pkg/lint/rules/template.go +++ b/pkg/lint/rules/template.go @@ -287,7 +287,7 @@ func validateMatchSelector(yamlStruct *K8sYamlStruct, manifest string) error { switch yamlStruct.Kind { case "Deployment", "ReplicaSet", "DaemonSet", "StatefulSet": // verify that matchLabels or matchExpressions is present - if !(strings.Contains(manifest, "matchLabels") || strings.Contains(manifest, "matchExpressions")) { + if !strings.Contains(manifest, "matchLabels") && !strings.Contains(manifest, "matchExpressions") { return fmt.Errorf("a %s must contain matchLabels or matchExpressions, and %q does not", yamlStruct.Kind, yamlStruct.Metadata.Name) } }