File tree Expand file tree Collapse file tree 6 files changed +430
-415
lines changed Expand file tree Collapse file tree 6 files changed +430
-415
lines changed Original file line number Diff line number Diff line change 2424            run : make --always-make vale && git diff --exit-code 
2525          - name : Jsonnet linter 
2626            run : make --always-make jsonnet-lint 
27+           - name : YAML linter (Pint) 
28+             run : make --always-make pint-lint 
2729          - name : Unit tests 
2830            run : make --always-make test 
2931
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ MD_FILES = $(shell find . \( -type d -name '.vale' -o -type d -name 'vendor' \)
1010MARKDOWNFMT_BIN =$(BIN_DIR ) /markdownfmt
1111VALE_BIN =$(BIN_DIR ) /vale
1212PROMTOOL_BIN =$(BIN_DIR ) /promtool
13- TOOLING =$(JB_BIN )  $(JSONNETLINT_BIN )  $(JSONNET_BIN )  $(JSONNETFMT_BIN )  $(PROMTOOL_BIN )  $(GRAFANA_DASHBOARD_LINTER_BIN )  $(MARKDOWNFMT_BIN )  $(VALE_BIN ) 
13+ PINT_BIN =$(BIN_DIR ) /pint
14+ TOOLING =$(JB_BIN )  $(JSONNETLINT_BIN )  $(JSONNET_BIN )  $(JSONNETFMT_BIN )  $(PROMTOOL_BIN )  $(GRAFANA_DASHBOARD_LINTER_BIN )  $(MARKDOWNFMT_BIN )  $(VALE_BIN )  $(PINT_BIN ) 
1415JSONNETFMT_ARGS =-n 2 --max-blank-lines 2 --string-style s --comment-style s
1516SRC_DIR  ?=dashboards
1617OUT_DIR  ?=dashboards_out
@@ -44,7 +45,7 @@ $(OUT_DIR): $(JSONNET_BIN) $(JSONNET_VENDOR) mixin.libsonnet lib/dashboards.json
4445	@$(JSONNET_BIN )  -J vendor -m $(OUT_DIR )  lib/dashboards.jsonnet
4546
4647.PHONY : lint
47- lint : jsonnet-lint alerts-lint dashboards-lint vale
48+ lint : jsonnet-lint alerts-lint dashboards-lint vale pint-lint 
4849
4950.PHONY : jsonnet-lint
5051jsonnet-lint : $(JSONNETLINT_BIN )  $(JSONNET_VENDOR ) 
@@ -67,10 +68,18 @@ dashboards-lint: $(GRAFANA_DASHBOARD_LINTER_BIN) $(OUT_DIR)/.lint
6768
6869.PHONY : vale
6970vale : $(VALE_BIN ) 
70- 	@echo $(MD_FILES ) 
7171	@$(VALE_BIN )  sync &&  \ 
7272		$(VALE_BIN )  $(MD_FILES ) 
7373
74+ .PHONY : pint-lint
75+ pint-lint : generate $(PINT_BIN ) 
76+ 	@#  Pint will not exit with a non-zero status code if there are linting issues.
77+ 	@output=$$($(PINT_BIN )  -n -o -l WARN lint prometheus_alerts.yaml prometheus_rules.yaml 2>&1) ;  \ 
78+ 	if  [ -n  " $$ output"   ];  then  \
79+ 		echo  " \n$$ output" ;  \ 
80+ 		exit  1;  \ 
81+ 	fi 
82+ 
7483.PHONY : clean
7584clean :
7685	#  Remove all files and directories ignored by git.
Original file line number Diff line number Diff line change 143143          {
144144            expr: ||| 
145145              ( 
146-                 max without (revision ) ( 
146+                 max by(namespace, statefulset ) ( 
147147                  kube_statefulset_status_current_revision{%(prefixedNamespaceSelector)s%(kubeStateMetricsSelector)s} 
148148                    unless 
149149                  kube_statefulset_status_update_revision{%(prefixedNamespaceSelector)s%(kubeStateMetricsSelector)s} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments