Skip to content

Commit

Permalink
refactor: yurtctl convert use node-servant in dispatch job (openyurti…
Browse files Browse the repository at this point in the history
…o#617)

1. Remove convert cloudnode/edgenode sub command.
2. Replace the "yurt-servant" job in yurtctl with "node-servant".
3. Automatically set "--cert-ip" to yurt-tunnel-server if the user specify the tunnel server address in "yurtctl convert".
4. Add "--autonomous-nodes" option to "yurtctl convert".

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
DrmagicE and [email protected] authored Dec 1, 2021
1 parent 7937de9 commit dfe309c
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 687 deletions.
7 changes: 6 additions & 1 deletion hack/local_up_openyurt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ readonly BUILD_TARGETS=(
yurtctl
yurt-tunnel-server
yurt-tunnel-agent
yurt-node-servant
)

readonly LOCAL_ARCH=$(go env GOHOSTARCH)
Expand Down Expand Up @@ -192,6 +193,10 @@ function kind_load_images {
if [[ "${bin}" = "yurtctl" ]]; then
imagename="yurtctl-servant-${postfix}"
fi

if [[ "${bin}" = "yurt-node-servant" ]]; then
imagename="node-servant-${postfix}"
fi

echo "loading image ${imagename} to nodes"
local nodesarg=$(echo ${master} ${edgenodes[@]} | sed "s/ /,/g")
Expand Down Expand Up @@ -251,7 +256,7 @@ function convert_to_openyurt {
${yurtctl_dir}/yurtctl convert --provider kubeadm --cloud-nodes ${master} \
--yurthub-image=$(get_image_name "yurthub" ${LOCAL_ARCH}) \
--yurt-controller-manager-image=$(get_image_name "yurt-controller-manager" ${LOCAL_ARCH}) \
--yurtctl-servant-image=$(get_image_name "yurtctl-servant" ${LOCAL_ARCH})
--node-servant-image=$(get_image_name "node-servant" ${LOCAL_ARCH})
# --yurt-tunnel-server-image=$(get_image_name "yurt-tunnel-server" ${LOCAL_ARCH}) \
# --yurt-tunnel-agent-image=$(get_image_name "yurt-tunnel-agent" ${LOCAL_ARCH})

Expand Down
7 changes: 6 additions & 1 deletion pkg/node-servant/convert/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ func (o *Options) Complete(flags *pflag.FlagSet) error {
if err != nil {
return err
}
o.workingMode = util.WorkingMode(workingMode)

wm := util.WorkingMode(workingMode)
if !util.IsSupportedWorkingMode(wm) {
return fmt.Errorf("invalid working mode: %s", workingMode)
}
o.workingMode = wm

return nil
}
70 changes: 0 additions & 70 deletions pkg/yurtctl/cmd/convert/cloudnode.go

This file was deleted.

Loading

0 comments on commit dfe309c

Please sign in to comment.