Skip to content

Commit

Permalink
Merge pull request #520 from brandond/fix_373
Browse files Browse the repository at this point in the history
Fix startup with missing etcd static pod manifest
  • Loading branch information
davidnuzik authored Nov 10, 2020
2 parents 0dcc727 + 06d7fa0 commit fff78d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/podexecutor/staticpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"io/ioutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/http"
"os"
"os/exec"
Expand All @@ -21,6 +20,7 @@ import (
"github.com/rancher/rke2/pkg/staticpod"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
auditv1 "k8s.io/apiserver/pkg/apis/audit/v1"
"k8s.io/apiserver/pkg/authentication/authenticator"
"sigs.k8s.io/yaml"
Expand Down Expand Up @@ -187,7 +187,7 @@ func (s *StaticPodConfig) ControllerManager(apiReady <-chan struct{}, args []str
func (s *StaticPodConfig) CurrentETCDOptions() (opts executor.InitialOptions, err error) {
bytes, err := ioutil.ReadFile(filepath.Join(s.ManifestsDir, "etcd.yaml"))
if os.IsNotExist(err) {
return
return opts, nil
}

pod := &v1.Pod{}
Expand All @@ -200,7 +200,7 @@ func (s *StaticPodConfig) CurrentETCDOptions() (opts executor.InitialOptions, er
return opts, json.NewDecoder(strings.NewReader(v)).Decode(&opts)
}

return
return opts, nil
}

// ETCD starts the etcd static pod.
Expand Down

0 comments on commit fff78d8

Please sign in to comment.