-
Notifications
You must be signed in to change notification settings - Fork 384
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
[feature] adapt k8s v1.20 version #705
Conversation
@rambohe-ch: GitHub didn't allow me to assign the following users: your_reviewer. Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
7a57436
to
64e3eb9
Compare
/hold |
sharedInformers.Certificates().V1().CertificateSigningRequests().Informer().AddEventHandler(handler) | ||
hasSynced = sharedInformers.Certificates().V1().CertificateSigningRequests().Informer().HasSynced | ||
getCsr = sharedInformers.Certificates().V1().CertificateSigningRequests().Lister().Get | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this branch will never work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
return v1beta1err | ||
} | ||
|
||
func v1Csr2v1beta1Csr(csr *certificatesv1.CertificateSigningRequest) *certificatesv1beta1.CertificateSigningRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about use conversion func like Convert_v1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList
which provided by k8s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we need to import k8s.io/kubernetes, so we provide these funcs.
nc.evictorLock.Lock() | ||
defer nc.evictorLock.Unlock() | ||
if status == v1.ConditionFalse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't need judgment of status there.
The use of markNodeForTainting
will judge the status(in func processTaintBaseEviction
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This judgement is imported from upstream kubernetes. you can reference from pull request here: kubernetes/kubernetes#89059
) | ||
|
||
// fileStoreWrapper is a wrapper for "k8s.io/client-go/util/certificate#FileStore" | ||
// fileStoreWrapper is a wrapper for "github.com/openyurtio/openyurt/pkg/util/certificate#FileStore" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use k8s.io/client-go
? Did we modify something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GetZoneKey(...)
function in openyurt/pkg/controller/kubernetes/util/node/node.go
has been replaced by k8s.io/component-helpers/node/topology/helps.go
in the code, so we can delete this useless function.
@@ -90,7 +90,7 @@ var ( | |||
// CheckServantJobPeriod defines the time interval between two successive ServantJob statu's inspection | |||
CheckServantJobPeriod = time.Second * 10 | |||
// ValidServerVersions contains all compatible server version | |||
// yurtctl only support Kubernetes 1.12+ - 1.16+ for now | |||
// yurtctl only support Kubernetes 1.12+ - 1.23+ for now | |||
ValidServerVersions = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable seems to have the same effect as the ValidServerVersions
in openyurt/pkg/yurtctl/cmd/convert/options.go
. How about merging the two variables together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
ok |
64e3eb9
to
e640cfc
Compare
} | ||
} | ||
return nil | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just testing if len(args) > 0
, instead of a range loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to avoid influence from empty args, so a range loop used. and these code snippet is imported from upstream kubernetes.
k8s.io/kube-controller-manager v0.22.3 | ||
k8s.io/kubelet v0.22.3 | ||
k8s.io/system-validators v1.6.0 | ||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In require block, how about directly using k8s.io/api v0.22.3
, k8s.io/klog/v2 v2.9.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rambohe-ch BTW, cloud I know the reason why we need to require and replace the package with the same version, such as :
require (
...
k8s.io/apimachinery v0.22.3
...
)
replace (
...
k8s.io/apimachinery => k8s.io/apimachinery v0.22.3
...
)
In my mind, we just need to do so for sigs.k8s.io/apiserver-network-proxy v0.0.15
, because we forked it and modified for openyurt.
Thanks.
e640cfc
to
0e7d9ca
Compare
After this pr, how about updating the k8s version of e2e test to 1.22? |
@Congrool Would you be able to make a pull request to update e2e test? |
Sure, but things seem to be more complicate than just updating kind node image. |
/hold cancel |
/lgtm |
/lgtm |
/approve |
/hold |
0e7d9ca
to
1b51ec2
Compare
22bd284
to
fb99b04
Compare
fb99b04
to
4215dc1
Compare
/hold cancel |
/lgtm |
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huangyuqi, kadisi, rambohe-ch 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 |
/lgtm |
[feature] adapt k8s v1.20 version
What type of PR is this?
/kind feature
What this PR does / why we need it:
update k8s version to v1.20.11, the main modify points as following:
Which issue(s) this PR fixes:
Fixes #682
Special notes for your reviewer:
Does this PR introduce a user-facing change?
other Note