Skip to content

Commit

Permalink
Merge branch 'main' into florian/feat/multichan-licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Hines committed Aug 6, 2024
2 parents 3cd0a79 + 0785f4c commit a19443b
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 259 deletions.
4 changes: 2 additions & 2 deletions .image.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated file, do not modify. This file is generated from a text file containing a list of images. The
# most recent tag is interpolated from the source repository and used to generate a fully qualified image
# name.
MINIO_TAG='0.20240729.221452-r0'
MINIO_TAG='0.20240803.043323-r0'
RQLITE_TAG='8.26.8-r0'
DEX_TAG='2.40.0-r3'
DEX_TAG='2.41.0-r0'
SCHEMAHERO_TAG='0.17.9'
LVP_TAG='v0.6.7'
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include Makefile.build.mk
CURRENT_USER := $(if $(GITHUB_USER),$(GITHUB_USER),$(shell id -u -n))
MINIO_TAG ?= 0.20240729.221452-r0
MINIO_TAG ?= 0.20240803.043323-r0
RQLITE_TAG ?= 8.26.8-r0
DEX_TAG ?= 2.40.0-r3
DEX_TAG ?= 2.41.0-r0
LVP_TAG ?= v0.6.7

define sendMetrics
Expand Down
70 changes: 66 additions & 4 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,73 @@

E2E tests are run in build-test workflow on pull_request event.

e2e_test.go uses Ginkgo to build a test suite from inventory.go and runs each test using testim/client.go.
e2e_test.go uses Ginkgo to build a test suite from inventory.go and runs each test using testim/client.go or playwright/playwright.go

Tests are parallelized using Gingko's test focus. Each workflow definition in .github/workflows/build-test.yaml must define a `test-focus` parameter that matches the `Test Name` property defined in inventory.go. Each e2e test workflow skips all tests but what is defined in `test-focus`.
Tests are parallelized using Gingko's test focus. Each workflow definition in .github/workflows/build-test.yaml must define a `test-focus` parameter that matches the `Test Name` property defined in inventory.go. Each e2e test workflow skips all tests but what is defined in `test-focus`. Please colocate new playwright tests under the playwright comment with the other pw tests.

## Development environment
New tests should be written with playwright.

## Playwright

Playwright is the preferred testing framework for new tests moving forward. See playwright's [documentation](https://playwright.dev/docs/intro) for more information.

### Development environment

To install dependencies run:

```bash
cd e2e/playwright
npm ci
npx playwright install --with-deps
```

Install the playwright extension in vscode if you've not already done so:

```bash
code --install-extension ms-playwright.playwright
```

### Adding a new test

To add a new test that you've already added in the [kots-tests-app repo](https://github.com/replicatedhq/kots-test-apps) - do the following:

- Update `.github/workflows/build-test.yaml` to include the new test. You can copy an existing pw entry like `validate-change-channel` and update the test-focus, kots-namespace, and any other parameters needed for the test.
- Add the test to `e2e/inventory.go` , making sure the naming matches your kots-test-app and conforms to the naming convention of the other tests in the file:

```go
func NewChangeChannel() Test {
return Test{
ID: "change-channel",
Name: "Change Channel",
Namespace: "change-channel",
AppSlug: "change-channel",
UpstreamURI: "change-channel/automated",
}
}
```

- Add a new inventory test entry to `e2e/e2e_test.go` to ensure it actually runs:

```go
Entry(nil, inventory.NewChangeChannel()),
```

- Create a new test directory in `e2e/playwright/tests` matching your test ID, with the corresponding test file:

```
$ tree e2e/playwright/tests/change-channel
e2e/playwright/tests/change-channel
├── license.yaml // a test specific license if needed
└── test.spec.ts // the actual test file
```

- See `e2e/playwright/tests/shared` for test utility functions that can be used in your test for things like logging in or uploading a license.

## testim

Testim is our legacy testing framework. It is being phased out in favor of playwright.

### Development environment

To install dependencies run:

