sealer
sealer copied to clipboard
refactor: replace kubectl operation with k8s apiclient call
Signed-off-by: Allen Sun [email protected]
Describe what this PR does / why we need it
- remove several const values which are never used:
RemoteApplyYaml
,RemoteCmdGetNetworkInterface
,RemoteCmdExistNetworkInterface
; - Use built-in package
k8s.Client
when executingkubectl
command, likekubectl delete node xxx
,kubectl get nodes
; After this pull request, there are still some kubectl command there, likekubectl drain
andkubectl uncordon
in upgrade operation. I found that k8s.Client has not containeddrain
anduncordon
command, and we should use another kubernetes/kubectl package to cover the above both. - rename function
isHostName
intoisHostInExistingCluster
to be more readable. - 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