diff --git a/carvel-packages/training-platform/bundle/config/00-values.yaml b/carvel-packages/training-platform/bundle/config/00-values.yaml index 6383d624..62e93035 100644 --- a/carvel-packages/training-platform/bundle/config/00-values.yaml +++ b/carvel-packages/training-platform/bundle/config/00-values.yaml @@ -6,14 +6,14 @@ imageVersions: image: "debian:sid-20230502-slim" - name: docker-in-docker image: "docker:20.10.18-dind" -- name: rancher-k3s-v1.25 - image: "rancher/k3s:v1.25.16-k3s4" -- name: rancher-k3s-v1.26 - image: "rancher/k3s:v1.26.12-k3s1" - name: rancher-k3s-v1.27 - image: "rancher/k3s:v1.27.9-k3s1" + image: "rancher/k3s:v1.27.14-k3s1" - name: rancher-k3s-v1.28 - image: "rancher/k3s:v1.28.5-k3s1" + image: "rancher/k3s:v1.28.10-k3s1" +- name: rancher-k3s-v1.29 + image: "rancher/k3s:v1.29.5-k3s1" +- name: rancher-k3s-v1.30 + image: "rancher/k3s:v1.30.1-k3s1" - name: loftsh-vcluster image: "loftsh/vcluster:0.18.1" - name: contour-bundle diff --git a/carvel-packages/training-platform/config/images.yaml b/carvel-packages/training-platform/config/images.yaml index caa9adc4..9b5120e2 100644 --- a/carvel-packages/training-platform/config/images.yaml +++ b/carvel-packages/training-platform/config/images.yaml @@ -45,14 +45,14 @@ imageVersions: image: "debian:sid-20230502-slim" - name: docker-in-docker image: "docker:20.10.18-dind" -- name: rancher-k3s-v1.25 - image: "rancher/k3s:v1.25.16-k3s4" -- name: rancher-k3s-v1.26 - image: "rancher/k3s:v1.26.12-k3s1" - name: rancher-k3s-v1.27 - image: "rancher/k3s:v1.27.9-k3s1" + image: "rancher/k3s:v1.27.14-k3s1" - name: rancher-k3s-v1.28 - image: "rancher/k3s:v1.28.5-k3s1" + image: "rancher/k3s:v1.28.10-k3s1" +- name: rancher-k3s-v1.29 + image: "rancher/k3s:v1.29.5-k3s1" +- name: rancher-k3s-v1.30 + image: "rancher/k3s:v1.30.1-k3s1" - name: loftsh-vcluster image: "loftsh/vcluster:0.18.1" - name: contour-bundle diff --git a/project-docs/release-notes/version-2.7.1.md b/project-docs/release-notes/version-2.7.1.md index 78510f6c..4ac2c1df 100644 --- a/project-docs/release-notes/version-2.7.1.md +++ b/project-docs/release-notes/version-2.7.1.md @@ -1,11 +1,25 @@ Version 2.7.1 ============= +New Features +------------ + +* It is now possible to override the cooldown period during which a clickable + action cannot be clicked a second time. For many clickable actions this + defaults to 3 seconds. For a specific use of a clickable action this can be + overridden by setting the `cooldown` property to the number of seconds. To + totally disable clicking on the action a second time you can use the special + `.INF` value. Reloading a page will though again allow the clickable action to + be used again. For more information see [Overriding action cooldown + period](overriding-action-cooldown-period). + Features Changed ---------------- * Updated VS Code to version 1.89.1. +* Versions of kubectl now provided are 1.27-1.30. + * Reduction of noise in logging for session manager, secrets manager and training portal, with additional more specific logging on what each is doing. @@ -97,3 +111,14 @@ Bugs Fixed not being set as being owned by the workshop namespace. This meant these resources were not being deleted automatically when the workshop environment and workshop namespace were deleted. + +* Clicking on links in the dashboard terminal would result in a blank browser + window rather than opening the target URL. This had broken when xterm.js had + been updated as the implementation used by xterm.js had changed and it no + longer works when xterm.js is embedded in an iframe. The implementation used + by xterm.js when clicking on links to open the window has been overridden to + use the older mechanism. + +* DNS resolution was not working from pods deployed to a virtual cluster. Issue + fixed and `vcluster` updated to 0.18.1, with support for Kubernetes versions + 1.27-1.30, defaulting to 1.29. diff --git a/project-docs/workshop-content/workshop-instructions.md b/project-docs/workshop-content/workshop-instructions.md index e5aeebef..b0018862 100644 --- a/project-docs/workshop-content/workshop-instructions.md +++ b/project-docs/workshop-content/workshop-instructions.md @@ -811,6 +811,26 @@ delay: 1 ``` ~~~ +(overriding-action-cooldown-period)= +Overriding action cooldown period +--------------------------------- + +For the majority of clickable actions a cooldown period is applied of 3 seconds. This means one is blocked from clicking on the same clickable action a second time until the cooldown period has expired. This is intended to avoid problems caused by accidental double clicks. + +This cooldown period can be overridden if it is desired to block a user from using the clickable action again for a longer period of time, by setting the `cooldown` property. The value of the period should be in seconds. One can also use the special value `.INF` if wanting to block it from being clicked a second time. + +~~~ +```examiner:execute-test +name: test-that-pod-exists +title: Verify that pod named "one" exists. +cooldown: .INF +args: +- one +``` +~~~ + +Note that reloading of the web page holding the instructions will reset the cooldown period and the clickable action will be able to be used again. + (hiding-clickable-actions-from-view)= Hiding clickable actions from view ---------------------------------- diff --git a/session-manager/handlers/application_vcluster.py b/session-manager/handlers/application_vcluster.py index 8c33e5b1..94d32fe3 100644 --- a/session-manager/handlers/application_vcluster.py +++ b/session-manager/handlers/application_vcluster.py @@ -5,22 +5,22 @@ from .operator_config import ( OPERATOR_API_GROUP, CLUSTER_STORAGE_GROUP, - RANCHER_K3S_V1_25_IMAGE, - RANCHER_K3S_V1_26_IMAGE, RANCHER_K3S_V1_27_IMAGE, RANCHER_K3S_V1_28_IMAGE, + RANCHER_K3S_V1_29_IMAGE, + RANCHER_K3S_V1_30_IMAGE, LOFTSH_VCLUSTER_IMAGE, CONTOUR_BUNDLE_IMAGE, ) -K8S_DEFAULT_VERSION = "1.27" +K8S_DEFAULT_VERSION = "1.29" K3S_VERSIONS = { - "1.25": RANCHER_K3S_V1_25_IMAGE, - "1.26": RANCHER_K3S_V1_26_IMAGE, "1.27": RANCHER_K3S_V1_27_IMAGE, "1.28": RANCHER_K3S_V1_28_IMAGE, + "1.29": RANCHER_K3S_V1_29_IMAGE, + "1.30": RANCHER_K3S_V1_30_IMAGE, } @@ -186,21 +186,14 @@ def vcluster_environment_objects_list(workshop_spec, application_properties): - name: custom-config-volume mountPath: /etc/coredns/custom readOnly: true - ports: - - containerPort: 1053 - name: dns - protocol: UDP - - containerPort: 1053 - name: dns-tcp - protocol: TCP - - containerPort: 9153 - name: metrics - protocol: TCP securityContext: + runAsNonRoot: true runAsUser: {{.RUN_AS_USER}} - runAsNonRoot: {{.RUN_AS_NON_ROOT}} + runAsGroup: {{.RUN_AS_GROUP}} allowPrivilegeEscalation: false capabilities: + add: + - NET_BIND_SERVICE drop: - ALL readOnlyRootFilesystem: true diff --git a/session-manager/handlers/operator_config.py b/session-manager/handlers/operator_config.py index 266d470c..664ad362 100644 --- a/session-manager/handlers/operator_config.py +++ b/session-manager/handlers/operator_config.py @@ -163,10 +163,10 @@ def image_reference(name): "conda-environment:*": CONDA_ENVIRONMENT_IMAGE, } -RANCHER_K3S_V1_25_IMAGE = image_reference("rancher-k3s-v1.25") -RANCHER_K3S_V1_26_IMAGE = image_reference("rancher-k3s-v1.26") RANCHER_K3S_V1_27_IMAGE = image_reference("rancher-k3s-v1.27") RANCHER_K3S_V1_28_IMAGE = image_reference("rancher-k3s-v1.28") +RANCHER_K3S_V1_29_IMAGE = image_reference("rancher-k3s-v1.29") +RANCHER_K3S_V1_30_IMAGE = image_reference("rancher-k3s-v1.30") LOFTSH_VCLUSTER_IMAGE = image_reference("loftsh-vcluster") diff --git a/workshop-images/base-environment/Dockerfile b/workshop-images/base-environment/Dockerfile index dec21fe4..8082d897 100644 --- a/workshop-images/base-environment/Dockerfile +++ b/workshop-images/base-environment/Dockerfile @@ -148,57 +148,46 @@ RUN mkdir -p /opt/kubernetes/bin RUN <=0.4" } }, - "node_modules/xterm": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz", - "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==" - }, - "node_modules/xterm-addon-fit": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz", - "integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==", - "peerDependencies": { - "xterm": "^5.0.0" - } - }, - "node_modules/xterm-addon-web-links": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/xterm-addon-web-links/-/xterm-addon-web-links-0.9.0.tgz", - "integrity": "sha512-LIzi4jBbPlrKMZF3ihoyqayWyTXAwGfu4yprz1aK2p71e9UKXN6RRzVONR0L+Zd+Ik5tPVI9bwp9e8fDTQh49Q==", - "peerDependencies": { - "xterm": "^5.0.0" - } - }, "node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -4973,6 +4955,11 @@ "@types/node": "*" } }, + "@xterm/xterm": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", + "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==" + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -8061,23 +8048,6 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, - "xterm": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz", - "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==" - }, - "xterm-addon-fit": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz", - "integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==", - "requires": {} - }, - "xterm-addon-web-links": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/xterm-addon-web-links/-/xterm-addon-web-links-0.9.0.tgz", - "integrity": "sha512-LIzi4jBbPlrKMZF3ihoyqayWyTXAwGfu4yprz1aK2p71e9UKXN6RRzVONR0L+Zd+Ik5tPVI9bwp9e8fDTQh49Q==", - "requires": {} - }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", diff --git a/workshop-images/base-environment/opt/gateway/package.json b/workshop-images/base-environment/opt/gateway/package.json index 28e3e266..661a0da3 100644 --- a/workshop-images/base-environment/opt/gateway/package.json +++ b/workshop-images/base-environment/opt/gateway/package.json @@ -51,9 +51,9 @@ "uuid": "^9.0.1", "winston": "^3.11.0", "ws": "^8.14.2", - "xterm": "^5.3.0", - "xterm-addon-fit": "^0.8.0", - "xterm-addon-web-links": "^0.9.0" + "@xterm/xterm": "^5.5.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/addon-web-links": "^0.11.0" }, "devDependencies": { "@types/bootstrap": "^5.2.9", diff --git a/workshop-images/base-environment/opt/gateway/src/backend/modules/assets.ts b/workshop-images/base-environment/opt/gateway/src/backend/modules/assets.ts index b7bc691a..a216672e 100644 --- a/workshop-images/base-environment/opt/gateway/src/backend/modules/assets.ts +++ b/workshop-images/base-environment/opt/gateway/src/backend/modules/assets.ts @@ -15,7 +15,7 @@ export function setup_assets(app: express.Application) { app.use("/static/webfonts", express.static(path.join(BASEDIR, "webfonts/SourceCodePro"), { maxAge: 3600000 })) - app.use("/static/xterm/css", express.static(path.join(BASEDIR, "node_modules/xterm/css"))) + app.use("/static/xterm/css", express.static(path.join(BASEDIR, "node_modules/@xterm/xterm/css"))) app.use("/static/bootstrap/css", express.static(path.join(BASEDIR, "node_modules/bootstrap/dist/css"))) app.use("/static/fontawesome", express.static(path.join(BASEDIR, "node_modules/@fortawesome/fontawesome-free"))) diff --git a/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts b/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts index f6f73f2f..95db7e16 100644 --- a/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts +++ b/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts @@ -4,9 +4,9 @@ import * as $ from "jquery" import * as bootstrap from "bootstrap" -import { Terminal } from "xterm" -import { FitAddon } from "xterm-addon-fit" -import { WebLinksAddon } from "xterm-addon-web-links" +import { Terminal } from "@xterm/xterm" +import { FitAddon } from "@xterm/addon-fit" +import { WebLinksAddon } from "@xterm/addon-web-links" import { ResizeSensor } from "css-element-queries" @@ -459,7 +459,17 @@ class TerminalSession { this.fitter = new FitAddon() this.terminal.loadAddon(this.fitter) - this.terminal.loadAddon(new WebLinksAddon()) + // We override the normal behavior of the terminal to open links as the + // standard implementation creates a blank window and then tries to + // update the target URL afterwards, but this fails when xterm.js is + // used embedded in an iframe. Supplying the target URL at the time of + // opening the window appears to work fine. + + function handleLinkClick(event: MouseEvent, uri: string): void { + window.open(uri, '_blank'); + } + + this.terminal.loadAddon(new WebLinksAddon(handleLinkClick)) // Ensure that the element the terminal is contained in is visible. // This is just to ensure that dimensions can be correctly calculated. diff --git a/workshop-images/base-environment/opt/kubernetes/bin/kubectl b/workshop-images/base-environment/opt/kubernetes/bin/kubectl index 6c257c64..d6630930 100755 --- a/workshop-images/base-environment/opt/kubernetes/bin/kubectl +++ b/workshop-images/base-environment/opt/kubernetes/bin/kubectl @@ -1,23 +1,23 @@ #!/bin/bash case "$KUBECTL_VERSION" in -1.2[0123]) - KUBECTL_VERSION=1.24 +1.2[0123456]) + KUBECTL_VERSION=1.27 ;; -1.2[9]) - KUBECTL_VERSION=1.28 +1.30) + KUBECTL_VERSION=1.30 ;; 1.3*) - KUBECTL_VERSION=1.28 + KUBECTL_VERSION=1.30 ;; esac if [ -z "$KUBECTL_VERSION" ]; then - KUBECTL_VERSION=1.28 + KUBECTL_VERSION=1.29 fi if [ ! -x /opt/kubernetes/bin/kubectl@$KUBECTL_VERSION ]; then - KUBECTL_VERSION=1.28 + KUBECTL_VERSION=1.29 fi exec /opt/kubernetes/bin/kubectl@$KUBECTL_VERSION "$@" diff --git a/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts b/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts index 5ff1b97b..62a6f87e 100644 --- a/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts +++ b/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts @@ -754,7 +754,12 @@ export function register_action(options: any) { let now = new Date().getTime() - if (cooldown) { + let cooldown_period = cooldown + + if (action_args.cooldown !== undefined) + cooldown_period = action_args.cooldown + + if (cooldown_period) { if (triggered && !completed) { console.log(`[${title_string}] Cooldown: Executing`) @@ -762,7 +767,7 @@ export function register_action(options: any) { } if (completed) { - if (((now - completed) / 1000) < cooldown) { + if (((now - completed) / 1000) < cooldown_period) { console.log(`[${title_string}] Cooldown: Interval`) return }