@@ -66,24 +66,24 @@ const (
66
66
BasicAuthsKey = "basicauths"
67
67
// IndexesKey is the Viper key for indexes configuration.
68
68
IndexesKey = "indexes"
69
- // FollowerEveryKey is the Viper key for follower "every" configuration.
70
- FollowerEveryKey = "follower .every"
71
- // FollowerArtifactsKey is the Viper key for follower "artifacts" configuration.
72
- FollowerArtifactsKey = "follower.artifacts "
73
- // FollowerFalcoVersionsKey is the Viper key for follower "falcoVersions" configuration.
74
- FollowerFalcoVersionsKey = "follower .falcoversions"
75
- // FollowerRulesfilesDirKey is the Viper key for follower "rulesFilesDir" configuration.
76
- FollowerRulesfilesDirKey = "follower .rulesfilesdir"
77
- // FollowerPluginsDirKey is the Viper key for follower "pluginsDir" configuration.
78
- FollowerPluginsDirKey = "follower .pluginsdir"
79
- // FollowerWorkingDirKey is the Viper key for follower "pluginsDir" configuration.
80
- FollowerWorkingDirKey = "follower .workingdir"
81
- // InstallerArtifactsKey is the Viper key for installer "artifacts" configuration.
82
- InstallerArtifactsKey = "installer.artifacts "
83
- // InstallerRulesfilesDirKey is the Viper key for follower "rulesFilesDir" configuration.
84
- InstallerRulesfilesDirKey = "installer .rulesfilesdir"
85
- // InstallerPluginsDirKey is the Viper key for follower "pluginsDir" configuration.
86
- InstallerPluginsDirKey = "installer .pluginsdir"
69
+ // ArtifactFollowEveryKey is the Viper key for follower "every" configuration.
70
+ ArtifactFollowEveryKey = "artifact.follow .every"
71
+ // ArtifactFollowRefsKey is the Viper key for follower "artifacts" configuration.
72
+ ArtifactFollowRefsKey = "artifact.follow.refs "
73
+ // ArtifactFollowFalcoVersionsKey is the Viper key for follower "falcoVersions" configuration.
74
+ ArtifactFollowFalcoVersionsKey = "artifact.follow .falcoversions"
75
+ // ArtifactFollowRulesfilesDirKey is the Viper key for follower "rulesFilesDir" configuration.
76
+ ArtifactFollowRulesfilesDirKey = "artifact.follow .rulesfilesdir"
77
+ // ArtifactFollowPluginsDirKey is the Viper key for follower "pluginsDir" configuration.
78
+ ArtifactFollowPluginsDirKey = "artifact.follow .pluginsdir"
79
+ // ArtifactFollowWorkingDirKey is the Viper key for follower "pluginsDir" configuration.
80
+ ArtifactFollowWorkingDirKey = "artifact.follow .workingdir"
81
+ // ArtifactInstallArtifactsKey is the Viper key for installer "artifacts" configuration.
82
+ ArtifactInstallArtifactsKey = "artifact.install.refs "
83
+ // ArtifactInstallRulesfilesDirKey is the Viper key for follower "rulesFilesDir" configuration.
84
+ ArtifactInstallRulesfilesDirKey = "artifact.install .rulesfilesdir"
85
+ // ArtifactInstallPluginsDirKey is the Viper key for follower "pluginsDir" configuration.
86
+ ArtifactInstallPluginsDirKey = "artifact.install .pluginsdir"
87
87
)
88
88
89
89
// Index represents a configured index.
@@ -159,9 +159,9 @@ func Load(path string) error {
159
159
viper .SetDefault (IndexesKey , []Index {DefaultIndex })
160
160
161
161
// Set default follower options
162
- viper .SetDefault (FollowerEveryKey , DefaultFollower .Every )
163
- viper .SetDefault (FollowerArtifactsKey , DefaultFollower .Artifacts )
164
- viper .SetDefault (FollowerFalcoVersionsKey , DefaultFollower .FalcoVersions )
162
+ viper .SetDefault (ArtifactFollowEveryKey , DefaultFollower .Every )
163
+ viper .SetDefault (ArtifactFollowRefsKey , DefaultFollower .Artifacts )
164
+ viper .SetDefault (ArtifactFollowFalcoVersionsKey , DefaultFollower .FalcoVersions )
165
165
166
166
err = viper .ReadInConfig ()
167
167
if errors .As (err , & viper.ConfigFileNotFoundError {}) || os .IsNotExist (err ) {
@@ -346,34 +346,34 @@ func oathAuthListHookFunc() mapstructure.DecodeHookFuncType {
346
346
func Follower () (Follow , error ) {
347
347
// with Follow we can just use nested keys.
348
348
// env variables can just make use of ";" to separat
349
- artifacts := viper .GetStringSlice (FollowerArtifactsKey )
349
+ artifacts := viper .GetStringSlice (ArtifactFollowRefsKey )
350
350
if len (artifacts ) == 1 { // in this case it might come from the env
351
351
artifacts = strings .Split (artifacts [0 ], ";" )
352
352
}
353
353
354
354
return Follow {
355
- Every : viper .GetDuration (FollowerEveryKey ),
355
+ Every : viper .GetDuration (ArtifactFollowEveryKey ),
356
356
Artifacts : artifacts ,
357
- FalcoVersions : viper .GetString (FollowerFalcoVersionsKey ),
358
- RulesfilesDir : viper .GetString (FollowerRulesfilesDirKey ),
359
- PluginsDir : viper .GetString (FollowerPluginsDirKey ),
360
- WorkingDir : viper .GetString (FollowerWorkingDirKey ),
357
+ FalcoVersions : viper .GetString (ArtifactFollowFalcoVersionsKey ),
358
+ RulesfilesDir : viper .GetString (ArtifactFollowRulesfilesDirKey ),
359
+ PluginsDir : viper .GetString (ArtifactFollowPluginsDirKey ),
360
+ WorkingDir : viper .GetString (ArtifactFollowWorkingDirKey ),
361
361
}, nil
362
362
}
363
363
364
364
// Installer retrieves the installer section of the config file.
365
365
func Installer () (Install , error ) {
366
366
// with Install we can just use nested keys.
367
367
// env variables can just make use of ";" to separat
368
- artifacts := viper .GetStringSlice (InstallerArtifactsKey )
368
+ artifacts := viper .GetStringSlice (ArtifactInstallArtifactsKey )
369
369
if len (artifacts ) == 1 { // in this case it might come from the env
370
370
artifacts = strings .Split (artifacts [0 ], ";" )
371
371
}
372
372
373
373
return Install {
374
374
Artifacts : artifacts ,
375
- RulesfilesDir : viper .GetString (InstallerRulesfilesDirKey ),
376
- PluginsDir : viper .GetString (InstallerPluginsDirKey ),
375
+ RulesfilesDir : viper .GetString (ArtifactInstallRulesfilesDirKey ),
376
+ PluginsDir : viper .GetString (ArtifactInstallPluginsDirKey ),
377
377
}, nil
378
378
}
379
379
0 commit comments