Skip to content

Commit

Permalink
Merge branch 'main' into chore/ec-dev-patches-affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
JGAntunes authored Nov 13, 2024
2 parents 513388c + 55b35f4 commit 254d334
Show file tree
Hide file tree
Showing 47 changed files with 2,240 additions and 1,812 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cmx-versions/action.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Get CMX Versions'
description: 'Retrieves a list of the CMX versions to test against'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'

inputs:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/cmx-versions/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7662,8 +7662,8 @@ async function getClusterVersions() {
instance_type: "m7g.large" // arm64
},
openshift: {
// filtering out all versions except 4.14.0-okd for now per sc-90893
versions: new Set(["4.14.0-okd"])
// filtering out all versions except 4.15.0-okd for now per sc-90893
versions: new Set(["4.15.0-okd"])
},
oke: {
versions: new Set(["1.30.1"])
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/cmx-versions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async function getClusterVersions() {
instance_type: "m7g.large" // arm64
},
openshift: {
// filtering out all versions except 4.14.0-okd for now per sc-90893
versions: new Set(["4.14.0-okd"])
// filtering out all versions except 4.15.0-okd for now per sc-90893
versions: new Set(["4.15.0-okd"])
},
oke: {
versions: new Set(["1.30.1"])
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/kurl-addon-kots-publisher/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ inputs:
required: true
description: 'GitHub token.'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
2 changes: 1 addition & 1 deletion .github/actions/version-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ outputs:
GIT_TAG:
description: 'Git tag if this is a tagged revision'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
55 changes: 51 additions & 4 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ jobs:
matrix:
cluster: [
{distribution: kind, version: v1.28.0},
{distribution: openshift, version: 4.14.0-okd}
{distribution: openshift, version: 4.15.0-okd}
]
env:
APP_SLUG: minimal-rbac
Expand Down Expand Up @@ -1196,7 +1196,7 @@ jobs:
matrix:
cluster: [
{distribution: kind, version: v1.28.0},
{distribution: openshift, version: 4.14.0-okd}
{distribution: openshift, version: 4.15.0-okd}
]
env:
APP_SLUG: minimal-rbac
Expand Down Expand Up @@ -3610,7 +3610,7 @@ jobs:
matrix:
cluster: [
{distribution: kind, version: v1.28.0},
{distribution: openshift, version: 4.14.0-okd}
{distribution: openshift, version: 4.15.0-okd}
]
env:
KOTS_NAMESPACE: replicated-sdk
Expand Down Expand Up @@ -3919,7 +3919,7 @@ jobs:
matrix:
cluster: [
{distribution: kind, version: v1.28.0},
{distribution: openshift, version: 4.14.0-okd}
{distribution: openshift, version: 4.15.0-okd}
]
steps:
- name: Checkout
Expand Down Expand Up @@ -4186,6 +4186,53 @@ jobs:
exit 1
fi
# ---- validate archives ---- #
function validate_configmap_in_archive {
local expected_value="$1"
if ! grep -q "$expected_value" get-set-config/base/configmap.yaml; then
echo "expected base/configmap.yaml to contain $expected_value:"
cat get-set-config/base/configmap.yaml
exit 1
fi
}
# make latest different from current
./bin/kots set config "$APP_SLUG" --key=username --value=latest-username --namespace "$APP_SLUG"
# validate the archive for sequence 0
./bin/kots download --namespace "$APP_SLUG" --slug "$APP_SLUG" --sequence=0 --decrypt-password-values --overwrite
validate_configmap_in_archive "username: ''"
validate_configmap_in_archive "password: ''"
validate_configmap_in_archive "email: ''"
validate_configmap_in_archive "sequence: '0'"
# validate the archive for sequence 2
./bin/kots download --namespace "$APP_SLUG" --slug "$APP_SLUG" --sequence=2 --decrypt-password-values --overwrite
validate_configmap_in_archive "username: 'example-username'"
validate_configmap_in_archive "password: 'example-password'"
validate_configmap_in_archive "email: ''"
validate_configmap_in_archive "sequence: '2'"
# validate the archive for the currently deployed version
./bin/kots download --namespace "$APP_SLUG" --slug "$APP_SLUG" --current --decrypt-password-values --overwrite
validate_configmap_in_archive "username: 'updated-username'"
validate_configmap_in_archive "password: ''"
validate_configmap_in_archive "email: ''"
validate_configmap_in_archive "sequence: '5'"
# validate the archive for the latest version
./bin/kots download --namespace "$APP_SLUG" --slug "$APP_SLUG" --decrypt-password-values --overwrite
validate_configmap_in_archive "username: 'latest-username'"
validate_configmap_in_archive "password: ''"
validate_configmap_in_archive "email: ''"
validate_configmap_in_archive "sequence: '6'"
- name: Generate support bundle on failure
if: failure()
uses: ./.github/actions/generate-support-bundle
Expand Down
6 changes: 3 additions & 3 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.20241029.160148-r0'
RQLITE_TAG='8.32.5-r0'
MINIO_TAG='0.20241107.005220-r0'
RQLITE_TAG='8.34.0-r0'
DEX_TAG='2.41.1-r1'
SCHEMAHERO_TAG='0.17.10'
SCHEMAHERO_TAG='0.17.12'
LVP_TAG='v0.6.7'
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include Makefile.build.mk
CURRENT_USER := $(shell id -u -n)
MINIO_TAG ?= 0.20241029.160148-r0
RQLITE_TAG ?= 8.32.5-r0
MINIO_TAG ?= 0.20241107.005220-r0
RQLITE_TAG ?= 8.34.0-r0
DEX_TAG ?= 2.41.1-r1
LVP_TAG ?= v0.6.7
PACT_PUBLISH_CONTRACT ?= false
Expand Down Expand Up @@ -44,6 +44,16 @@ integration-cli:
ci-test:
go test $(TEST_BUILDFLAGS) ./pkg/... ./cmd/... ./integration/... -coverprofile cover.out

.PHONY: kots-linux-amd64
kots-linux-amd64: export GOOS = linux
kots-linux-amd64: export GOARCH = amd64
kots-linux-amd64: kots

.PHONY: kots-linux-arm64
kots-linux-arm64: export GOOS = linux
kots-linux-arm64: export GOARCH = arm64
kots-linux-arm64: kots

.PHONY: kots
kots:
mkdir -p web/dist
Expand Down
8 changes: 8 additions & 0 deletions cmd/kots/cli/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func DownloadCmd() *cobra.Command {
}
}

if v.GetBool("current") && v.GetInt64("sequence") != -1 {
return errors.New("cannot use --current and --sequence together")
}

output := v.GetString("output")
if output != "json" && output != "" {
return errors.Errorf("output format %s not supported (allowed formats are: json)", output)
Expand All @@ -58,6 +62,8 @@ func DownloadCmd() *cobra.Command {
Overwrite: v.GetBool("overwrite"),
Silent: output != "",
DecryptPasswordValues: v.GetBool("decrypt-password-values"),
Current: v.GetBool("current"),
Sequence: v.GetInt64("sequence"),
}

var downloadOutput DownloadOutput
Expand Down Expand Up @@ -97,6 +103,8 @@ func DownloadCmd() *cobra.Command {
cmd.Flags().String("slug", "", "the application slug to download")
cmd.Flags().Bool("decrypt-password-values", false, "decrypt password values to plaintext")
cmd.Flags().StringP("output", "o", "", "output format (currently supported: json)")
cmd.Flags().Bool("current", false, "set to true to download the archive of the currently deployed app version")
cmd.Flags().Int64("sequence", -1, "sequence of the app version to download the archive for (defaults to the latest version unless --current flag is set)")

return cmd
}
2 changes: 1 addition & 1 deletion e2e/playwright/tests/@change-license/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ test('change license', async ({ page }) => {
await login(page);
await uploadLicense(page, expect, "community-license.yaml");
await expect(page.locator('#app')).toContainText('Change License', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await expect(page.locator('#app')).toContainText('Currently deployed version');
await page.getByRole('link', { name: 'License', exact: true }).click();
await expect(page.locator('#app')).toContainText('change-license-community', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('Community license');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ test('multi app backup and restore', async ({ page }) => {
await login(page);
await uploadLicense(page, expect, "app1-license.yaml");
await expect(page.locator('#app')).toContainText('Multi App Backup and Restore 1', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await expect(page.locator('#app')).toContainText('Currently deployed version');
await page.locator('div').filter({ hasText: /^Change passwordAdd new applicationLog out$/ }).getByRole('img').click();
await page.getByText('Add new application').click();
await uploadLicense(page, expect, "app2-license.yaml");
await expect(page.locator('#app')).toContainText('Multi App Backup and Restore 2', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await expect(page.locator('#app')).toContainText('Currently deployed version');
await page.locator('.NavItem').getByText('Snapshots', { exact: true }).click();
await page.getByRole('link', { name: 'Partial Snapshots' }).click({ timeout: 10000 });
await page.getByRole('button', { name: 'Start a snapshot' }).click({ timeout: 15000 });
Expand Down
4 changes: 2 additions & 2 deletions e2e/playwright/tests/@multi-app-install/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test('multi app install', async ({ page }) => {
await expect(page.locator('#app')).toContainText('Your cluster meets the recommended and required versions of Kubernetes');
await page.getByRole('button', { name: 'Deploy' }).click();
await expect(page.locator('#app')).toContainText('Multi App Install 1');
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await expect(page.locator('#app')).toContainText('Currently deployed version');
await expect(page.locator('#app')).toContainText('0.1.3');
const app1Status = execSync(`kubectl kots get apps -n ${process.env.NAMESPACE} | grep mutli-app-install | awk '{print $2}'`).toString().trim();
expect(app1Status).toBe('ready');
Expand All @@ -27,8 +27,8 @@ test('multi app install', async ({ page }) => {
await expect(page.locator('#app')).toContainText('Your cluster meets the recommended and required versions of Kubernetes');
await page.getByRole('button', { name: 'Deploy' }).click();
await expect(page.locator('#app')).toContainText('Multi App Install 2');
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await expect(page.locator('#app')).toContainText('Currently deployed version');
await expect(page.locator('#app')).toContainText('2.1.2');
const app2Status = execSync(`kubectl kots get apps -n ${process.env.NAMESPACE} | grep multi-app-install-2 | awk '{print $2}'`).toString().trim();
expect(app2Status).toBe('ready');
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/tests/@no-required-config/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ test('no required config', async ({ page }) => {
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 });
await page.getByRole('link', { name: 'Version history' }).click();
await expect(page.locator('#app')).toContainText('Currently deployed version');
await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
});
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/Masterminds/sprig/v3 v3.3.0
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412
github.com/aws/aws-sdk-go v1.55.5
github.com/bitnami-labs/sealed-secrets v0.27.1
github.com/bitnami-labs/sealed-secrets v0.27.2
github.com/blang/semver v3.5.1+incompatible
github.com/containers/image/v5 v5.32.2
github.com/coreos/go-oidc v2.2.1+incompatible
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
github.com/robfig/cron v1.2.0
github.com/robfig/cron/v3 v3.0.1
github.com/rqlite/gorqlite v0.0.0-20221028154453-256f31831ff3
github.com/schemahero/schemahero v0.17.10
github.com/schemahero/schemahero v0.17.12
github.com/segmentio/ksuid v1.0.4
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
github.com/spf13/cobra v1.8.1
Expand Down Expand Up @@ -89,8 +89,8 @@ require (
oras.land/oras-go/v2 v2.5.0
sigs.k8s.io/application v0.8.3
sigs.k8s.io/controller-runtime v0.19.1
sigs.k8s.io/kustomize/api v0.17.3
sigs.k8s.io/kustomize/kyaml v0.17.2
sigs.k8s.io/kustomize/api v0.18.0
sigs.k8s.io/kustomize/kyaml v0.18.1
sigs.k8s.io/yaml v1.4.0
)

Expand Down Expand Up @@ -201,7 +201,7 @@ require (
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down Expand Up @@ -299,7 +299,7 @@ require (
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/proglottis/gpgme v0.1.3 // indirect
github.com/prometheus/client_golang v1.20.2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand Down Expand Up @@ -363,7 +363,6 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.31.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-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
Expand Down
Loading

0 comments on commit 254d334

Please sign in to comment.