Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/get-lease/get-lease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ spec:
- description: Workspace for mounting Jumpstarter client files.
mountPath: /root/.config/jumpstarter/clients
name: jumpstarter-client-secret

optional: true
2 changes: 1 addition & 1 deletion tasks/release-lease/release-lease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ spec:
workspaces:
- mountPath: /root/.config/jumpstarter/clients
name: jumpstarter-client-secret

optional: true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same caveat as in get-lease: releasing without a mounted client may fail
With optional: true, the task now starts even when the jumpstarter-client-secret workspace is missing. If the client-config param is also empty, the later jmp config client use … will not find a config and the lease-release will error. Add a safety check or document the expectation in the Task description.

🤖 Prompt for AI Agents
In tasks/release-lease/release-lease.yaml at line 63, the use of 'optional:
true' allows the task to start without the 'jumpstarter-client-secret'
workspace, which can cause errors later if 'client-config' is also empty. To fix
this, add a conditional check before running 'jmp config client use' to ensure
the client config is present, or update the Task description to clearly document
that the workspace or client-config must be provided to avoid lease-release
failures.

9 changes: 5 additions & 4 deletions tasks/run-cmd/run-cmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ spec:
# Set the Jumpstarter lease environment variable
export JMP_LEASE="$(params.jmp-lease-id)"

# Show the command that will be executed
echo "Running: $(params.jmp-jScript)"

cd /workspace/source
if [ "$(workspaces.source.bound)" == "true" ] ; then
cd "$(workspaces.source.path)"
fi

# Execute the script commands within the Jumpstarter shell
jmp shell --lease "${JMP_LEASE}" <<-EOF
Expand All @@ -77,5 +76,7 @@ spec:
- description: Workspace for mounting Jumpstarter client files.
mountPath: "$(params.home)/.config/jumpstarter/clients"
name: jumpstarter-client-secret
optional: true
- description: Workspace containing the source code / build images
name: source
optional: true
2 changes: 1 addition & 1 deletion tasks/setup-sa-client/setup-sa-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ spec:
cp ${CONFIG_DIR}/default.yaml $(results.config.path)
workspaces:
- name: config-dir
description: The workspace which contains Jumpstarter client config file
description: The workspace which contains Jumpstarter client config file