Skip to content

Commit

Permalink
fix some minor bugs (openyurtio#28)
Browse files Browse the repository at this point in the history
* switch image version

* fix some minor bugs
  • Loading branch information
charleszheng44 authored May 29, 2020
1 parent 65cc87b commit 819ef2c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions config/yurtctl-servant/setup_edgenode
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ spec:
- name: pki
hostPath:
path: __pki_path__
path: /var/lib/minikube/certs
type: Directory
- name: kubernetes
hostPath:
Expand Down Expand Up @@ -116,11 +115,14 @@ preset() {
# setup_yurthub sets up the yurthub pod and wait for the its status to be Running
setup_yurthub() {
provider=$1
declare pki_dir
# put yurt-hub yaml to /etc/kubernetes/manifests
if [ "$provider" == "minikube" ]; then
pki_dir=${MINIKUBE_PKI_DIR}
yurthub_yaml=$(echo "$YURTHUB_TEMPLATE" |
sed 's|__pki_path__|/var/lib/minikube/certs|')
else
pki_dir=/etc/kubernetes/pki
yurthub_yaml=$(echo "$YURTHUB_TEMPLATE" |
sed 's|__pki_path__|/etc/kubernetes/pki|')
fi
Expand All @@ -137,7 +139,7 @@ setup_yurthub() {
/api/v1/namespaces/kube-system/pods/yurt-hub-__node_name__ \
--cert /var/lib/kubelet/pki/kubelet-client-current.pem \
--key /var/lib/kubelet/pki/kubelet-client-current.pem \
--cacert ${MINIKUBE_PKI_DIR}/ca.crt)
--cacert ${pki_dir}/ca.crt)
# yurt-hub pod is not found
if [ -n "$(echo "$podStat" | grep NotFound)" ]; then
retry=$((retry-1))
Expand Down Expand Up @@ -208,7 +210,7 @@ revert_kubelet() {
# remove openyurt's kubelet.conf if exist
[ -f $OPENYURT_DIR/kubelet.conf ] && rm $OPENYURT_DIR/kubelet.conf
# revise the kubelet.service drop-in
sed -i "s|--kubeconfig=.*|--kubeconfig=$KUBELET_CONF|g;" $KUBELET_SVC
sed -i "s|--kubeconfig=.*kubelet.conf|--kubeconfig=$KUBELET_CONF|g;" $KUBELET_SVC
log "revised the kubelet.service drop-in file back to the default"
# reset the kubelete.service
systemctl daemon-reload
Expand Down
3 changes: 2 additions & 1 deletion pkg/yurtctl/cmd/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
appsv1 "k8s.io/api/apps/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
Expand Down Expand Up @@ -185,7 +186,7 @@ func (co *ConvertOptions) RunConvert() error {
if err := co.clientSet.CoreV1().ServiceAccounts("kube-system").
Delete("node-controller", &metav1.DeleteOptions{
PropagationPolicy: &kubeutil.PropagationPolicy,
}); err != nil {
}); err != nil && !apierrors.IsNotFound(err) {
klog.Errorf("fail to delete ServiceAccount(node-controller): %s", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/yurtctl/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
type: Directory
containers:
- name: yurtctl-servant
image: openyurt/yurtctl-servant:edge
image: openyurt/yurtctl-servant:latest
command:
- /bin/sh
- -c
Expand Down
2 changes: 1 addition & 1 deletion pkg/yurtctl/util/kubernetes/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
CheckServantJobPeriod = time.Second * 10
// ValidServerVersion contains all compatable server version
// yurtctl only support Kubernetes 1.12 - 1.14 for now
ValidServerVersions = []string{"1.12", "1.13", "1.14"}
ValidServerVersions = []string{"1.12", "1.12+", "1.13", "1.13+", "1.14", "1.14+"}
)

// YamlToObject deserializes object in yaml format to a runtime.Object
Expand Down

0 comments on commit 819ef2c

Please sign in to comment.