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

fix(6023): replace list with items #6437

Conversation

kaanyalti
Copy link
Contributor

@kaanyalti kaanyalti commented Dec 25, 2024

  • Bug

What does this PR do?

Replaces list with items from from kibanaFetchToken as the list is deprecated in the api response and will be removed.

Why is it important?

The list in the api response is going to be removed in favor of item

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/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

There shouldn't be any user impact

How to test this PR locally

  • Deploy ESS
  • Build the agent by running the following command
SNAPSHOT=true PLATFORMS="linux/arm64" PACKAGES="docker" EXTERNAL=true mage -v package
  • Then get the image id for any of the created elastic-agent images and run the following command
docker run \
  --env FLEET_ENROLL=1 \
  --env KIBANA_HOST=<KIBANA HOST> \
  --env KIBANA_USERNAME=<KIBANA USER NAME> \
  --env KIBANA_PASSWORD=<KIBANA PASSWORD> \
  --env FLEET_TOKEN_POLICY_NAME=<POLICY NAME> \
  --env FLEET_URL=<FLEET URL> \
  --rm <IMAGE ID>
  • Validate that the agent is able to enroll

Related issues

Copy link
Contributor

mergify bot commented Dec 25, 2024

This pull request does not have a backport label. Could you fix it @kaanyalti? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Dec 25, 2024

backport-v8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Dec 25, 2024
@kaanyalti kaanyalti marked this pull request as ready for review December 27, 2024 00:32
@kaanyalti kaanyalti requested a review from a team as a code owner December 27, 2024 00:32
@kaanyalti kaanyalti force-pushed the fix/6023-remove_deprecated_list_property_in_favor_of_items branch from 40d8fbc to 3d55a2b Compare December 27, 2024 00:36
Items []testKibanaApiKey `json:"items"`
}

// TODO: Remove test after list deprecation is complete
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to add an issue link to remove the link from the kibana api, if anyone knows of such an issue please comment here.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's crete an issue in our repo. this change is breaking and will be removed in 9.0
we can create a PR targeting main with skip backport right away after this one is merge, removing this test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michalpristas michalpristas added the bug Something isn't working label Dec 30, 2024
@kaanyalti kaanyalti force-pushed the fix/6023-remove_deprecated_list_property_in_favor_of_items branch from 9f9c2b9 to 4853b06 Compare December 31, 2024 03:02
@kaanyalti kaanyalti force-pushed the fix/6023-remove_deprecated_list_property_in_favor_of_items branch from 4853b06 to 4d28b79 Compare December 31, 2024 03:04
@swiatekm swiatekm added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Dec 31, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@jlind23 jlind23 merged commit 68d5833 into elastic:main Dec 31, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Dec 31, 2024
* fix(6023): replace list with items

* fix(6023): added changelog

* fix(6023): added test validating the new items matches the deprecated list

* fix(6023): added comment to better trace where the integration test comes from

The integration test added in this pull request needs to be removed once the list component is removed from the kibana api

* fixs(6023): ran mage update

* fix(6023): add build tag to integration test

* fix(6023): added unit test for kibanaFetchToken

* fix(6023): added error checks in unit test

(cherry picked from commit 68d5833)
@kaanyalti kaanyalti deleted the fix/6023-remove_deprecated_list_property_in_favor_of_items branch December 31, 2024 15:30
jlind23 pushed a commit that referenced this pull request Jan 2, 2025
* fix(6023): replace list with items

* fix(6023): added changelog

* fix(6023): added test validating the new items matches the deprecated list

* fix(6023): added comment to better trace where the integration test comes from

The integration test added in this pull request needs to be removed once the list component is removed from the kibana api

* fixs(6023): ran mage update

* fix(6023): add build tag to integration test

* fix(6023): added unit test for kibanaFetchToken

* fix(6023): added error checks in unit test

(cherry picked from commit 68d5833)

Co-authored-by: Kaan Yalti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fleet deprecated list property when retrieving enrollment api keys
5 participants