14144 s3 endpoint field in cluster configuration missing input validation
Summary
The core requirement was to prevent users from entering "http://" or "https://" at the beginning of the S3 endpoint URL in a form, and consequently, disable the main "Save" button of the cluster creation/edit form. Additionally, a tooltip should appear next to the endpoint field to inform the user about this specific error.
Fixes #14144
Occurred changes and/or fixed issues
Check if value typed on endpoint form is http:// or https://, in case of positive, return an error and disable the save button. The save button was kept enable in view mode, the fix was to disable it in case the mode is view.
Technical notes summary
Areas or cases that should be tested
Rancher new cluster`s provisioning with etcd/s3 endpoint information Browser: Opera 119.0.5497.88 Steps to reproduce: Scenario 1)
- Create new cluster (custom)
- Tab etcd > Save Backup to s3 (enable) > set values on endpoint field (https://localhost:9000 or http://localhost)
Scenario 2)
- Create new cluster (custom)
- Tab etcd > Save Backup to s3 (enable) > set values on endpoint field (localhost:9000)
- Save
Screenshot/Video
Screencast From 2025-06-23 14-06-54.webm
Checklist
- [x] The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
- [x] The PR template has been filled out
- [x] The PR has been self reviewed
- [x] The PR has a reviewer assigned
- [x] The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
- [] The PR has been reviewed in terms of Accessibility
Note that the issue is currently targeting 2.13, and 2.12 priorities need to come first
Hi @richard-cox I made the changes you asked, when you have time can you take a look, please? thank you
@marytlf thanks, it's on the stack
Apologies, i haven't managed to get back to this one, moving to 2.13.0
@marytlf @eva-vashkevich The 'Save Backups to S3' section is now visible only when 'Automatic Backups' are enabled. Is this a wanted change?
Hi @torchiaf I see "Save Backups to S3" only visible when "Automatic backups" are enabled on master too. Can you please elaborate on what you meant?
@richard-cox Naturally, we also weren't clearing our s3 fields if Automatic backups are disabled, so I fixed that too I've improved the regex a bit as well, please let me know if you think it is too restrictive
/backport-bot v2.12.2 release-2.12
Not creating port PR, there was an error running git am -3:
Applying: disable edit when view mode
.git/rebase-apply/patch:255: trailing whitespace.
.git/rebase-apply/patch:258: trailing whitespace.
.git/rebase-apply/patch:259: trailing whitespace.
return false;
.git/rebase-apply/patch:263: trailing whitespace.
warning: 4 lines add whitespace errors.
Using index info to reconstruct a base tree...
M shell/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue
Falling back to patching base and 3-way merge...
Auto-merging shell/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue
CONFLICT (content): Merge conflict in shell/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 disable edit when view mode