Skip to content

Commit

Permalink
Merge pull request #5383 from twz123/inttest-improvements
Browse files Browse the repository at this point in the history
Some small improvements to inttests
  • Loading branch information
twz123 authored Dec 24, 2024
2 parents bdc33ec + 905ee1d commit 08c1af7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions inttest/common/bootloosesuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,15 +817,15 @@ func (s *BootlooseSuite) GetKubeConfig(node string, k0sKubeconfigArgs ...string)
defer ssh.Disconnect()

kubeConfigCmd := fmt.Sprintf("%s kubeconfig admin %s", s.K0sFullPath, strings.Join(k0sKubeconfigArgs, " "))
kubeConf, err := ssh.ExecWithOutput(s.Context(), kubeConfigCmd)
if err != nil {
var kubeConf bytes.Buffer
if err := ssh.Exec(s.Context(), kubeConfigCmd, SSHStreams{Out: &kubeConf}); err != nil {
return nil, err
}
cfg, err := clientcmd.RESTConfigFromKubeConfig([]byte(kubeConf))
cfg, err := clientcmd.RESTConfigFromKubeConfig(kubeConf.Bytes())
s.Require().NoError(err)
// The tests are querying the API server quite a lot, so we need to increase the QPS and Burst
cfg.QPS = 40.0
cfg.Burst = 400.0
s.Require().NoError(err)

hostURL, err := url.Parse(cfg.Host)
if err != nil {
Expand Down
7 changes: 3 additions & 4 deletions inttest/containerdimports/containerd_imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ func (s *ContainerdImportsSuite) TestK0sGetsUp() {
s.Require().NoError(err)
defer ssh.Disconnect()

s.NoError(s.InitController(0))
s.Require().NoError(s.InitController(0))

s.NoError(s.RunWorkers())
s.Require().NoError(s.RunWorkers())

kc, err := s.KubeClient(s.ControllerNode(0))
if err != nil {
s.FailNow("failed to obtain Kubernetes client", err)
}

err = s.WaitForNodeReady(s.WorkerNode(0), kc)
s.NoError(err)
s.Require().NoError(s.WaitForNodeReady(s.WorkerNode(0), kc))

s.AssertSomeKubeSystemPods(kc)

Expand Down

0 comments on commit 08c1af7

Please sign in to comment.