mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 02:37:11 +00:00
Merge pull request #1182 from fmuyassarov/disable-hooks-by-default
hooks: disable hooks by default from v0.14
This commit is contained in:
commit
407a610e0c
5 changed files with 9 additions and 6 deletions
|
@ -77,7 +77,7 @@
|
|||
# - "vendor"
|
||||
# - "device"
|
||||
# local:
|
||||
# hooksEnabled: true
|
||||
# hooksEnabled: false
|
||||
# custom:
|
||||
# # The following feature demonstrates the capabilities of the matchFeatures
|
||||
# - name: "my custom rule"
|
||||
|
|
|
@ -194,7 +194,7 @@ worker:
|
|||
# - "vendor"
|
||||
# - "device"
|
||||
# local:
|
||||
# hooksEnabled: true
|
||||
# hooksEnabled: false
|
||||
# custom:
|
||||
# # The following feature demonstrates the capabilities of the matchFeatures
|
||||
# - name: "my custom rule"
|
||||
|
|
|
@ -347,12 +347,14 @@ Related tracking issues:
|
|||
1. Disable hook support by default [#855](https://github.com/kubernetes-sigs/node-feature-discovery/issues/855).
|
||||
1. Drop support for hooks [#856](https://github.com/kubernetes-sigs/node-feature-discovery/issues/856).
|
||||
|
||||
Default: false
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
sources:
|
||||
local:
|
||||
hooksEnabled: true # true by default
|
||||
hooksEnabled: true
|
||||
```
|
||||
|
||||
### sources.pci
|
||||
|
|
|
@ -278,8 +278,8 @@ trying to execute them. A subdirectory under the hooks directory can be used,
|
|||
for example `/etc/kubernetes/node-feature-discovery/source.d/conf/`.
|
||||
|
||||
**NOTE:** Hooks are being DEPRECATED and will be removed in a future release.
|
||||
For backward compatibility, currently hooks are enabled by default and can be
|
||||
disabled via `sources.local.hooksEnabled` field in the worker configuration.
|
||||
Starting from release v0.14 hooks are disabled by default and can be enabled
|
||||
via `sources.local.hooksEnabled` field in the worker configuration.
|
||||
|
||||
```yaml
|
||||
sources:
|
||||
|
|
|
@ -97,7 +97,7 @@ func (s *localSource) GetLabels() (source.FeatureLabels, error) {
|
|||
// newDefaultConfig returns a new config with pre-populated defaults
|
||||
func newDefaultConfig() *Config {
|
||||
return &Config{
|
||||
HooksEnabled: true,
|
||||
HooksEnabled: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ func (s *localSource) Discover() error {
|
|||
if s.config.HooksEnabled {
|
||||
|
||||
klog.InfoS("starting hooks...")
|
||||
klog.InfoS("NOTE: hooks are deprecated and will be completely removed in a future release.")
|
||||
|
||||
featuresFromHooks, err := getFeaturesFromHooks()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue