diff --git a/hack/install-go-tools.sh b/hack/install-go-tools.sh index 43e060c..da8e1e8 100755 --- a/hack/install-go-tools.sh +++ b/hack/install-go-tools.sh @@ -16,4 +16,5 @@ go install -mod=readonly github.com/bwplotka/bingo@latest # Once the new bingo version is released, make sure to append '-t 0' in below commands unset GOFLAGS bingo get -v -l github.com/prometheus/prometheus/cmd/promtool@v0.46.0 -bingo get -v -l github.com/cloudflare/pint/cmd/pint@v0.44.1 \ No newline at end of file +bingo get -v -l github.com/cloudflare/pint/cmd/pint@v0.44.1 +go install github.com/prometheus-operator/prometheus-operator/cmd/po-lint diff --git a/main.go b/main.go index 46c73f0..fc34a47 100644 --- a/main.go +++ b/main.go @@ -306,6 +306,10 @@ func checkRules(rulesDirPath, tenant string, isGeneratingTemplate bool) { return fmt.Errorf("failed to run 'promtool check rules' on the 'spec' part of the file; output:\n%v", output) } + if output, err := runAndOutputCommand("po-lint", specFilePath); err != nil { + return fmt.Errorf("failed to run 'po-lint' on the file; output:\n%v", output) + } + { var ruleGroupsObj ruleGroupsObj