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

Migrate populating local demo data through database.sql to using NetBox API #177

Merged
merged 16 commits into from
Dec 18, 2024

Conversation

henrybear327
Copy link
Collaborator

@henrybear327 henrybear327 commented Dec 16, 2024

Several changes are introduced in this PR

  • database.sql is stripped down to only populating the API token
  • The local demo data is now populated through NetBox API, by using a Python script and running as a Kubernetes job, which makes it easier to work across NetBox versions. (idea from @jstudler)

e2e tests are modified accordingly, as we also migrate to using locally-created tenants and sites only (idea from @bruelea ). We are also check if the tenant and site from parentPrefixSelector and the spec is properly leveraged by using 2 different tenants and sites.

Implements and closes #175

@henrybear327 henrybear327 force-pushed the kind/migrate_setup_to_netbox_api branch from 5eb79ad to 75fc276 Compare December 16, 2024 14:42
@henrybear327
Copy link
Collaborator Author

henrybear327 commented Dec 17, 2024

There are several TODO(henrybear327) that will be deferred for the future, as it's NetBox implementation-related issues

@henrybear327 henrybear327 marked this pull request as ready for review December 17, 2024 11:30
@henrybear327
Copy link
Collaborator Author

To run the e2e test locally, please use a clean kind cluster (you can remove the current one by executing kind delete cluster --name kind), and execute make create-kind deploy-kind test-e2e @faebr

Copy link
Contributor

@faebr faebr left a comment

Choose a reason for hiding this comment

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

Looks way clearer now with the python script I like it. Also tested it locally on my machine and works as expected.

@henrybear327 henrybear327 merged commit 327b3a1 into main Dec 18, 2024
6 checks passed
@henrybear327 henrybear327 deleted the kind/migrate_setup_to_netbox_api branch December 18, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate populating local demo data through database.sql to using NetBox API
2 participants