-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Fix uncorrect override of cspm inputs #208562
Conversation
@@ -328,9 +315,9 @@ export function useOnSubmit({ | |||
if (isAgentlessSelected && AGENTLESS_DISABLED_INPUTS.includes(input.type)) { | |||
return { ...input, enabled: false }; | |||
} | |||
return initialPackagePolicy.inputs[i]; | |||
return packagePolicy.inputs[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should fix us. Thanks again.
Pinging @elastic/fleet (Team:Fleet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @criamico |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/13034161380 |
## Summary Fixes a bug introduced with elastic#206074 When a user selected a single account and switched the deployment method to `agentless`, it reverted to the organization selection. This PR removes[ the code](https://github.com/elastic/kibana/pull/206074/files#diff-a169e222e1116859e05821170ab592903c2943613dfe0035c32a4b9d42e5634fR330) that was causing the bug. https://github.com/user-attachments/assets/9007c35b-8454-4f7f-8811-bd39ba7ac99e⚠️ **Important**⚠️ One side effect of this change is that when we switch back from agentless to agent-based, the inputs that were previously hidden and disabled are now visible but they are disabled. This is not ideal but offers the user the option to re enable them, but at least doesn't try to forcefully switch them to initial state, that was the cause of the current bug. https://github.com/user-attachments/assets/520e361b-2789-4081-bb91-c75db88d5431 ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit e758f32)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Fix uncorrect override of cspm inputs (#208562)](#208562) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-29T15:02:48Z","message":"[Fleet] Fix uncorrect override of cspm inputs (#208562)\n\n## Summary\r\nFixes a bug introduced with\r\nhttps://github.com//pull/206074\r\n\r\nWhen a user selected a single account and switched the deployment method\r\nto `agentless`, it reverted to the organization selection. This PR\r\nremoves[ the\r\ncode](https://github.com/elastic/kibana/pull/206074/files#diff-a169e222e1116859e05821170ab592903c2943613dfe0035c32a4b9d42e5634fR330)\r\nthat was causing the bug.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9007c35b-8454-4f7f-8811-bd39ba7ac99e\r\n\r\n\r\n⚠️ **Important**⚠️ \r\nOne side effect of this change is that when we switch back from\r\nagentless to agent-based, the inputs that were previously hidden and\r\ndisabled are now visible but they are disabled. This is not ideal but\r\noffers the user the option to re enable them, but at least doesn't try\r\nto forcefully switch them to initial state, that was the cause of the\r\ncurrent bug.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/520e361b-2789-4081-bb91-c75db88d5431\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e758f32cec09c7e16208d7a89947c9489462e237","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor","v8.18.0"],"title":"[Fleet] Fix uncorrect override of cspm inputs","number":208562,"url":"https://github.com/elastic/kibana/pull/208562","mergeCommit":{"message":"[Fleet] Fix uncorrect override of cspm inputs (#208562)\n\n## Summary\r\nFixes a bug introduced with\r\nhttps://github.com//pull/206074\r\n\r\nWhen a user selected a single account and switched the deployment method\r\nto `agentless`, it reverted to the organization selection. This PR\r\nremoves[ the\r\ncode](https://github.com/elastic/kibana/pull/206074/files#diff-a169e222e1116859e05821170ab592903c2943613dfe0035c32a4b9d42e5634fR330)\r\nthat was causing the bug.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9007c35b-8454-4f7f-8811-bd39ba7ac99e\r\n\r\n\r\n⚠️ **Important**⚠️ \r\nOne side effect of this change is that when we switch back from\r\nagentless to agent-based, the inputs that were previously hidden and\r\ndisabled are now visible but they are disabled. This is not ideal but\r\noffers the user the option to re enable them, but at least doesn't try\r\nto forcefully switch them to initial state, that was the cause of the\r\ncurrent bug.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/520e361b-2789-4081-bb91-c75db88d5431\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e758f32cec09c7e16208d7a89947c9489462e237"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208562","number":208562,"mergeCommit":{"message":"[Fleet] Fix uncorrect override of cspm inputs (#208562)\n\n## Summary\r\nFixes a bug introduced with\r\nhttps://github.com//pull/206074\r\n\r\nWhen a user selected a single account and switched the deployment method\r\nto `agentless`, it reverted to the organization selection. This PR\r\nremoves[ the\r\ncode](https://github.com/elastic/kibana/pull/206074/files#diff-a169e222e1116859e05821170ab592903c2943613dfe0035c32a4b9d42e5634fR330)\r\nthat was causing the bug.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9007c35b-8454-4f7f-8811-bd39ba7ac99e\r\n\r\n\r\n⚠️ **Important**⚠️ \r\nOne side effect of this change is that when we switch back from\r\nagentless to agent-based, the inputs that were previously hidden and\r\ndisabled are now visible but they are disabled. This is not ideal but\r\noffers the user the option to re enable them, but at least doesn't try\r\nto forcefully switch them to initial state, that was the cause of the\r\ncurrent bug.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/520e361b-2789-4081-bb91-c75db88d5431\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e758f32cec09c7e16208d7a89947c9489462e237"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
Summary
Fixes a bug introduced with #206074
When a user selected a single account and switched the deployment method to
agentless
, it reverted to the organization selection. This PR removes the code that was causing the bug.Screen.Recording.2025-01-28.at.16.40.46.mov
One side effect of this change is that when we switch back from agentless to agent-based, the inputs that were previously hidden and disabled are now visible but they are disabled. This is not ideal but offers the user the option to re enable them, but at least doesn't try to forcefully switch them to initial state, that was the cause of the current bug.
Screen.Recording.2025-01-28.at.16.53.17.mov
Checklist
release_note:*
label is applied per the guidelines