Skip to content

chore(wrapper): removed viper os fallback due to underlying update#2896

Open
bxrne wants to merge 1 commit intokubernetes:mainfrom
bxrne:bxrne/wrapper-cfg-todo
Open

chore(wrapper): removed viper os fallback due to underlying update#2896
bxrne wants to merge 1 commit intokubernetes:mainfrom
bxrne:bxrne/wrapper-cfg-todo

Conversation

@bxrne
Copy link
Copy Markdown

@bxrne bxrne commented Mar 12, 2026

What this PR does / why we need it:

This PR removes a workaround in internal/wrapper.go that was added to handle a bug in viper's ConfigFileNotFoundError (see viper#1783). The workaround used os.Stat as a fallback to check if a config file exists when viper failed to detect it.

Since the viper issue has been resolved, this workaround is no longer needed and can be removed.

Changes made:

  • Removed os.Stat fallback for main config file and for custom resource config file
  • Removed associated TODO comments referencing the viper issue

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

Does not change cardinality - this is a code cleanup with no functional changes, but is in hot path.

Which issue(s) this PR fixes:

#2895

the error handling issue was resolved in v1.2.0
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bxrne
Once this PR has been reviewed and has the lgtm label, please assign catherinef-dev for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 12, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Instrumentation Mar 12, 2026
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 12, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@bhope: The label(s) triage/not-accepted cannot be applied, because the repository doesn't have them.

Details

In response to this:

In KSM we pin to viper v1.21.0. That viper release was cut in Sept 2025 and does not have the fix you are referring to (spf13/viper#2027 ). Unfortunately, we would have to wait until we pin to newer viper release that has that fix (which at the moment there isn't).

/triage not-accepted

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bhope
Copy link
Copy Markdown
Member

bhope commented Mar 17, 2026

In KSM we pin to viper v1.21.0. That viper release was cut in Sept 2025 and does not have the fix you are referring to (spf13/viper#2027 ). Unfortunately, we would have to wait until we pin to newer viper release that has that fix (which at the moment there isn't).

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants