Skip to content
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 agent policy namespace validation #200258

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Nov 14, 2024

Summary

Resolve #193507

Fix how we display validation errors, to show namespace validation errors even if the field is not touched.

That PR fix also some response validation for the space prefix API as managedBy could be null.

How to test?

With space awareness enabled (featureFlag + api call)

Create a policy with a custom namspace,

use the space API to add some restriction, verify the error message is now displayed in the agent policy editor

Screenshot 2024-11-14 at 10 36 47 AM

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 14, 2024
@nchaulet nchaulet self-assigned this Nov 14, 2024
@nchaulet nchaulet marked this pull request as ready for review November 18, 2024 13:09
@nchaulet nchaulet requested a review from a team as a code owner November 18, 2024 13:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@jillguyonnet jillguyonnet left a comment

Choose a reason for hiding this comment

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

Tested, LGTM 🚀

@nchaulet nchaulet merged commit b53ee71 into elastic:main Nov 18, 2024
27 checks passed
@nchaulet nchaulet deleted the fix-agent-policy-space-validation branch November 18, 2024 15:42
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11895917380

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 18, 2024
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 18, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Fix agent policy namespace validation
(#200258)](#200258)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T15:42:47Z","message":"[Fleet]
Fix agent policy namespace validation
(#200258)","sha":"b53ee71ea3b6f3df5833635f87d3a7b358d8bc44","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet]
Fix agent policy namespace
validation","number":200258,"url":"https://github.com/elastic/kibana/pull/200258","mergeCommit":{"message":"[Fleet]
Fix agent policy namespace validation
(#200258)","sha":"b53ee71ea3b6f3df5833635f87d3a7b358d8bc44"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200258","number":200258,"mergeCommit":{"message":"[Fleet]
Fix agent policy namespace validation
(#200258)","sha":"b53ee71ea3b6f3df5833635f87d3a7b358d8bc44"}}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <[email protected]>
jesuswr pushed a commit to jesuswr/kibana that referenced this pull request Nov 18, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: User is not able edit existing agent policies, after running the Prefix namespace API.
4 participants