Expand Down Expand Up @@ -79,7 +141,7 @@ $ kubectl -n smoke-test port-forward svc/kotsadm 3000 --address=0.0.0.0
Forwarding from 0.0.0.0:3000 -> 3000
```

### Requirements
#### Requirements

*Currently, the admin console helm chart will not install on an M1 Macbook because of it's [node affinity](https://github.com/replicatedhq/kots-helm/blob/main/templates/kotsadm-deployment.yaml#L32-L35) rules*

Expand Down
1 change: 0 additions & 1 deletion e2e/playwright/tests/smoke-test/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ test('smoke test', async ({ page }) => {
await expect(page.locator('#app')).toContainText('Full Snapshots (Instance)');
await page.getByRole('link', { name: 'Partial Snapshots (Application)' }).click();
await page.getByRole('button', { name: 'Start a snapshot' }).click();
await expect(page.locator('#app')).toContainText('In Progress');
await expect(page.locator('#app')).toContainText('Completed', { timeout: 30000 });
await expect(page.getByText('It’s recommend that you use')).toBeVisible();
await page.getByText('Learn more').click();
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/gosimple/slug v1.13.1
github.com/gosimple/slug v1.14.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/heroku/docker-registry-client v0.0.0-20190909225348-afc9e1acc3d5
github.com/lib/pq v1.10.9
Expand All @@ -40,7 +40,7 @@ require (
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/mitchellh/hashstructure v1.1.0
github.com/onsi/ginkgo/v2 v2.19.1
github.com/onsi/gomega v1.34.0
github.com/onsi/gomega v1.34.1
github.com/open-policy-agent/opa v0.67.0
github.com/opencontainers/image-spec v1.1.0
github.com/ory/dockertest/v3 v3.10.0
Expand Down Expand Up @@ -364,14 +364,14 @@ require (
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gosimple/slug v1.13.1 h1:bQ+kpX9Qa6tHRaK+fZR0A0M2Kd7Pa5eHPPsb1JpHD+Q=
github.com/gosimple/slug v1.13.1/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ=
github.com/gosimple/slug v1.14.0 h1:RtTL/71mJNDfpUbCOmnf/XFkzKRtD6wL6Uy+3akm4Es=
github.com/gosimple/slug v1.14.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ=
github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o=
github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
Expand Down Expand Up @@ -1223,8 +1223,8 @@ github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os=
github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/open-policy-agent/opa v0.67.0 h1:FOdsO9yNhfmrh+72oVK7ImWmzruG+VSpfbr5IBqEWVs=
github.com/open-policy-agent/opa v0.67.0/go.mod h1:aqKlHc8E2VAAylYE9x09zJYr/fYzGX+JKne89UGqFzk=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down Expand Up @@ -1648,8 +1648,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down Expand Up @@ -1677,8 +1677,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -2020,8 +2020,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
6 changes: 0 additions & 6 deletions pkg/handlers/embedded_cluster_confirm_cluster_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ func (h *Handler) ConfirmEmbeddedClusterManagement(w http.ResponseWriter, r *htt
}
pendingVersion := downstreamVersions.PendingVersions[0]

if pendingVersion.Status != storetypes.VersionPendingClusterManagement {
logger.Error(fmt.Errorf("pending version is not in pending_cluster_management status"))
w.WriteHeader(http.StatusBadRequest)
return
}

archiveDir, err := os.MkdirTemp("", "kotsadm")
if err != nil {
logger.Error(fmt.Errorf("failed to create temp dir: %w", err))
Expand Down
4 changes: 2 additions & 2 deletions pkg/image/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package image
// image name.

const (
Minio = "kotsadm/minio:0.20240729.221452-r0"
Minio = "kotsadm/minio:0.20240803.043323-r0"
Rqlite = "kotsadm/rqlite:8.26.8-r0"
Dex = "kotsadm/dex:2.40.0-r3"
Dex = "kotsadm/dex:2.41.0-r0"
Schemahero = "schemahero/schemahero:0.17.9"
Lvp = "replicated/local-volume-provider:v0.6.7"
)
10 changes: 5 additions & 5 deletions pkg/license/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,19 @@ func verifyLicenseData(outerLicense *kotsv1beta1.License, innerLicense *kotsv1be
return fmt.Errorf("entitlement %q not found in the inner license", k)
}
if outerEntitlement.Value.Value() != innerEntitlement.Value.Value() {
return fmt.Errorf("entitlement %q value has changed to %q (license) from %q (witin signature)", k, outerEntitlement.Value.Value(), innerEntitlement.Value.Value())
return fmt.Errorf("entitlement %q value has changed to %q (license) from %q (within signature)", k, outerEntitlement.Value.Value(), innerEntitlement.Value.Value())
}
if outerEntitlement.Title != innerEntitlement.Title {
return fmt.Errorf("entitlement %q title has changed to %q (license) from %q (witin signature)", k, outerEntitlement.Title, innerEntitlement.Title)
return fmt.Errorf("entitlement %q title has changed to %q (license) from %q (within signature)", k, outerEntitlement.Title, innerEntitlement.Title)
}
if outerEntitlement.Description != innerEntitlement.Description {
return fmt.Errorf("entitlement %q description has changed to %q (license) from %q (witin signature)", k, outerEntitlement.Description, innerEntitlement.Description)
return fmt.Errorf("entitlement %q description has changed to %q (license) from %q (within signature)", k, outerEntitlement.Description, innerEntitlement.Description)
}
if outerEntitlement.IsHidden != innerEntitlement.IsHidden {
return fmt.Errorf("entitlement %q hidden has changed to %t (license) from %t (witin signature)", k, outerEntitlement.IsHidden, innerEntitlement.IsHidden)
return fmt.Errorf("entitlement %q hidden has changed to %t (license) from %t (within signature)", k, outerEntitlement.IsHidden, innerEntitlement.IsHidden)
}
if outerEntitlement.ValueType != innerEntitlement.ValueType {
return fmt.Errorf("entitlement %q value type has changed to %q (license) from %q (witin signature)", k, outerEntitlement.ValueType, innerEntitlement.ValueType)
return fmt.Errorf("entitlement %q value type has changed to %q (license) from %q (within signature)", k, outerEntitlement.ValueType, innerEntitlement.ValueType)
}
}

Expand Down
16 changes: 8 additions & 8 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"devDependencies": {
"@aws-sdk/types": "^3.609.0",
"@babel/cli": "^7.24.8",
"@babel/core": "^7.24.9",
"@babel/eslint-parser": "^7.25.0",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/helper-get-function-arity": "^7.16.7",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.24.7",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/preset-env": "^7.25.0",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@pact-foundation/pact": "^12.5.2",
Expand All @@ -39,7 +39,7 @@
"@storybook/addon-actions": "^7.6.17",
"@storybook/addon-essentials": "^6.5.16",
"@storybook/addon-interactions": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/addon-links": "^8.1.11",
"@storybook/builder-webpack5": "^7.6.17",
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/preset-scss": "^1.0.3",
Expand Down Expand Up @@ -126,14 +126,14 @@
"@grafana/data": "^8.5.16",
"@maji/react-prism": "^1.0.1",
"@monaco-editor/react": "^4.6.0",
"@mui/icons-material": "^5.16.5",
"@mui/material": "^5.16.5",
"@mui/icons-material": "^5.16.6",
"@mui/material": "^5.16.6",
"@storybook/addon-storysource": "^7.6.17",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-devtools": "^4.36.1",
"accounting": "^0.4.1",
"apexcharts": "^3.51.0",
"axios": "^1.7.2",
"axios": "^1.7.3",
"brace": "^0.11.1",
"classnames": "^2.5.1",
"clipboard": "2.0.11",
Expand Down Expand Up @@ -168,7 +168,7 @@
"react-refresh": "^0.14.2",
"react-remarkable": "^1.1.3",
"react-router": "^5.1",
"react-router-dom": "^6.25.1",
"react-router-dom": "^6.26.0",
"react-select": "^2.4.3",
"react-tooltip": "4.2.6",
"react-vis": "^1.12.1",
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/PreflightResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function PreflightResultPage(props: Props) {
return (
<div className="flex-column flex1 container">
<KotsPageTitle pageName="Preflight Checks" showAppSlug />
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
{location.pathname.includes("version-history") && (
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
<Icon
Expand Down Expand Up @@ -136,7 +136,9 @@ function PreflightResultPage(props: Props) {
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/upgrade_service/ConfirmAndDeploy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const ConfirmAndDeploy = ({
return (
<div className="flex-column flex1 container">
<KotsPageTitle pageName="Confirm and Deploy" showAppSlug />
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
{location.pathname.includes("version-history") && (
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
<Icon
Expand Down Expand Up @@ -219,7 +219,9 @@ const ConfirmAndDeploy = ({
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/upgrade_service/PreflightChecks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const PreflightCheck = ({
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/AppConfig/components/AppConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ class AppConfig extends Component<Props, State> {
const hasPreflight = app?.hasPreflight;

if (hasPreflight) {
navigate(`/${slug}/preflight`, { replace: true });
navigate(`/${slug}/preflight`);
} else {
await this.props.refetchApps();
navigate(`/app/${slug}`, { replace: true });
navigate(`/app/${slug}`);
}
} else {
this.setState({
Expand Down
4 changes: 3 additions & 1 deletion web/src/features/PreflightChecks/api/getPreflightResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ function useGetPrelightResults({
setRefetchCount(0);
},
refetchInterval: (preflightCheck: PreflightCheck | undefined) => {
if (!preflightCheck) return false;
if (!preflightCheck) return null;

if (preflightCheck?.preflightResults.length > 0) return null;

const refetchInterval = makeRefetchInterval(preflightCheck);

Expand Down
Loading

0 comments on commit a19443b

Please sign in to comment.