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

Remove FLEET_SERVER_POLICY_NAME from container command #25149

Merged
merged 5 commits into from
Apr 22, 2021

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Apr 19, 2021

What does this PR do?

Fixes an issue where FLEET_SERVER_POLICY_NAME was not being used and need to be removed.

Why is it important?

So FLEET_SERVER_POLICY_NAME doesn't exist.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@blakerouse blakerouse added bug Team:Elastic-Agent Label for the Agent team backport-v7.13.0 Automated backport with mergify labels Apr 19, 2021
@blakerouse blakerouse self-assigned this Apr 19, 2021
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 19, 2021
@blakerouse blakerouse marked this pull request as ready for review April 19, 2021 17:20
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@ruflin
Copy link
Member

ruflin commented Apr 19, 2021

Assuming the policy id works, do we even need support for the policy name?

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 19, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #25149 updated

  • Start Time: 2021-04-21T19:03:26.031+0000

  • Duration: 60 min 32 sec

  • Commit: 0874adb

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

@blakerouse
Copy link
Contributor Author

@ruflin We don't have to, it just a convenience for the users. I am okay with removing it as well.

@ruflin
Copy link
Member

ruflin commented Apr 20, 2021

I kind of like the convenience of it but I'm also a bit worried that names can change and not sure if users will really use it. What we should probably make easier is to find the id of a policy. I currently copy it from the Kibana url.

The other part I stumbled over is that on the command line, we only have --fleet-server-policy. Does this take a id and a name or only the id? Should we be more specific and call it --fleet-server-policy-id?

Supporting the name makes the code more complex at the moment so I would skip it if we can and it adds more Kibana logic, which I'm not a big fan of :-)

@mergify
Copy link
Contributor

mergify bot commented Apr 20, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix-25136 upstream/fix-25136
git merge upstream/master
git push upstream fix-25136

@blakerouse
Copy link
Contributor Author

@ruflin The CLI command-line only allows the ID. I think with that, maybe we just remove name.

@ruflin
Copy link
Member

ruflin commented Apr 21, 2021

Lets remove name, that should get rid of the confusion.

@blakerouse
Copy link
Contributor Author

@ruflin I have updated this to remove the FLEET_SERVER_POLICY_NAME. Should be okay after FF being that the ENV was ignored anyway.

@blakerouse blakerouse added the backport-v7.14.0 Automated backport with mergify label Apr 21, 2021
@blakerouse blakerouse changed the title Convert FLEET_SERVER_POLICY_NAME to FLEET_SERVER_POLICY_ID from Kibana API Remove FLEET_SERVER_POLICY_NAME from container command Apr 21, 2021
@mergify
Copy link
Contributor

mergify bot commented Apr 21, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix-25136 upstream/fix-25136
git merge upstream/master
git push upstream fix-25136

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

++ on removing it. One minor comment. I think I miss why we care about the TokenPolicyName.

@blakerouse blakerouse merged commit 43280e0 into elastic:master Apr 22, 2021
@blakerouse blakerouse deleted the fix-25136 branch April 22, 2021 11:52
mergify bot pushed a commit that referenced this pull request Apr 22, 2021
* Convert FLEET_SERVER_POLICY_NAME to FLEET_SERVER_POLICY_ID from Kibana API.

* Add changelog.

* Remove FLEET_SERVER_POLICY_NAME

* Fix changelog.

(cherry picked from commit 43280e0)
mergify bot pushed a commit that referenced this pull request Apr 22, 2021
* Convert FLEET_SERVER_POLICY_NAME to FLEET_SERVER_POLICY_ID from Kibana API.

* Add changelog.

* Remove FLEET_SERVER_POLICY_NAME

* Fix changelog.

(cherry picked from commit 43280e0)
blakerouse added a commit that referenced this pull request Apr 22, 2021
* Convert FLEET_SERVER_POLICY_NAME to FLEET_SERVER_POLICY_ID from Kibana API.

* Add changelog.

* Remove FLEET_SERVER_POLICY_NAME

* Fix changelog.

(cherry picked from commit 43280e0)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Apr 22, 2021
* Convert FLEET_SERVER_POLICY_NAME to FLEET_SERVER_POLICY_ID from Kibana API.

* Add changelog.

* Remove FLEET_SERVER_POLICY_NAME

* Fix changelog.

(cherry picked from commit 43280e0)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify bug Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[elastic-agent][container] FLEET_SERVER_POLICY_ID is ignored when enrolling
3 participants