Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into k0s-1-29
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Oct 31, 2024
2 parents f24137d + bff8d72 commit 24ee05f
Show file tree
Hide file tree
Showing 19 changed files with 354 additions and 97 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ create-node%:
-v $(shell pwd):/replicatedhq/embedded-cluster \
-v $(shell dirname $(shell pwd))/kots:/replicatedhq/kots \
$(if $(filter node0,node$*),-p $(NODE_PORT):$(NODE_PORT)) \
$(if $(filter node0,node$*),-p 30003:30003) \
replicated/ec-distro:$(DISTRO)

@$(MAKE) ssh-node$*
Expand Down
7 changes: 4 additions & 3 deletions cmd/local-artifact-mirror/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (
// These constant define the expected names of the files in the registry.
const (
EmbeddedClusterBinaryArtifactName = "embedded-cluster-amd64"
ImagesArtifactName = "images-amd64.tar"
ImagesSrcArtifactName = "images-amd64.tar"
ImagesDstArtifactName = "ec-images-amd64.tar"
HelmChartsArtifactName = "charts.tar.gz"
)

Expand Down Expand Up @@ -86,8 +87,8 @@ var imagesCommand = &cli.Command{
os.RemoveAll(location)
}()

dst := filepath.Join(provider.EmbeddedClusterImagesSubDir(), ImagesArtifactName)
src := filepath.Join(location, ImagesArtifactName)
dst := filepath.Join(provider.EmbeddedClusterImagesSubDir(), ImagesDstArtifactName)
src := filepath.Join(location, ImagesSrcArtifactName)
logrus.Infof("%s > %s", src, dst)
if err := helpers.MoveFile(src, dst); err != nil {
return fmt.Errorf("unable to move images bundle: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion e2e/cluster/lxd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ func PullImage(in *ClusterInput, image string) {
in.T.Fatalf("Failed to connect to image server: %v", err)
}

alias, _, err := remote.GetImageAlias(image)
alias, _, err := remote.GetImageAliasType("container", image)
if err != nil {
in.T.Logf("Failed to get image alias %s on %s: %v", image, server, err)
continue
Expand Down
1 change: 1 addition & 0 deletions e2e/kots-release-install/kots-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
spec:
title: Embedded Cluster Smoke Test Staging App
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.png
allowRollback: true
statusInformers:
- deployment/nginx
ports:
Expand Down
1 change: 1 addition & 0 deletions e2e/kots-release-upgrade/kots-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
spec:
title: Embedded Cluster Smoke Test Staging App
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.png
allowRollback: true
statusInformers:
- deployment/nginx
ports:
Expand Down
54 changes: 54 additions & 0 deletions e2e/playwright/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Running Tests Against the Development Environment

1. Install deps on your Mac

```bash
npm ci
npx playwright install --with-deps
code --install-extension ms-playwright.playwright
```

1. Build the release and run the development environment

```bash
make initial-release
make create-node0
output/bin/embedded-cluster install --license local-dev/license.yaml
```

1. Create a nodeport service directly to kotsadm

```bash
cat <<EOF | k0s kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: kotsadm-nodeport
namespace: kotsadm
labels:
replicated.com/disaster-recovery: infra
replicated.com/disaster-recovery-chart: admin-console
spec:
type: NodePort
ports:
- port: 30003
targetPort: 3000
nodePort: 30003
selector:
app: kotsadm
EOF
```
1. Configure the base URL (default is `http://localhost:30000`) on your Mac
```bash
export BASE_URL=http://localhost:30003
```
1. Run the test on your Mac
```bash
npx playwright test --ui deploy-app
```
Don't forget to press the play button in the browser to run the test.
2 changes: 1 addition & 1 deletion e2e/playwright/tests/deploy-upgrade/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('deploy upgrade', async ({ page }) => {
await iframe.locator('input[type="password"]').fill('updated password');
await iframe.getByRole('button', { name: 'Next', exact: true }).click();
await expect(iframe.getByText('Preflight checks', { exact: true })).toBeVisible({ timeout: 10 * 1000 });
await expect(iframe.getByRole('button', { name: 'Re-run' })).toBeVisible({ timeout: 10 * 1000 });
await expect(iframe.getByRole('button', { name: 'Rerun' })).toBeVisible({ timeout: 10 * 1000 });
await expect(iframe.locator('#app')).toContainText('Embedded Cluster Installation CRD exists');
await expect(iframe.locator('#app')).toContainText('Embedded Cluster Config CRD exists');
await expect(iframe.getByRole('button', { name: 'Back: Config' })).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { login } from '../shared';

test('get restore join controller command', async ({ page }) => {
await login(page);
await page.getByRole('button', { name: 'Add node', exact: true }).click();
await expect(page.locator('#controller-testNodeType')).toBeChecked();
await expect(page.locator('.CodeSnippet-copy')).toBeVisible();
const joinCommand = await page.locator('.react-prism.language-bash').first().textContent();
Expand Down
4 changes: 2 additions & 2 deletions e2e/playwright/tests/shared/deploy-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const deployApp = async (page, expect) => {
await page.locator('input[type="password"]').click();
await page.locator('input[type="password"]').fill('password');
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByText('Preflight checks', { exact: true })).toBeVisible({ timeout: 10 * 1000 });
await expect(page.getByRole('button', { name: 'Re-run' })).toBeVisible({ timeout: 10 * 1000 });
await expect(page.getByText('Validate the environment')).toBeVisible({ timeout: 10 * 1000 });
await expect(page.getByRole('button', { name: 'Rerun' })).toBeVisible({ timeout: 10 * 1000 });
await expect(page.locator('#app')).toContainText('Embedded Cluster Installation CRD exists');
await expect(page.locator('#app')).toContainText('Embedded Cluster Config CRD exists');
await page.getByRole('button', { name: 'Deploy' }).click();
Expand Down
33 changes: 17 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1
github.com/bombsimon/logrusr/v4 v4.1.0
github.com/canonical/lxd v0.0.0-20240927232348-ef33aea98aec
github.com/canonical/lxd v0.0.0-20241030172432-dee0d04b56ee
github.com/containers/image/v5 v5.32.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.23
Expand Down Expand Up @@ -48,7 +48,7 @@ require (
k8s.io/apimachinery v0.31.2
k8s.io/client-go v0.31.2
k8s.io/kubectl v0.31.2
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
oras.land/oras-go/v2 v2.5.0
sigs.k8s.io/controller-runtime v0.19.1
sigs.k8s.io/yaml v1.4.0
Expand All @@ -61,7 +61,7 @@ replace (

require (
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.7 // indirect
cloud.google.com/go/storage v1.40.0 // indirect
dario.cat/mergo v1.0.1 // indirect
Expand Down Expand Up @@ -166,7 +166,7 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/k0sproject/version v0.6.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
Expand Down Expand Up @@ -201,11 +201,12 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.20.3 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/common v0.60.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/redis/go-redis/v9 v9.5.2 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/rubenv/sql-migrate v1.7.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand Down Expand Up @@ -234,8 +235,8 @@ require (
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zitadel/logging v0.6.0 // indirect
github.com/zitadel/oidc/v3 v3.30.0 // indirect
github.com/zitadel/logging v0.6.1 // indirect
github.com/zitadel/oidc/v3 v3.31.0 // indirect
github.com/zitadel/schema v1.3.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
Expand All @@ -250,17 +251,17 @@ require (
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.starlark.net v0.0.0-20240725214946-42030a7cedce // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
go.starlark.net v0.0.0-20240925182052-1207426daebd // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/tools v0.25.0 // indirect
golang.org/x/tools v0.26.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.172.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/apiserver v0.31.2 // indirect
Expand Down Expand Up @@ -312,7 +313,7 @@ require (
github.com/muhlemmer/gu v0.3.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1
github.com/pkg/sftp v1.13.6 // indirect
github.com/pkg/sftp v1.13.7 // indirect
github.com/pkg/xattr v0.4.10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
Expand All @@ -325,7 +326,7 @@ require (
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/apiextensions-apiserver v0.31.2
k8s.io/klog/v2 v2.130.1 // indirect
Expand Down
Loading

0 comments on commit 24ee05f

Please sign in to comment.