1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

hooks: disable hooks by default

We have deprecated hooks in v0.12.0 but kept it enabled by default.
Starting from v0.14 we are starting to disable it by default and
plan to fully remove it in the near future.

Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
This commit is contained in:
Muyassarov, Feruzjon 2023-04-24 14:35:26 +03:00 committed by Feruzjon Muyassarov
parent d64398f85e
commit 19527be924
No known key found for this signature in database
GPG key ID: A28B315A9D19343F
5 changed files with 9 additions and 6 deletions

View file

@ -76,7 +76,7 @@
# - "vendor"
# - "device"
# local:
# hooksEnabled: true
# hooksEnabled: false
# custom:
# # The following feature demonstrates the capabilities of the matchFeatures
# - name: "my custom rule"

View file

@ -191,7 +191,7 @@ worker:
# - "vendor"
# - "device"
# local:
# hooksEnabled: true
# hooksEnabled: false
# custom:
# # The following feature demonstrates the capabilities of the matchFeatures
# - name: "my custom rule"

View file

@ -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

View file

@ -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:

View file

@ -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 {