Enable linter revive and resolve found errors: part 1

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-24 15:29:20 +08:00
parent a0b0b7cd9b
commit 180cc4e31d
40 changed files with 150 additions and 171 deletions

View File

@@ -36,13 +36,13 @@ const (
)
var (
DaemonsetNotFound = errors.New("daemonset not found")
ErrDaemonSetNotFound = errors.New("daemonset not found")
)
// IsRunning checks if the node agent daemonset is running properly. If not, return the error found
func IsRunning(ctx context.Context, kubeClient kubernetes.Interface, namespace string) error {
if _, err := kubeClient.AppsV1().DaemonSets(namespace).Get(ctx, daemonSet, metav1.GetOptions{}); apierrors.IsNotFound(err) {
return DaemonsetNotFound
return ErrDaemonSetNotFound
} else if err != nil {
return err
} else {