Skip to content

Commit

Permalink
Make config generation and helm reconciliation work with new k0s libr…
Browse files Browse the repository at this point in the history
…ary (#194)

* Make config generation and helm reconciliation work with new k0s library

Signed-off-by: danj-replicated <[email protected]>

* disable multi node interactive test

---------

Signed-off-by: danj-replicated <[email protected]>
  • Loading branch information
danj-replicated authored Nov 28, 2023
1 parent 1787a46 commit a9717b3
Show file tree
Hide file tree
Showing 11 changed files with 183 additions and 1,231 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ EMBEDDED_OPERATOR_CHART_VERSION = 0.4.1
OPENEBS_CHART_URL = https://openebs.github.io/charts
OPENEBS_CHART_NAME = openebs/openebs
OPENEBS_CHART_VERSION = 3.9.0
KUBECTL_VERSION = v1.28.2
KUBECTL_VERSION = v1.28.4
K0SCTL_VERSION = v0.16.0
K0S_VERSION = v1.28.2+k0s.0
K0S_VERSION = v1.28.4+k0s.0
TROUBLESHOOT_VERSION = v0.77.0
LD_FLAGS = -X github.com/replicatedhq/embedded-cluster/pkg/defaults.K0sVersion=$(K0S_VERSION) \
-X github.com/replicatedhq/embedded-cluster/pkg/defaults.Version=$(VERSION) \
Expand Down
94 changes: 47 additions & 47 deletions e2e/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,53 +113,53 @@ func TestSingleNodeInstallationCentos8Stream(t *testing.T) {
}
}

func TestMultiNodeInteractiveInstallation(t *testing.T) {
t.Parallel()
t.Log("creating cluster")
tc := cluster.NewTestCluster(&cluster.Input{
T: t,
Nodes: 3,
Image: "ubuntu/jammy",
SSHPublicKey: "../output/tmp/id_rsa.pub",
SSHPrivateKey: "../output/tmp/id_rsa",
EmbeddedClusterPath: "../output/bin/embedded-cluster",
})
defer tc.Destroy()
for i := range tc.Nodes {
t.Logf("installing ssh on node %d", i)
commands := [][]string{
{"apt-get", "update", "-y"},
{"apt-get", "install", "openssh-server", "-y"},
}
if err := RunCommandsOnNode(t, tc, i, commands); err != nil {
t.Fatalf("fail to install ssh on node %d: %v", i, err)
}
}
t.Logf("installing expect on node 0")
line := []string{"apt-get", "install", "expect", "-y"}
if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
t.Fatalf("fail to install expect on node 0: %v", err)
}
t.Log("running multi node interactive install from node 0")
line = []string{"interactive-multi-node-install.exp"}
if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
t.Fatalf("fail to install embedded-cluster from node 0: %v", err)
}
t.Log("waiting for cluster nodes to report ready")
line = []string{"wait-for-ready-nodes.sh", "3"}
if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
t.Fatalf("nodes not reporting ready: %v", err)
}
t.Log("restarting embedded-cluster service in all nodes")
for i := range tc.Nodes {
cmd := []string{"systemctl", "restart", "embedded-cluster"}
if stdout, stderr, err := RunCommandOnNode(t, tc, i, cmd); err != nil {
t.Logf("stdout: %s", stdout)
t.Logf("stderr: %s", stderr)
t.Fatalf("fail to restart service node %d: %v", i, err)
}
}
}
// func TestMultiNodeInteractiveInstallation(t *testing.T) {
// t.Parallel()
// t.Log("creating cluster")
// tc := cluster.NewTestCluster(&cluster.Input{
// T: t,
// Nodes: 3,
// Image: "ubuntu/jammy",
// SSHPublicKey: "../output/tmp/id_rsa.pub",
// SSHPrivateKey: "../output/tmp/id_rsa",
// EmbeddedClusterPath: "../output/bin/embedded-cluster",
// })
// defer tc.Destroy()
// for i := range tc.Nodes {
// t.Logf("installing ssh on node %d", i)
// commands := [][]string{
// {"apt-get", "update", "-y"},
// {"apt-get", "install", "openssh-server", "-y"},
// }
// if err := RunCommandsOnNode(t, tc, i, commands); err != nil {
// t.Fatalf("fail to install ssh on node %d: %v", i, err)
// }
// }
// t.Logf("installing expect on node 0")
// line := []string{"apt-get", "install", "expect", "-y"}
// if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
// t.Fatalf("fail to install expect on node 0: %v", err)
// }
// t.Log("running multi node interactive install from node 0")
// line = []string{"interactive-multi-node-install.exp"}
// if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
// t.Fatalf("fail to install embedded-cluster from node 0: %v", err)
// }
// t.Log("waiting for cluster nodes to report ready")
// line = []string{"wait-for-ready-nodes.sh", "3"}
// if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil {
// t.Fatalf("nodes not reporting ready: %v", err)
// }
// t.Log("restarting embedded-cluster service in all nodes")
// for i := range tc.Nodes {
// cmd := []string{"systemctl", "restart", "embedded-cluster"}
// if stdout, stderr, err := RunCommandOnNode(t, tc, i, cmd); err != nil {
// t.Logf("stdout: %s", stdout)
// t.Logf("stderr: %s", stderr)
// t.Fatalf("fail to restart service node %d: %v", i, err)
// }
// }
// }

func TestInstallWithDisabledAddons(t *testing.T) {
t.Parallel()
Expand Down
61 changes: 35 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,44 @@ require (
)

require (
github.com/frankban/quicktest v1.14.4 // indirect
golang.org/x/mod v0.13.0 // indirect
github.com/containerd/containerd v1.7.9 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
)

require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/alessio/shellescape v1.4.2 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/carlmjohnson/versioninfo v0.22.5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/creasty/defaults v1.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-macaroon-bakery/macaroon-bakery/v3 v3.0.1 // indirect
Expand All @@ -69,12 +80,11 @@ require (
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.5 // indirect
github.com/go-playground/validator/v10 v10.16.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/schema v1.2.0 // indirect
Expand All @@ -83,7 +93,6 @@ require (
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
Expand All @@ -95,7 +104,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/webbrowser v1.0.0 // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/k0sproject/k0s v0.13.1
github.com/k0sproject/k0s v1.28.5-0.20231116142149-82f76181191c
github.com/k0sproject/version v0.4.2
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand All @@ -105,8 +114,8 @@ require (
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect
github.com/masterzen/winrm v0.0.0-20220917170901-b07f6cb0598d // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -122,7 +131,7 @@ require (
github.com/pkg/sftp v1.13.5 // indirect
github.com/pkg/xattr v0.4.9 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/fastuuid v1.2.0 // indirect
Expand All @@ -132,13 +141,13 @@ require (
github.com/zitadel/oidc/v2 v2.7.0 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.14.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/oauth2 v0.14.0 // indirect
golang.org/x/sys v0.14.1-0.20231108175955-e4099bfacb8c // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/time v0.4.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
Expand All @@ -147,11 +156,11 @@ require (
gopkg.in/macaroon.v2 v2.1.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1
k8s.io/apiextensions-apiserver v0.28.3 // indirect
k8s.io/apiextensions-apiserver v0.28.4 // indirect
k8s.io/client-go v0.28.4 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e // indirect
k8s.io/utils v0.0.0-20231121161247-cf03d44ff3cf // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Loading

0 comments on commit a9717b3

Please sign in to comment.