Skip to content

Commit

Permalink
Remove unused config file handling from worker (#1142)
Browse files Browse the repository at this point in the history
The `LoadConfig` function for the worker was configured to be able to
load configuration data from a file. However, the necessary viper
function to load and read the file was never called. This functionality
has not worked since the initial commit and so it doesn't seem
necessary. This is now being removed in favour of only configuring the
worker via environment variables.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
  • Loading branch information
zubron authored Jul 8, 2020
1 parent 046c082 commit 5f1730b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/worker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ limitations under the License.
package worker

import (
"os"

"github.com/vmware-tanzu/sonobuoy/pkg/plugin"

"github.com/pkg/errors"
"github.com/spf13/viper"
)
Expand All @@ -39,16 +38,6 @@ func LoadConfig() (*plugin.WorkerConfig, error) {
config := &plugin.WorkerConfig{}
var err error

viper.SetConfigType("json")
viper.SetConfigName("worker")
viper.AddConfigPath("/etc/sonobuoy")
viper.AddConfigPath(".")

// Allow specifying a custom config file via the SONOBUOY_CONFIG env var
if forceCfg := os.Getenv("SONOBUOY_CONFIG"); forceCfg != "" {
viper.SetConfigFile(forceCfg)
}

viper.BindEnv("masterurl", "MASTER_URL")
viper.BindEnv("nodename", "NODE_NAME")
viper.BindEnv("resultsdir", "RESULTS_DIR")
Expand Down

0 comments on commit 5f1730b

Please sign in to comment.