mirror of
https://github.com/stakater/Reloader.git
synced 2026-04-19 08:26:48 +00:00
Fail if user tries to ignore all resource types
This commit is contained in:
@@ -24,7 +24,7 @@ func NewReloaderCommand() *cobra.Command {
|
||||
cmd.PersistentFlags().StringVar(&options.ConfigmapUpdateOnChangeAnnotation, "configmap-annotation", "configmap.reloader.stakater.com/reload", "annotation to detect changes in configmaps")
|
||||
cmd.PersistentFlags().StringVar(&options.SecretUpdateOnChangeAnnotation, "secret-annotation", "secret.reloader.stakater.com/reload", "annotation to detect changes in secrets")
|
||||
cmd.PersistentFlags().StringVar(&options.ReloaderAutoAnnotation, "auto-annotation", "reloader.stakater.com/auto", "annotation to detect changes in secrets")
|
||||
cmd.PersistentFlags().StringSlice("resources-to-ignore", []string{}, "list of resources to ignore (valid options 'configMaps', 'secrets')")
|
||||
cmd.PersistentFlags().StringSlice("resources-to-ignore", []string{}, "list of resources to ignore (valid options 'configMaps' or 'secrets')")
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -57,6 +57,10 @@ func startReloader(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(ignoreList) > 1 {
|
||||
logrus.Fatal("'resources-to-ignore' only accepts 'configMaps' or 'secrets', not both")
|
||||
}
|
||||
|
||||
for k := range kube.ResourceMap {
|
||||
if ignoreList.Contains(k) {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user