You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option sets Gonsul behaviour on how it should proceed in case some Consul deletes are to be made.
295
+
296
+
-**`true`** With this mode deletes are allowed and Gonsul will proceed with the delete operations, removed files from the repo and/or files added directly on consul k/v will be deleted.
297
+
-**`skip`** In this mode, Gonsul will skip the deletion check and operations and will just sync/push files to consul k/v path (can lead to inconsistencies at the consul k/v path since removed files from the repo and/or files added directly on consul k/v will stay in the consul path because we are skipping deletions).
298
+
-**`false`**_this is the default mode_ and Gonsul will not proceed with the deletes, and depending on the `--strategy` it is running at, will respond with some different behaviors, such as:
299
+
300
+
1.**`ONCE`** When running in once mode, Gonsul will terminate with __error code 10__ and output to console all the Consul KV paths that are supposed to be deleted.
301
+
302
+
2.**`HOOK`** Gonsul will repond to the HTTP request with error 503 and will also return the following headers and values:
3.**`POLL`** Gonsul will log all the paths to be deleted as ERRORS and carry on, over and over. In this mode you should monitor Gonsul logs to detect any found errors, and react appropriately. The errors will follow the syntax:
@@ -321,6 +325,12 @@ This is the number of seconds you want Gonsul to wait between checks on the repo
321
325
This is the file extensions that Gonsul should consider as inputs to populate our Consul. Please set each extension
322
326
without the dot, and separate each extension with a comma.
323
327
328
+
### `--keep-FileExt`
329
+
> `require:`**no**
330
+
> `default:`**false**
331
+
> `example:`**`--keep-FileExt=true`**
332
+
333
+
Gonsul default behavior is to remove/trim the filextension from the filename when pushing files to consul k/v path, if this option is set to true gonsul will keep the file extension.
Copy file name to clipboardExpand all lines: internal/config/flags_parser.go
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,10 @@ type ConfigFlags struct {
21
21
ConsulBasePath*string
22
22
ExpandJSON*bool
23
23
SecretsFile*string
24
-
AllowDeletes*bool
24
+
AllowDeletes*string
25
25
PollInterval*int
26
26
ValidExtensions*string
27
-
KeepFileExt*bool
27
+
KeepFileExt*bool
28
28
Timeout*int
29
29
Version*bool
30
30
}
@@ -46,7 +46,7 @@ func parseFlags() ConfigFlags {
46
46
flags.ConsulBasePath=flag.String("consul-base-path", "", "The base KV path will be prefixed to dir path")
47
47
flags.ExpandJSON=flag.Bool("expand-json", false, "Expand and parse JSON files as full paths? (Default false)")
48
48
flags.SecretsFile=flag.String("secrets-file", "", "A key value json file with placeholders->secrets mapping, in order to do on the fly replace")
49
-
flags.AllowDeletes=flag.Bool("allow-deletes", false, "Show Gonsul issue deletes? (If not, nothing will be done and a report on conflicting deletes will be shown) (Default false)")
49
+
flags.AllowDeletes=flag.String("allow-deletes", "false", "false, nothing will be done and a report on conflicting deletes will be shown; true: deletes reported conflitcs and proceeds; skip: reportes conflitcs, does not performe any deletes and proceeds syncing remaining files.) (Default false)")
50
50
flags.PollInterval=flag.Int("poll-interval", 60, "The number of seconds for the repository polling interval")
51
51
flags.ValidExtensions=flag.String("input-ext", "json,txt,ini", "A comma separated list of file extensions valid as input")
52
52
flags.KeepFileExt=flag.Bool("keep-FileExt", false, "Do we want to keep file name extensions ? (If not set to true defaults by ommiting the file name extension.) (Default false)")
0 commit comments