Skip to content

Commit

Permalink
chore: 🚚 rename ignore_deprecated_resource to ignore_deprecated_resou…
Browse files Browse the repository at this point in the history
…rces

Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi committed Sep 8, 2023
1 parent 6c2e5cb commit 1389666
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions receiver/k8sclusterreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following allocatable resource types are available.
- storage
- `metrics`: Allows to enable/disable metrics.
- `resource_attributes`: Allows to enable/disable resource attributes.
- `ignore_deprecated_resource` (default = `false`): Whether to ignore deprecated Kubernetes API resources. If set to true,
- `ignore_deprecated_resources` (default = `false`): Whether to ignore deprecated Kubernetes API resources. If set to true,
the receiver will not collect metrics for deprecated resources. This setting is useful for clusters that have deprecated
resources that are not used anymore and are causing errors or warnings in the logs.

Expand All @@ -84,7 +84,7 @@ Example:
resource_attributes:
container.id:
enabled: false
ignore_deprecated_resource: true
ignore_deprecated_resources: true
```
The full list of settings exposed for this receiver are documented [here](./config.go)
Expand Down
2 changes: 1 addition & 1 deletion receiver/k8sclusterreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Config struct {
metadata.MetricsBuilderConfig `mapstructure:",squash"`

// Whether to ignore deprecated resources or not.
IgnoreDeprecatedResource bool `mapstructure:"ignore_deprecated_resource"`
IgnoreDeprecatedResources bool `mapstructure:"ignore_deprecated_resources"`
}

func (cfg *Config) Validate() error {
Expand Down
4 changes: 2 additions & 2 deletions receiver/k8sclusterreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
defaultCollectionInterval = 10 * time.Second
defaultDistribution = distributionKubernetes
defaultMetadataCollectionInterval = 5 * time.Minute
defaultIgnoreDeprecatedResource = false
defaultIgnoreDeprecatedResources = false
)

var defaultNodeConditionsToReport = []string{"Ready"}
Expand All @@ -38,7 +38,7 @@ func createDefaultConfig() component.Config {
},
MetadataCollectionInterval: defaultMetadataCollectionInterval,
MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
IgnoreDeprecatedResource: defaultIgnoreDeprecatedResource,
IgnoreDeprecatedResources: defaultIgnoreDeprecatedResources,
}
}

Expand Down
2 changes: 1 addition & 1 deletion receiver/k8sclusterreceiver/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ k8s_cluster/all_settings:
allocatable_types_to_report: [ "cpu","memory" ]
metadata_exporters: [ nop ]
metadata_collection_interval: 30m
ignore_deprecated_resource: false
ignore_deprecated_resources: false
k8s_cluster/partial_settings:
collection_interval: 30s
distribution: openshift
2 changes: 1 addition & 1 deletion receiver/k8sclusterreceiver/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (rw *resourceWatcher) prepareSharedInformerFactory() error {
"Job": {gvk.Job},
}

if !rw.config.IgnoreDeprecatedResource {
if !rw.config.IgnoreDeprecatedResources {
supportedKinds["CronJob"] = []schema.GroupVersionKind{gvk.CronJob, gvk.CronJobBeta}
supportedKinds["HorizontalPodAutoscaler"] = []schema.GroupVersionKind{gvk.HorizontalPodAutoscaler, gvk.HorizontalPodAutoscalerBeta}
} else {
Expand Down

0 comments on commit 1389666

Please sign in to comment.