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

Refactor(cv_deploy): Optimize creation of configlet containers #3950

Conversation

ClausHolbechArista
Copy link
Contributor

Change Summary

Optimize creation of configlet containers, but only creating/updating missing containers.

Component(s) name

arista.avd.cv_deploy

Proposed changes

  • Fetch all containers already associated with the top-level AVD configs container
  • Only update containers that are missing or have wrong configuration.

How to test

  • Should be tested with molecule manually (pending).

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

LOGGER.info("deploy_configs_to_cv: %s existing device containers under AVD root container.", len(existing_device_containers))
# Create dict keyed by container id with value of tuple containing key container parameters. Used later to detect changes.
existing_device_containers_by_id = {
cv_container.key.configlet_assignment_id: (cv_container.display_name, cv_container.description, cv_container.query, cv_container.configlet_ids)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please add a suggestion with the fix, or just commit the fix directly here.

Copy link

sonarcloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@alexeygorbunov alexeygorbunov left a comment

Choose a reason for hiding this comment

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

Tested manually against 2024.1.2 - LGTM!

@ClausHolbechArista ClausHolbechArista added the one approval This PR has one approval and is only missing one more. label Jun 7, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Jun 21, 2024
@carlbuchmann carlbuchmann force-pushed the refactor/cv_deploy/optimize-container-creation branch from 4ffeb78 to 0ed1ec6 Compare June 21, 2024 14:18
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Jun 21, 2024
@ClausHolbechArista ClausHolbechArista force-pushed the refactor/cv_deploy/optimize-container-creation branch from b45841e to 0ed1ec6 Compare June 21, 2024 14:47
Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

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

LGTM - tested with cv_deploy and cv_workflow molecule scenarios

@carlbuchmann carlbuchmann merged commit 122c299 into aristanetworks:devel Jun 21, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Refactor(cv_deploy)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants