Skip to content

[backport v2.11.5] When attempting to import a new secret using the Import YAML feature, two unexpected behaviors occur #14845

@github-actions

Description

@github-actions

This is a backport issue for #14830, automatically created via GitHub Actions workflow initiated by @gaktive

Original issue body:

Setup

  • Rancher version: v2.12-4d8834975321debf6375eb45b121873a220a3d9b-head
  • Rancher UI Extensions: master 3567111
  • Browser type & version: chrome version 137.0.7151.70 (Official Build) (arm64)

Describe the bug
If a secret with the same name already exists, a red error is displayed, and the existing secret is removed.
If the user tries to import the secret with a new, different name, the secret is not created, and an "Error: Resource Secret Not Found" page is displayed.

To Reproduce

  1. Create a secret with a unique name using the Import YAML feature.
  2. Attempt to import another secret with the same name as the existing secret.
  3. Verify that a red error is displayed and check if the existing secret is removed.
  4. Try importing the secret again with a new, different name.
  5. Verify that the secret is not created and an "Error: Resource Secret Not Found" page is displayed.

Result

  1. Existing secret is removed when importing a secret with a duplicate name.
  2. Secret is not created when importing with a new, different name, and an "Error: Resource Secret Not Found" page is displayed.

Expected Result

  1. When importing a secret with a name that already exists, the system should display an error message and not remove the existing secret.
  2. When importing a secret with a new, unique name, the secret should be created successfully without any errors.

Screenshots
https://github.com/user-attachments/assets/f17fccd7-7745-44a3-b75c-a051ecf65dd4

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions