mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-04 11:58:41 +00:00
Fix for check command (#916)
* Fix for check command * empty commit for checks Co-authored-by: Roee Gadot <roee.gadot@up9.com>
This commit is contained in:
parent
59e6268ddd
commit
4bdda920d5
@ -111,9 +111,9 @@ func checkRulesPermissions(ctx context.Context, kubernetesProvider *kubernetes.P
|
|||||||
func checkPermissionExist(group string, resource string, verb string, namespace string, exist bool, err error) bool {
|
func checkPermissionExist(group string, resource string, verb string, namespace string, exist bool, err error) bool {
|
||||||
var groupAndNamespace string
|
var groupAndNamespace string
|
||||||
if group != "" && namespace != "" {
|
if group != "" && namespace != "" {
|
||||||
groupAndNamespace = fmt.Sprintf("in group '%v' and namespace '%v'", group, namespace)
|
groupAndNamespace = fmt.Sprintf("in api group '%v' and namespace '%v'", group, namespace)
|
||||||
} else if group != "" {
|
} else if group != "" {
|
||||||
groupAndNamespace = fmt.Sprintf("in group '%v'", group)
|
groupAndNamespace = fmt.Sprintf("in api group '%v'", group)
|
||||||
} else if namespace != "" {
|
} else if namespace != "" {
|
||||||
groupAndNamespace = fmt.Sprintf("in namespace '%v'", namespace)
|
groupAndNamespace = fmt.Sprintf("in namespace '%v'", namespace)
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ func runMizuCheck() {
|
|||||||
checkPassed = check.KubernetesVersion(kubernetesVersion)
|
checkPassed = check.KubernetesVersion(kubernetesVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Config.Check.PreTap || config.Config.Check.PreInstall || config.Config.Check.ImagePull {
|
||||||
if config.Config.Check.PreTap {
|
if config.Config.Check.PreTap {
|
||||||
if checkPassed {
|
if checkPassed {
|
||||||
checkPassed = check.TapKubernetesPermissions(ctx, embedFS, kubernetesProvider)
|
checkPassed = check.TapKubernetesPermissions(ctx, embedFS, kubernetesProvider)
|
||||||
@ -35,6 +36,13 @@ func runMizuCheck() {
|
|||||||
if checkPassed {
|
if checkPassed {
|
||||||
checkPassed = check.InstallKubernetesPermissions(ctx, kubernetesProvider)
|
checkPassed = check.InstallKubernetesPermissions(ctx, kubernetesProvider)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if config.Config.Check.ImagePull {
|
||||||
|
if checkPassed {
|
||||||
|
checkPassed = check.ImagePullInCluster(ctx, kubernetesProvider)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if checkPassed {
|
if checkPassed {
|
||||||
checkPassed = check.KubernetesResources(ctx, kubernetesProvider)
|
checkPassed = check.KubernetesResources(ctx, kubernetesProvider)
|
||||||
@ -45,12 +53,6 @@ func runMizuCheck() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Config.Check.ImagePull {
|
|
||||||
if checkPassed {
|
|
||||||
checkPassed = check.ImagePullInCluster(ctx, kubernetesProvider)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if checkPassed {
|
if checkPassed {
|
||||||
logger.Log.Infof("\nStatus check results are %v", fmt.Sprintf(uiUtils.Green, "√"))
|
logger.Log.Infof("\nStatus check results are %v", fmt.Sprintf(uiUtils.Green, "√"))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user