Skip to content

Commit bb8a857

Browse files
committed
Merge remote-tracking branch 'origin/main' into k0s-1-29
2 parents 240907a + cc46758 commit bb8a857

File tree

53 files changed

+798
-672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+798
-672
lines changed

.github/workflows/release-prod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ jobs:
428428
LICENSE_ID: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE_ID }}
429429
run: |
430430
export APP_VERSION="appver-${{ github.ref_name }}"
431-
curl -L "https://ec-e2e-replicated-app.testcluster.net/embedded/embedded-cluster-smoke-test-staging-app/ci/${APP_VERSION}" -H "Authorization: $LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz
431+
curl --retry 5 --retry-all-errors -fL -o embedded-cluster-smoke-test-staging-app-ci.tgz "https://ec-e2e-replicated-app.testcluster.net/embedded/embedded-cluster-smoke-test-staging-app/ci/${APP_VERSION}" -H "Authorization: $LICENSE_ID"
432432
tar -xzf embedded-cluster-smoke-test-staging-app-ci.tgz
433433
mv embedded-cluster-smoke-test-staging-app embedded-cluster
434434
mkdir -p output/bin
435435
mv embedded-cluster output/bin
436436
437437
# download the embedded-cluster binary from the github release
438-
curl -L "https://github.com/replicatedhq/embedded-cluster/releases/download/${{ github.ref_name }}/embedded-cluster-linux-amd64.tgz" -o embedded-cluster-github.tgz
438+
curl --retry 5 --retry-all-errors -fL -o embedded-cluster-github.tgz "https://github.com/replicatedhq/embedded-cluster/releases/download/${{ github.ref_name }}/embedded-cluster-linux-amd64.tgz"
439439
tar -xzf embedded-cluster-github.tgz
440440
mv embedded-cluster output/bin/embedded-cluster-original
441441

pkg/logging/logging.go renamed to cmd/installer/cli/logging.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// Package logging manages setup of common logging interfaces and settings. We set the log
2-
// level to all levels but we only show on stdout the info, error, and fatal levels. All
3-
// other error levels are written only to a log file.
4-
package logging
1+
package cli
52

63
import (
74
"fmt"
@@ -13,6 +10,9 @@ import (
1310
"github.com/fatih/color"
1411
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
1512
"github.com/sirupsen/logrus"
13+
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
14+
"sigs.k8s.io/controller-runtime/pkg/log/zap"
15+
ctrlzap "sigs.k8s.io/controller-runtime/pkg/log/zap"
1616
)
1717

1818
// MaxLogFiles is the maximum number of log files we keep.
@@ -111,11 +111,22 @@ func SetupLogging() {
111111
logpath := runtimeconfig.PathToLog(fname)
112112
logfile, err := os.OpenFile(logpath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0400)
113113
if err != nil {
114-
logrus.Warnf("unable to setup logging: %v", err)
114+
logrus.Warnf("Unable to setup logging: %v", err)
115115
return
116116
}
117117
logrus.SetOutput(logfile)
118118
logrus.AddHook(&StdoutLogger{})
119119
logrus.Debugf("command line: %v", os.Args)
120+
121+
setupCtrlLogging(logfile)
122+
120123
trimLogDir()
121124
}
125+
126+
// setupCtrlLogging sets up the logging for the controller-runtime package to the writer specified.
127+
func setupCtrlLogging(w io.Writer) {
128+
k8slogger := ctrlzap.New(func(o *zap.Options) {
129+
o.DestWriter = w
130+
})
131+
ctrllog.SetLogger(k8slogger)
132+
}

cmd/installer/cli/restore_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import (
1111
k0sv1beta1 "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
1212
clitesting "github.com/replicatedhq/embedded-cluster/cmd/installer/cli/testing"
1313
"github.com/replicatedhq/embedded-cluster/pkg/disasterrecovery"
14+
"github.com/replicatedhq/embedded-cluster/pkg/kubeutils"
1415
"github.com/replicatedhq/embedded-cluster/pkg/release"
1516
"github.com/stretchr/testify/assert"
1617
"github.com/stretchr/testify/require"
1718
velerov1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
1819
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19-
"k8s.io/kubectl/pkg/scheme"
2020
"k8s.io/utils/ptr"
2121
"sigs.k8s.io/controller-runtime/pkg/client"
2222
"sigs.k8s.io/controller-runtime/pkg/client/fake"
@@ -193,8 +193,7 @@ func Test_isReplicatedBackupRestorable(t *testing.T) {
193193
}
194194

195195
func Test_waitForBackups(t *testing.T) {
196-
scheme := scheme.Scheme
197-
velerov1.AddToScheme(scheme)
196+
scheme := kubeutils.Scheme
198197

199198
appendCommonAnnotations := func(annotations map[string]string) map[string]string {
200199
annotations["kots.io/embedded-cluster-version"] = "v0.0.0"

cmd/installer/cli/testing/assets/release-restore-newdr/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
- init:
1818
initContainers:
1919
- name: restore-hook-init1
20-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
20+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2121
command:
2222
- /bin/ash
2323
- -c

cmd/installer/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ import (
66
"path"
77

88
"github.com/mattn/go-isatty"
9-
109
"github.com/replicatedhq/embedded-cluster/cmd/installer/cli"
11-
"github.com/replicatedhq/embedded-cluster/pkg/logging"
1210
"github.com/replicatedhq/embedded-cluster/pkg/prompts"
1311
)
1412

1513
func main() {
1614
ctx := context.Background()
1715

18-
logging.SetupLogging()
16+
cli.SetupLogging()
1917

2018
prompts.SetTerminal(isatty.IsTerminal(os.Stdout.Fd()))
2119

e2e/kots-release-install-failing-preflights/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- init:
2121
initContainers:
2222
- name: restore-hook-init1
23-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
23+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2424
command:
2525
- /bin/ash
2626
- -c

e2e/kots-release-install-warning-preflights/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- init:
2121
initContainers:
2222
- name: restore-hook-init1
23-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
23+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2424
command:
2525
- /bin/ash
2626
- -c

e2e/kots-release-install/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- init:
2121
initContainers:
2222
- name: restore-hook-init1
23-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
23+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2424
command:
2525
- /bin/ash
2626
- -c

e2e/kots-release-unsupported-overrides/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- init:
2121
initContainers:
2222
- name: restore-hook-init1
23-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
23+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2424
command:
2525
- /bin/ash
2626
- -c

e2e/kots-release-upgrade/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- init:
2121
initContainers:
2222
- name: restore-hook-init1
23-
image: proxy.replicated.com/anonymous/nginx:1.24-alpine
23+
image: 'repl{{ LocalImageName "proxy.replicated.com/anonymous/nginx:1.24-alpine" }}'
2424
command:
2525
- /bin/ash
2626
- -c

0 commit comments

Comments
 (0)