sealer icon indicating copy to clipboard operation
sealer copied to clipboard

refactor: replace kubectl operation with k8s apiclient call

Open allencloud opened this issue 2 years ago • 0 comments

Signed-off-by: Allen Sun [email protected]

Describe what this PR does / why we need it

  1. remove several const values which are never used: RemoteApplyYaml, RemoteCmdGetNetworkInterface, RemoteCmdExistNetworkInterface;
  2. Use built-in package k8s.Client when executing kubectl command, like kubectl delete node xxx, kubectl get nodes; After this pull request, there are still some kubectl command there, like kubectl drain and kubectl uncordon in upgrade operation. I found that k8s.Client has not contained drain and uncordon command, and we should use another kubernetes/kubectl package to cover the above both.
  3. rename function isHostName into isHostInExistingCluster to be more readable.
  4. flatten the struct runtime.Runtime to avoid useless embedding.

Does this pull request fix one issue?

none

Describe how you did it

none

Describe how to verify it

none

Special notes for reviews

allencloud avatar Sep 28 '22 09:09 allencloud