mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-15 04:57:56 +00:00
Merge pull request #673 from marquiz/devel/sources-flag
nfd-worker: rename 'sources' config option
This commit is contained in:
commit
a2a68c1917
10 changed files with 64 additions and 43 deletions
|
@ -80,6 +80,8 @@ func parseArgs(flags *flag.FlagSet, osArgs ...string) *worker.Args {
|
||||||
switch f.Name {
|
switch f.Name {
|
||||||
case "no-publish":
|
case "no-publish":
|
||||||
args.Overrides.NoPublish = overrides.NoPublish
|
args.Overrides.NoPublish = overrides.NoPublish
|
||||||
|
case "label-sources":
|
||||||
|
args.Overrides.LabelSources = overrides.LabelSources
|
||||||
case "label-whitelist":
|
case "label-whitelist":
|
||||||
klog.Warningf("-label-whitelist is deprecated, use 'core.labelWhiteList' option in the config file, instead")
|
klog.Warningf("-label-whitelist is deprecated, use 'core.labelWhiteList' option in the config file, instead")
|
||||||
args.Overrides.LabelWhiteList = overrides.LabelWhiteList
|
args.Overrides.LabelWhiteList = overrides.LabelWhiteList
|
||||||
|
@ -87,8 +89,8 @@ func parseArgs(flags *flag.FlagSet, osArgs ...string) *worker.Args {
|
||||||
klog.Warningf("-sleep-interval is deprecated, use 'core.sleepInterval' option in the config file, instead")
|
klog.Warningf("-sleep-interval is deprecated, use 'core.sleepInterval' option in the config file, instead")
|
||||||
args.Overrides.SleepInterval = overrides.SleepInterval
|
args.Overrides.SleepInterval = overrides.SleepInterval
|
||||||
case "sources":
|
case "sources":
|
||||||
klog.Warningf("-sources is deprecated, use 'core.sources' option in the config file, instead")
|
klog.Warningf("-sources is deprecated, use '-label-sources' flag, instead")
|
||||||
args.Overrides.Sources = overrides.Sources
|
args.Overrides.LabelSources = overrides.LabelSources
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -121,10 +123,12 @@ func initFlags(flagset *flag.FlagSet) (*worker.Args, *worker.ConfigOverrideArgs)
|
||||||
// Flags overlapping with config file options
|
// Flags overlapping with config file options
|
||||||
overrides := &worker.ConfigOverrideArgs{
|
overrides := &worker.ConfigOverrideArgs{
|
||||||
LabelWhiteList: &utils.RegexpVal{},
|
LabelWhiteList: &utils.RegexpVal{},
|
||||||
Sources: &utils.StringSliceVal{},
|
LabelSources: &utils.StringSliceVal{},
|
||||||
}
|
}
|
||||||
overrides.NoPublish = flagset.Bool("no-publish", false,
|
overrides.NoPublish = flagset.Bool("no-publish", false,
|
||||||
"Do not publish discovered features, disable connection to nfd-master.")
|
"Do not publish discovered features, disable connection to nfd-master.")
|
||||||
|
flagset.Var(overrides.LabelSources, "label-sources",
|
||||||
|
"Comma separated list of label sources. Special value 'all' enables all feature sources.")
|
||||||
flagset.Var(overrides.LabelWhiteList, "label-whitelist",
|
flagset.Var(overrides.LabelWhiteList, "label-whitelist",
|
||||||
"Regular expression to filter label names to publish to the Kubernetes API server. "+
|
"Regular expression to filter label names to publish to the Kubernetes API server. "+
|
||||||
"NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'. "+
|
"NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'. "+
|
||||||
|
@ -132,9 +136,9 @@ func initFlags(flagset *flag.FlagSet) (*worker.Args, *worker.ConfigOverrideArgs)
|
||||||
overrides.SleepInterval = flagset.Duration("sleep-interval", 0,
|
overrides.SleepInterval = flagset.Duration("sleep-interval", 0,
|
||||||
"Time to sleep between re-labeling. Non-positive value implies no re-labeling (i.e. infinite sleep). "+
|
"Time to sleep between re-labeling. Non-positive value implies no re-labeling (i.e. infinite sleep). "+
|
||||||
"DEPRECATED: This parameter should be set via the config file")
|
"DEPRECATED: This parameter should be set via the config file")
|
||||||
flagset.Var(overrides.Sources, "sources",
|
flagset.Var(overrides.LabelSources, "sources",
|
||||||
"Comma separated list of feature sources. Special value 'all' enables all feature sources. "+
|
"Comma separated list of label sources. Special value 'all' enables all feature sources. "+
|
||||||
"DEPRECATED: This parameter should be set via the config file")
|
"DEPRECATED: use -label-sources instead")
|
||||||
|
|
||||||
return args, overrides
|
return args, overrides
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ func TestParseArgs(t *testing.T) {
|
||||||
So(args.Overrides.NoPublish, ShouldBeNil)
|
So(args.Overrides.NoPublish, ShouldBeNil)
|
||||||
So(args.Overrides.LabelWhiteList, ShouldBeNil)
|
So(args.Overrides.LabelWhiteList, ShouldBeNil)
|
||||||
So(args.Overrides.SleepInterval, ShouldBeNil)
|
So(args.Overrides.SleepInterval, ShouldBeNil)
|
||||||
So(args.Overrides.Sources, ShouldBeNil)
|
So(args.Overrides.LabelSources, ShouldBeNil)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -46,14 +46,14 @@ func TestParseArgs(t *testing.T) {
|
||||||
args := parseArgs(flags,
|
args := parseArgs(flags,
|
||||||
"-no-publish",
|
"-no-publish",
|
||||||
"-label-whitelist=.*rdt.*",
|
"-label-whitelist=.*rdt.*",
|
||||||
"-sources=fake1,fake2,fake3",
|
"-label-sources=fake1,fake2,fake3",
|
||||||
"-sleep-interval=30s")
|
"-sleep-interval=30s")
|
||||||
|
|
||||||
Convey("args.sources is set to appropriate values", func() {
|
Convey("args.sources is set to appropriate values", func() {
|
||||||
So(args.Oneshot, ShouldBeFalse)
|
So(args.Oneshot, ShouldBeFalse)
|
||||||
So(*args.Overrides.NoPublish, ShouldBeTrue)
|
So(*args.Overrides.NoPublish, ShouldBeTrue)
|
||||||
So(*args.Overrides.SleepInterval, ShouldEqual, 30*time.Second)
|
So(*args.Overrides.SleepInterval, ShouldEqual, 30*time.Second)
|
||||||
So(*args.Overrides.Sources, ShouldResemble, utils.StringSliceVal{"fake1", "fake2", "fake3"})
|
So(*args.Overrides.LabelSources, ShouldResemble, utils.StringSliceVal{"fake1", "fake2", "fake3"})
|
||||||
So(args.Overrides.LabelWhiteList.Regexp.String(), ShouldResemble, ".*rdt.*")
|
So(args.Overrides.LabelWhiteList.Regexp.String(), ShouldResemble, ".*rdt.*")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# labelWhiteList:
|
# labelWhiteList:
|
||||||
# noPublish: false
|
# noPublish: false
|
||||||
# sleepInterval: 60s
|
# sleepInterval: 60s
|
||||||
# sources: [all]
|
# labelSources: [all]
|
||||||
# klog:
|
# klog:
|
||||||
# addDirHeader: false
|
# addDirHeader: false
|
||||||
# alsologtostderr: false
|
# alsologtostderr: false
|
||||||
|
|
|
@ -91,7 +91,7 @@ worker:
|
||||||
# labelWhiteList:
|
# labelWhiteList:
|
||||||
# noPublish: false
|
# noPublish: false
|
||||||
# sleepInterval: 60s
|
# sleepInterval: 60s
|
||||||
# sources: [all]
|
# labelSources: [all]
|
||||||
# klog:
|
# klog:
|
||||||
# addDirHeader: false
|
# addDirHeader: false
|
||||||
# alsologtostderr: false
|
# alsologtostderr: false
|
||||||
|
|
|
@ -136,12 +136,14 @@ Example:
|
||||||
nfd-worker -server-name-override=localhost
|
nfd-worker -server-name-override=localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
### -sources
|
### -label-sources
|
||||||
|
|
||||||
The `-sources` flag specifies a comma-separated list of enabled feature
|
The `-label-sources` flag specifies a comma-separated list of enabled label
|
||||||
sources. A special value `all` enables all feature sources.
|
sources. A special value `all` enables all sources. Consider using the
|
||||||
|
`core.labelSources` config file option, instead, allowing dynamic
|
||||||
|
configurability.
|
||||||
|
|
||||||
Note: This flag takes precedence over the `core.sources` configuration
|
Note: This flag takes precedence over the `core.labelSources` configuration
|
||||||
file option.
|
file option.
|
||||||
|
|
||||||
Default: all
|
Default: all
|
||||||
|
@ -149,11 +151,12 @@ Default: all
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nfd-worker -sources=kernel,system,local
|
nfd-worker -label-sources=kernel,system,local
|
||||||
```
|
```
|
||||||
|
|
||||||
**DEPRECATED**: you should use the `core.sources` option in the
|
### -sources
|
||||||
configuration file, instead.
|
|
||||||
|
**DEPRECATED**: use [`-label-sources`](#-label-sources) instead.
|
||||||
|
|
||||||
### -no-publish
|
### -no-publish
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,12 @@ core:
|
||||||
sleepInterval: 60s
|
sleepInterval: 60s
|
||||||
```
|
```
|
||||||
|
|
||||||
### core.sources
|
### core.labelSources
|
||||||
|
|
||||||
`core.sources` specifies the list of enabled feature sources. A special value
|
`core.labelSources` specifies the list of enabled label sources. A special
|
||||||
`all` enables all feature sources.
|
value `all` enables all sources.
|
||||||
|
|
||||||
Note: Overridden by the deprecated `-sources` command line flag (if
|
Note: Overridden by the `-label-sources` command line flag (if specified).
|
||||||
specified).
|
|
||||||
|
|
||||||
Default: `[all]`
|
Default: `[all]`
|
||||||
|
|
||||||
|
@ -62,6 +61,13 @@ core:
|
||||||
- custom
|
- custom
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### core.sources
|
||||||
|
|
||||||
|
**DEPRECATED**: use [`core.labelSources`](#core.labelSources) instead.
|
||||||
|
|
||||||
|
Note: `core.sources` takes precedence over the `core.labelSources`
|
||||||
|
configuration file option.
|
||||||
|
|
||||||
### core.labelWhiteList
|
### core.labelWhiteList
|
||||||
|
|
||||||
`core.labelWhiteList` specifies a regular expression for filtering feature
|
`core.labelWhiteList` specifies a regular expression for filtering feature
|
||||||
|
|
|
@ -50,7 +50,8 @@ The last component (i.e. `attribute-name`) is optional, and only used if a
|
||||||
feature logically has sub-hierarchy, e.g. `sriov.capable` and
|
feature logically has sub-hierarchy, e.g. `sriov.capable` and
|
||||||
`sriov.configure` from the `network` source.
|
`sriov.configure` from the `network` source.
|
||||||
|
|
||||||
The `-sources` flag controls which sources to use for discovery.
|
The `-label-sources` flag controls which sources to enable for label
|
||||||
|
generation.
|
||||||
|
|
||||||
*Note: Consecutive runs of nfd-worker will update the labels on a
|
*Note: Consecutive runs of nfd-worker will update the labels on a
|
||||||
given node. If features are not discovered on a consecutive run, the corresponding
|
given node. If features are not discovered on a consecutive run, the corresponding
|
||||||
|
|
|
@ -100,22 +100,22 @@ func TestConfigParse(t *testing.T) {
|
||||||
w, err := NewNfdWorker(&Args{})
|
w, err := NewNfdWorker(&Args{})
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
worker := w.(*nfdWorker)
|
worker := w.(*nfdWorker)
|
||||||
overrides := `{"core": {"sources": ["fake"],"noPublish": true},"sources": {"cpu": {"cpuid": {"attributeBlacklist": ["foo","bar"]}}}}`
|
overrides := `{"core": {"labelSources": ["fake"],"noPublish": true},"sources": {"cpu": {"cpuid": {"attributeBlacklist": ["foo","bar"]}}}}`
|
||||||
|
|
||||||
Convey("and no core cmdline flags have been specified", func() {
|
Convey("and no core cmdline flags have been specified", func() {
|
||||||
So(worker.configure("non-existing-file", overrides), ShouldBeNil)
|
So(worker.configure("non-existing-file", overrides), ShouldBeNil)
|
||||||
|
|
||||||
Convey("core overrides should be in effect", func() {
|
Convey("core overrides should be in effect", func() {
|
||||||
So(worker.config.Core.Sources, ShouldResemble, []string{"fake"})
|
So(worker.config.Core.LabelSources, ShouldResemble, []string{"fake"})
|
||||||
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Convey("and a non-accessible file, but core cmdline flags and some overrides are specified", func() {
|
Convey("and a non-accessible file, but core cmdline flags and some overrides are specified", func() {
|
||||||
worker.args = Args{Overrides: ConfigOverrideArgs{Sources: &utils.StringSliceVal{"cpu", "kernel", "pci"}}}
|
worker.args = Args{Overrides: ConfigOverrideArgs{LabelSources: &utils.StringSliceVal{"cpu", "kernel", "pci"}}}
|
||||||
So(worker.configure("non-existing-file", overrides), ShouldBeNil)
|
So(worker.configure("non-existing-file", overrides), ShouldBeNil)
|
||||||
|
|
||||||
Convey("core cmdline flags should be in effect instead overrides", func() {
|
Convey("core cmdline flags should be in effect instead overrides", func() {
|
||||||
So(worker.config.Core.Sources, ShouldResemble, []string{"cpu", "kernel", "pci"})
|
So(worker.config.Core.LabelSources, ShouldResemble, []string{"cpu", "kernel", "pci"})
|
||||||
})
|
})
|
||||||
Convey("overrides should take effect", func() {
|
Convey("overrides should take effect", func() {
|
||||||
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
||||||
|
@ -145,13 +145,13 @@ sources:
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
|
|
||||||
Convey("and a proper config file is specified", func() {
|
Convey("and a proper config file is specified", func() {
|
||||||
worker.args = Args{Overrides: ConfigOverrideArgs{Sources: &utils.StringSliceVal{"cpu", "kernel", "pci"}}}
|
worker.args = Args{Overrides: ConfigOverrideArgs{LabelSources: &utils.StringSliceVal{"cpu", "kernel", "pci"}}}
|
||||||
So(worker.configure(f.Name(), ""), ShouldBeNil)
|
So(worker.configure(f.Name(), ""), ShouldBeNil)
|
||||||
|
|
||||||
Convey("specified configuration should take effect", func() {
|
Convey("specified configuration should take effect", func() {
|
||||||
// Verify core config
|
// Verify core config
|
||||||
So(worker.config.Core.NoPublish, ShouldBeFalse)
|
So(worker.config.Core.NoPublish, ShouldBeFalse)
|
||||||
So(worker.config.Core.Sources, ShouldResemble, []string{"cpu", "kernel", "pci"}) // from cmdline
|
So(worker.config.Core.LabelSources, ShouldResemble, []string{"cpu", "kernel", "pci"}) // from cmdline
|
||||||
So(worker.config.Core.LabelWhiteList.String(), ShouldEqual, "foo")
|
So(worker.config.Core.LabelWhiteList.String(), ShouldEqual, "foo")
|
||||||
So(worker.config.Core.SleepInterval.Duration, ShouldEqual, 10*time.Second)
|
So(worker.config.Core.SleepInterval.Duration, ShouldEqual, 10*time.Second)
|
||||||
|
|
||||||
|
@ -167,13 +167,13 @@ sources:
|
||||||
Convey("and a proper config file and overrides are given", func() {
|
Convey("and a proper config file and overrides are given", func() {
|
||||||
sleepIntervalArg := 15 * time.Second
|
sleepIntervalArg := 15 * time.Second
|
||||||
worker.args = Args{Overrides: ConfigOverrideArgs{SleepInterval: &sleepIntervalArg}}
|
worker.args = Args{Overrides: ConfigOverrideArgs{SleepInterval: &sleepIntervalArg}}
|
||||||
overrides := `{"core": {"sources": ["fake"],"noPublish": true},"sources": {"pci": {"deviceClassWhitelist": ["03"]}}}`
|
overrides := `{"core": {"labelSources": ["fake"],"noPublish": true},"sources": {"pci": {"deviceClassWhitelist": ["03"]}}}`
|
||||||
So(worker.configure(f.Name(), overrides), ShouldBeNil)
|
So(worker.configure(f.Name(), overrides), ShouldBeNil)
|
||||||
|
|
||||||
Convey("overrides should take precedence over the config file", func() {
|
Convey("overrides should take precedence over the config file", func() {
|
||||||
// Verify core config
|
// Verify core config
|
||||||
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
So(worker.config.Core.NoPublish, ShouldBeTrue)
|
||||||
So(worker.config.Core.Sources, ShouldResemble, []string{"fake"}) // from overrides
|
So(worker.config.Core.LabelSources, ShouldResemble, []string{"fake"}) // from overrides
|
||||||
So(worker.config.Core.LabelWhiteList.String(), ShouldEqual, "foo")
|
So(worker.config.Core.LabelWhiteList.String(), ShouldEqual, "foo")
|
||||||
So(worker.config.Core.SleepInterval.Duration, ShouldEqual, 15*time.Second) // from cmdline
|
So(worker.config.Core.SleepInterval.Duration, ShouldEqual, 15*time.Second) // from cmdline
|
||||||
|
|
||||||
|
@ -220,8 +220,8 @@ core:
|
||||||
w, err := NewNfdWorker(&Args{
|
w, err := NewNfdWorker(&Args{
|
||||||
ConfigFile: configFile,
|
ConfigFile: configFile,
|
||||||
Overrides: ConfigOverrideArgs{
|
Overrides: ConfigOverrideArgs{
|
||||||
Sources: &utils.StringSliceVal{"fake"},
|
LabelSources: &utils.StringSliceVal{"fake"},
|
||||||
NoPublish: &noPublish},
|
NoPublish: &noPublish},
|
||||||
})
|
})
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
worker := w.(*nfdWorker)
|
worker := w.(*nfdWorker)
|
||||||
|
@ -314,7 +314,7 @@ func TestNewNfdWorker(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("with non-empty Sources arg specified", func() {
|
Convey("with non-empty Sources arg specified", func() {
|
||||||
args := &Args{Overrides: ConfigOverrideArgs{Sources: &utils.StringSliceVal{"fake"}}}
|
args := &Args{Overrides: ConfigOverrideArgs{LabelSources: &utils.StringSliceVal{"fake"}}}
|
||||||
w, err := NewNfdWorker(args)
|
w, err := NewNfdWorker(args)
|
||||||
Convey("no error should be returned", func() {
|
Convey("no error should be returned", func() {
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
|
|
|
@ -64,7 +64,8 @@ type coreConfig struct {
|
||||||
Klog map[string]string
|
Klog map[string]string
|
||||||
LabelWhiteList utils.RegexpVal
|
LabelWhiteList utils.RegexpVal
|
||||||
NoPublish bool
|
NoPublish bool
|
||||||
Sources []string
|
Sources *[]string
|
||||||
|
LabelSources []string
|
||||||
SleepInterval duration
|
SleepInterval duration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +93,7 @@ type ConfigOverrideArgs struct {
|
||||||
// Deprecated
|
// Deprecated
|
||||||
LabelWhiteList *utils.RegexpVal
|
LabelWhiteList *utils.RegexpVal
|
||||||
SleepInterval *time.Duration
|
SleepInterval *time.Duration
|
||||||
Sources *utils.StringSliceVal
|
LabelSources *utils.StringSliceVal
|
||||||
}
|
}
|
||||||
|
|
||||||
type nfdWorker struct {
|
type nfdWorker struct {
|
||||||
|
@ -138,7 +139,7 @@ func newDefaultConfig() *NFDConfig {
|
||||||
Core: coreConfig{
|
Core: coreConfig{
|
||||||
LabelWhiteList: utils.RegexpVal{Regexp: *regexp.MustCompile("")},
|
LabelWhiteList: utils.RegexpVal{Regexp: *regexp.MustCompile("")},
|
||||||
SleepInterval: duration{60 * time.Second},
|
SleepInterval: duration{60 * time.Second},
|
||||||
Sources: []string{"all"},
|
LabelSources: []string{"all"},
|
||||||
Klog: make(map[string]string),
|
Klog: make(map[string]string),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -294,7 +295,7 @@ func (w *nfdWorker) configureCore(c coreConfig) error {
|
||||||
|
|
||||||
// Determine enabled feature sources
|
// Determine enabled feature sources
|
||||||
enabled := make(map[string]source.LabelSource)
|
enabled := make(map[string]source.LabelSource)
|
||||||
for _, name := range c.Sources {
|
for _, name := range c.LabelSources {
|
||||||
if name == "all" {
|
if name == "all" {
|
||||||
for n, s := range source.GetAllLabelSources() {
|
for n, s := range source.GetAllLabelSources() {
|
||||||
if ts, ok := s.(source.TestSource); !ok || !ts.IsTestSource() {
|
if ts, ok := s.(source.TestSource); !ok || !ts.IsTestSource() {
|
||||||
|
@ -358,6 +359,12 @@ func (w *nfdWorker) configure(filepath string, overrides string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to parse config file: %s", err)
|
return fmt.Errorf("failed to parse config file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Core.Sources != nil {
|
||||||
|
klog.Warningf("found deprecated 'core.sources' config file option, please use 'core.labelSources' instead")
|
||||||
|
c.Core.LabelSources = *c.Core.Sources
|
||||||
|
}
|
||||||
|
|
||||||
klog.Infof("configuration file %q parsed", filepath)
|
klog.Infof("configuration file %q parsed", filepath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -376,8 +383,8 @@ func (w *nfdWorker) configure(filepath string, overrides string) error {
|
||||||
if w.args.Overrides.SleepInterval != nil {
|
if w.args.Overrides.SleepInterval != nil {
|
||||||
c.Core.SleepInterval = duration{*w.args.Overrides.SleepInterval}
|
c.Core.SleepInterval = duration{*w.args.Overrides.SleepInterval}
|
||||||
}
|
}
|
||||||
if w.args.Overrides.Sources != nil {
|
if w.args.Overrides.LabelSources != nil {
|
||||||
c.Core.Sources = *w.args.Overrides.Sources
|
c.Core.LabelSources = *w.args.Overrides.LabelSources
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Core.sanitize()
|
c.Core.sanitize()
|
||||||
|
|
|
@ -97,7 +97,7 @@ func TestRun(t *testing.T) {
|
||||||
Args: nfdclient.Args{
|
Args: nfdclient.Args{
|
||||||
Server: "localhost:8192"},
|
Server: "localhost:8192"},
|
||||||
Oneshot: true,
|
Oneshot: true,
|
||||||
Overrides: worker.ConfigOverrideArgs{Sources: &utils.StringSliceVal{"fake"}},
|
Overrides: worker.ConfigOverrideArgs{LabelSources: &utils.StringSliceVal{"fake"}},
|
||||||
}
|
}
|
||||||
fooasdf, _ := worker.NewNfdWorker(args)
|
fooasdf, _ := worker.NewNfdWorker(args)
|
||||||
err := fooasdf.Run()
|
err := fooasdf.Run()
|
||||||
|
@ -128,7 +128,7 @@ func TestRunTls(t *testing.T) {
|
||||||
ServerNameOverride: "nfd-test-master",
|
ServerNameOverride: "nfd-test-master",
|
||||||
},
|
},
|
||||||
Oneshot: true,
|
Oneshot: true,
|
||||||
Overrides: worker.ConfigOverrideArgs{Sources: &utils.StringSliceVal{"fake"}},
|
Overrides: worker.ConfigOverrideArgs{LabelSources: &utils.StringSliceVal{"fake"}},
|
||||||
}
|
}
|
||||||
w, _ := worker.NewNfdWorker(&workerArgs)
|
w, _ := worker.NewNfdWorker(&workerArgs)
|
||||||
err := w.Run()
|
err := w.Run()
|
||||||
|
|
Loading…
Add table
Reference in a new issue