-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
42 lines (38 loc) · 1.42 KB
/
main.go
File metadata and controls
42 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"flag"
"fmt"
"os"
"github.com/eumel8/clustercheck/pkg/fluxcheck"
"github.com/eumel8/clustercheck/pkg/gatecheck"
"github.com/eumel8/clustercheck/pkg/monitoringcheck"
"github.com/eumel8/clustercheck/pkg/podcheck"
)
func main() {
bitwarden := flag.Bool("bw", false, "enable Bitwarden password store")
fqdn := flag.String("f", "", "optional FQDN of cluster targets, e.g. example.com")
checkPods := flag.Bool("check-pods", false, "check if all pods are in Running or Succeeded state")
checkFlux := flag.Bool("check-flux", false, "check if all Flux HelmReleases and Kustomizations are Ready")
gateCheck := flag.Bool("gate-check", false, "comprehensive cluster health check for quality gate validation")
namespace := flag.String("namespace", "", "namespace to check resources (empty for all namespaces)")
debug := flag.Bool("debug", false, "enable debug output for API requests and responses")
flag.Parse()
if *gateCheck {
_, err := gatecheck.GateCheck(*namespace, *bitwarden, *fqdn, *debug)
if err != nil {
os.Exit(1)
}
} else if *checkPods {
if err := podcheck.CheckPods(*namespace, *debug); err != nil {
fmt.Fprintf(os.Stderr, "Pod check failed: %v\n", err)
os.Exit(1)
}
} else if *checkFlux {
if err := fluxcheck.CheckFlux(*namespace, *debug); err != nil {
fmt.Fprintf(os.Stderr, "Flux check failed: %v\n", err)
os.Exit(1)
}
} else {
monitoringcheck.Run(*bitwarden, *fqdn, *debug)
}
}