1- // Copyright (c) 2021 Veritas Technologies LLC. All rights reserved. IP63-2828-7171-04-15-9
1+ // Copyright (c) 2023 Veritas Technologies LLC. All rights reserved. IP63-2828-7171-04-15-9
22
33package config
44
88 "os"
99 "path/filepath"
1010
11- "gopkg.in/yaml.v2 "
11+ "gopkg.in/yaml.v3 "
1212
1313 logutil "github.com/VeritasOS/plugin-manager/utils/log"
1414)
@@ -59,15 +59,17 @@ func GetPluginsLibrary() string {
5959}
6060
6161// GetPluginsDir gets location of plugins directory.
62- // NOTE: This is deprecated, Use GetPluginsLibrary() instead.
62+ //
63+ // NOTE: This is deprecated, Use GetPluginsLibrary() instead.
6364func GetPluginsDir () string {
6465 return filepath .FromSlash (filepath .Clean (myConfig .PluginManager .PluginDir ) +
6566 string (os .PathSeparator ))
6667}
6768
6869// GetPMLogDir provides location for storing Plugin Manager logs.
69- // NOTE: The plugin logs would be stored "plugins" directory under the
70- // same path, and use GetPluginsLogDir() to get that path.
70+ //
71+ // NOTE: The plugin logs would be stored "plugins" directory under the
72+ // same path, and use GetPluginsLogDir() to get that path.
7173func GetPMLogDir () string {
7274 return filepath .FromSlash (filepath .Clean (myConfig .PluginManager .LogDir ) +
7375 string (os .PathSeparator ))
@@ -136,9 +138,10 @@ func readConfigFile(confFilePath string) (Config, error) {
136138}
137139
138140// SetLogDir sets the location for storing Plugin Manager logs.
139- // Use GetPMLogDir() to obtain this location from config.
140- // NOTE: The plugin logs would be stored "plugins" directory under the
141- // same path, and use GetPluginsLogDir() to get that path.
141+ //
142+ // Use GetPMLogDir() to obtain this location from config.
143+ // NOTE: The plugin logs would be stored "plugins" directory under the
144+ // same path, and use GetPluginsLogDir() to get that path.
142145func SetLogDir (logDir string ) {
143146 // TODO: Move log parameters one level up in config as it's common to asum,
144147 // and not specific to PM.
@@ -147,9 +150,10 @@ func SetLogDir(logDir string) {
147150}
148151
149152// SetLogFile sets the log file to use.
150- // Use GetLogDir() to obtain this location from config.
151- // NOTE: The plugin logs would be stored "plugins" directory under the
152- // same path, and use Get/SetPluginsLogDir() to get/set that path.
153+ //
154+ // Use GetLogDir() to obtain this location from config.
155+ // NOTE: The plugin logs would be stored "plugins" directory under the
156+ // same path, and use Get/SetPluginsLogDir() to get/set that path.
153157func SetLogFile (logFile string ) {
154158 // TODO: Move log parameters one level up in config as it's common to asum,
155159 // and not specific to PM.
@@ -163,7 +167,8 @@ func SetPluginsLibrary(library string) {
163167}
164168
165169// SetPluginsDir sets location of plugins directory.
166- // NOTE: This is deprecated, Use SetPluginsLibrary() instead.
170+ //
171+ // NOTE: This is deprecated, Use SetPluginsLibrary() instead.
167172func SetPluginsDir (library string ) {
168173 myConfig .PluginManager .PluginDir = filepath .FromSlash (filepath .Clean (library ) +
169174 string (os .PathSeparator ))
@@ -175,9 +180,10 @@ func SetPMLogFile(logfile string) {
175180}
176181
177182// SetPMLogDir sets the location for storing Plugin Manager logs.
178- // Use GetPMLogDir() to obtain this location from config.
179- // NOTE: The plugin logs would be stored "plugins" directory under the
180- // same path, and use GetPluginsLogDir() to get that path.
183+ //
184+ // Use GetPMLogDir() to obtain this location from config.
185+ // NOTE: The plugin logs would be stored "plugins" directory under the
186+ // same path, and use GetPluginsLogDir() to get that path.
181187func SetPMLogDir (logDir string ) {
182188 myConfig .PluginManager .LogDir = filepath .FromSlash (
183189 filepath .Clean (logDir ) + string (os .PathSeparator ))
0 commit comments