Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #19066 Print warnings when deprecated options are configured in config file #19148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mansoor17syed
Copy link

fix for #19066 Print warnings when deprecated options are configured in config file

Issue Details
Add warnings when deprecated options are configured
Problem: Currently, etcd doesn't warn users when they configure deprecated options
Goal: Improve user experience by warning about deprecated configurations before they're removed
Solution Overview

Implementation Location: server/config/config.go

@k8s-ci-robot
Copy link

Hi @mansoor17syed. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@serathius
Copy link
Member

/ok-to-test

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.81%. Comparing base (d5231c7) to head (d398945).
Report is 24 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
server/etcdmain/config.go 71.05% <100.00%> (+3.28%) ⬆️

... and 27 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19148      +/-   ##
==========================================
+ Coverage   68.77%   68.81%   +0.04%     
==========================================
  Files         420      420              
  Lines       35640    35649       +9     
==========================================
+ Hits        24510    24531      +21     
+ Misses       9704     9694      -10     
+ Partials     1426     1424       -2     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3388e2b...d398945. Read the comment docs.

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

This PR doesn't fix #19066 . Please follow #18998 (comment)

Thanks anyway

@mansoor17syed
Copy link
Author

Hi @ahrtr

Thank you for the review and feedback!

I initially assumed that the comment in the earlier PR referred specifically to their changes. Could you please confirm if the fix for issue #19066 is intended to address the comment you provided here : #18998 (comment)

Appreciate your clarification!

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

Could you please confirm if the fix for issue #19066 is intended to address the comment you provided here : #18998 (comment)

YES

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

I just realised that we can iterate FlagsExplicitlySet directly in parse(). Both configFromFile and configFromCmdLine populate the data structure with all flags,

FlagsExplicitlySet map[string]bool

sorry for the back and forth.

@mansoor17syed
Copy link
Author

@ahrtr

Can you Please have a look once now if I have done the right changes
I see one tests failing , but I guess the failure is not because of my changes

Still open for feedback and suggestions
do let me know

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

@mansoor17syed The change looks good. Please squash the commits

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

Could you please also add a test to cover the config file case?

@k8s-ci-robot k8s-ci-robot added size/L and removed size/S labels Jan 9, 2025
@mansoor17syed mansoor17syed force-pushed the issue_19066 branch 3 times, most recently from 98f23c0 to 70b0e50 Compare January 10, 2025 05:14
@mansoor17syed
Copy link
Author

@ahrtr

can chk now I have added the UT but some seems failing I doubt its because of my changes.
Still open for feedback and suggestions
do let me know

server/etcdmain/config_test.go Outdated Show resolved Hide resolved
server/etcdmain/config_test.go Outdated Show resolved Hide resolved
server/etcdmain/config_test.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

Please squash the commits.

@mansoor17syed
Copy link
Author

@ahrtr @serathius
can you Please have a look into it now, addressed all the review comments and squashed the commits.

@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

/test pull-etcd-robustness-arm64

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, mansoor17syed

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

The pull request process is described here

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

@mansoor17syed
Copy link
Author

I don’t seem to have the permissions to merge this. @ahrtr Could you kindly take care of it?
Thanks so much for all your support and valuable feedback! 😊

@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

Usually a PR needs two approval to be merged. Let's wait one of other maintainers or reviewers to take a look. thx

}

// Compare sets of flags
if !reflect.DeepEqual(foundFlags, tc.expectedFlags) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use assert.Equal?


// Special check for experimental-warning-unary-request-duration
if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 {
t.Log("Note: experimental-warning-unary-request-duration deprecation is handled separately")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why log here? if we want to leave context a comment would be enough.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will chk this

@mansoor17syed
Copy link
Author

@serathius

can you have a look now ?
Do let me know for any rework

Use minimal config struct for YAML marshaling.
Replace custom mapToSortedSlice with standard library functions.
Fix flag verification for deprecated experimental options.

Fixes etcd-io#19066

Signed-off-by: mansoora <[email protected]>

test: fix TestConfigFileDeprecatedOptions

Use minimal config struct for YAML marshaling.
Replace custom mapToSortedSlice with standard library functions.
Fix flag verification for deprecated experimental options.

Fixes etcd-io#19066

Signed-off-by: mansoora <[email protected]>
@k8s-ci-robot
Copy link

@mansoor17syed: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-verify d398945 link true /test pull-etcd-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants