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

Implement checking etcd version to warn about deprecated etcd versions #123264

Closed

Conversation

ah8ad3
Copy link
Member

@ah8ad3 ah8ad3 commented Feb 13, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Implement warning for certain version of Etcd on active feature flag.

Which issue(s) this PR fixes:

Fixes #123192

Special notes for your reviewer:

Warning should trigger on these versions:
<3.4.25
Between 3.5.0 and 3.5.7

Does this PR introduce a user-facing change?

Checking etcd version to warn about deprecated etcd versions if `ConsistentListFromCache` is enabled.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Part of kubernetes/enhancements#2340

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 13, 2024
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 13, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @ah8ad3. Thanks for your PR.

I'm waiting for a kubernetes 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot removed area/cloudprovider area/code-generation area/conformance Issues or PRs related to kubernetes conformance tests area/dependency Issues or PRs related to dependency changes area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/kube-proxy area/kubeadm area/kubectl area/kubelet area/provider/gcp Issues or PRs related to gcp provider area/release-eng Issues or PRs related to the Release Engineering subproject area/stable-metrics Issues or PRs involving stable metrics area/test labels Apr 7, 2024
@ah8ad3
Copy link
Member Author

ah8ad3 commented Apr 7, 2024

/remove-wg structured-logging
/remove-kind api-change
/retest

@k8s-ci-robot k8s-ci-robot removed wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Apr 7, 2024
add feature flag, refactor check version to use parse semantic version

extract subfunctions

refacor code, disable feature after cheking the version

refactor warning on etcd version

add cancel function to context with timeout

separate checkVersionEndpoint from checkVersion to make it more readable

refactor error messages for etcd deprecated warning and some parts of code

update comments of code

update the comments and alter the ErrDeprecatedCluster

change the ErrDeprecatedCluster, fix errors from vet checker

add error check for OverrideDefault

test added, use interface for etcd client to make it lessly couple to etcd

update test expectedError text

fix lint error

fix an error on showing wrong error message

is deprecated function added to storage interface with tests

cleanup test print

refactor lint hint

feature: add Supports to storage.Interface, add FeatureSupportChecker struct

fix: lint error

refactor: create feature_support_checker file, alter Supports function to only recieve one feature

refacor: add cache for supported feature check, change input value of Supports from featuregate to EtcdFeature

refacor: create a new feature for RequestWatchProgress

refactor: change EtcdFeature to Feature, delete some parts in isDeprecated, comment about mutex, construct map

refactor: improving naming and comments of functions and variables

refactor: improving naming and comments of functions and variables

refactor: alter names of functions, simplify check version to only return err, use sync.Map instead of map and mutex, add retry when error came from Status, move RequestWatchProgress to interfaces

refactor: move featuresupportchecker to directory to avoid cycle import error, add global SupportsCache to check the support with featureSupportCache, use Supports in NewCacherFromConfig, use SupportsCache in various parts to check if feature available

refactor: make Supports check synchronous in cache.go, remove retries from failures in features

fix: bugs in cache test fixed, some refacor and improvments in feature_support_checker.go

refacor: minor change

refacor: minor change

refactor: change feature support checker to check support per endpoint

fix: add error on Supports

update-vendor

Update staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

refactor: bad variable rename

fix: fix grammar error, refactor errors

refactor code

fix test

fix bug in watch_cache

miss request watch progress support

minor changes

refactor: change EndpointSupports to ClientSupports, use mutex instead of sync.Map

fix minor argument in SetFeatureSupportCheckerDuringTest

refactor: fix minors

refactor some comments

remove some parts of testing feature

fix: resolve conflicts
@ah8ad3 ah8ad3 force-pushed the add-checking-etcd-version-warn branch from 0a46490 to a9bed84 Compare April 7, 2024 05:56
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 7, 2024

@ah8ad3: The following tests 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-kubernetes-e2e-kind-kms bf8f9bd link false /test pull-kubernetes-e2e-kind-kms
pull-kubernetes-e2e-autoscaling-hpa-cm bf8f9bd link false /test pull-kubernetes-e2e-autoscaling-hpa-cm
pull-kubernetes-conformance-image-test bf8f9bd link false /test pull-kubernetes-conformance-image-test
pull-kubernetes-conformance-kind-ipv6-parallel bf8f9bd link false /test pull-kubernetes-conformance-kind-ipv6-parallel
pull-kubernetes-e2e-gce-providerless bf8f9bd link false /test pull-kubernetes-e2e-gce-providerless
pull-kubernetes-e2e-gci-gce-ipvs bf8f9bd link false /test pull-kubernetes-e2e-gci-gce-ipvs
pull-kubernetes-e2e-autoscaling-hpa-cpu bf8f9bd link false /test pull-kubernetes-e2e-autoscaling-hpa-cpu
pull-kubernetes-kind-dra bf8f9bd link false /test pull-kubernetes-kind-dra
pull-kubernetes-e2e-capz-windows-master bf8f9bd link false /test pull-kubernetes-e2e-capz-windows-master
pull-kubernetes-e2e-gce-network-proxy-http-connect bf8f9bd link true /test pull-kubernetes-e2e-gce-network-proxy-http-connect
pull-kubernetes-e2e-gci-gce-autoscaling bf8f9bd link false /test pull-kubernetes-e2e-gci-gce-autoscaling
pull-kubernetes-local-e2e bf8f9bd link false /test pull-kubernetes-local-e2e
check-dependency-stats bf8f9bd link false /test check-dependency-stats
pull-kubernetes-cross bf8f9bd link false /test pull-kubernetes-cross
pull-kubernetes-e2e-storage-kind-disruptive bf8f9bd link false /test pull-kubernetes-e2e-storage-kind-disruptive
pull-publishing-bot-validate bf8f9bd link false /test pull-publishing-bot-validate
pull-kubernetes-e2e-gce-network-proxy-grpc bf8f9bd link false /test pull-kubernetes-e2e-gce-network-proxy-grpc
pull-kubernetes-e2e-kind-nftables bf8f9bd link false /test pull-kubernetes-e2e-kind-nftables
pull-kubernetes-e2e-gce-network-policies bf8f9bd link false /test pull-kubernetes-e2e-gce-network-policies
pull-kubernetes-e2e-gci-gce-ingress bf8f9bd link false /test pull-kubernetes-e2e-gci-gce-ingress
pull-kubernetes-node-e2e-containerd-1-7-dra bf8f9bd link false /test pull-kubernetes-node-e2e-containerd-1-7-dra
pull-kubernetes-node-e2e-crio-dra bf8f9bd link false /test pull-kubernetes-node-e2e-crio-dra
pull-kubernetes-e2e-gce-storage-slow bf8f9bd link false /test pull-kubernetes-e2e-gce-storage-slow
pull-kubernetes-e2e-gce-storage-snapshot bf8f9bd link false /test pull-kubernetes-e2e-gce-storage-snapshot
pull-kubernetes-e2e-gce-csi-serial bf8f9bd link false /test pull-kubernetes-e2e-gce-csi-serial
pull-kubernetes-unit a9bed84 link true /test pull-kubernetes-unit

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

@wojtek-t wojtek-t self-assigned this Apr 23, 2024
@serathius
Copy link
Contributor

serathius commented Apr 23, 2024

We are revisiting this PR after the code thaw. As mentioned in kubernetes/enhancements#2340 (comment) merging of the PR is one of the next steps.

Hey @ah8ad3 the PR has grown in size, could you split out the code that introduces FeatureSupportChecker to a separate PR? Please let me know if you have time as this is blocking kubernetes/enhancements#2340

@ah8ad3
Copy link
Member Author

ah8ad3 commented Apr 23, 2024

Thanks @wojtek-t , @serathius, i'll try to separate it this week.

@wojtek-t
Copy link
Member

@ah8ad3 - with the other PR already approved, can you please rebase this one on top of it so that we can proceed with making this one happen?

@ah8ad3
Copy link
Member Author

ah8ad3 commented Apr 29, 2024

@wojtek-t Yes. I'm on it.

@wojtek-t
Copy link
Member

Closing in favor of #124612

@wojtek-t wojtek-t closed this Apr 30, 2024
@ah8ad3 ah8ad3 deleted the add-checking-etcd-version-warn branch May 1, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement checking etcd version to warn about deprecated etcd versions