Documentation ¶
Index ¶
- Variables
- func GetK8SClient() client.Client
- func InitConfig()
- func InitK8SClient()
- func PatchMissingRules(k8sClient client.Client, missingRulesMap map[string]string) error
- func PatchRelabelings(k8sClient client.Client) error
- func RelabelingCheck(k8sClient client.Client) (bool, error)
- func RulesCheck(k8sClient client.Client) (bool, map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PromApplyCmd = &cobra.Command{ Use: "prom_apply", Short: "prom_apply ", Long: "", RunE: func(cmd *cobra.Command, args []string) error { InitConfig() InitK8SClient() ok, missingRulesMap, err := RulesCheck(k8sCli) if err != nil { return err } else if !ok { if err = PatchMissingRules(k8sCli, missingRulesMap); err != nil { return err } } return nil }, } )
View Source
var ( PromCheckCmd = &cobra.Command{ Use: "prom_check", Short: "prom_check ", Long: "", RunE: func(cmd *cobra.Command, args []string) error { InitConfig() InitK8SClient() ok, _, err := RulesCheck(k8sCli) if err == nil && !ok { logger.Info("some rules are missing and need to patch") os.Exit(1) } return err }, } )
Functions ¶
func GetK8SClient ¶
func InitConfig ¶
func InitConfig()
func InitK8SClient ¶
func InitK8SClient()
func PatchMissingRules ¶
func PatchRelabelings ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.