Skip to content

Commit

Permalink
Merge pull request #1182 from fmuyassarov/disable-hooks-by-default
Browse files Browse the repository at this point in the history
hooks: disable hooks by default from v0.14
  • Loading branch information
k8s-ci-robot committed Jun 22, 2023
2 parents aa55cd5 + 19527be commit 407a610
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/node-feature-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/worker-configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/customization-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion source/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand All @@ -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 {
Expand Down

0 comments on commit 407a610

Please sign in to comment.