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

Better labeling for 3rd party provisioners #154

Merged
merged 5 commits into from
Aug 29, 2023

Conversation

ebauman
Copy link
Member

@ebauman ebauman commented Jul 18, 2023

Currently, HobbyFarm requires that for any 3rd party provisioner (e.g. not internal terraform), that the environment be labeled with hobbyfarm.io/provisioner=external
This forces all 3rd party provisioners to receive a VM annotated with that label which does no good if you want to separate out those VMs by provisioner.
This PR changes the logic for labeling such that any VM labeled with a non-empty (!= "") hobbyfarm.io/provisioner label will be treated as external.
Only those VMs that have either an empty label or a nonexistent label of hobbyfarm.io/provisioner will be handled by the internal TFP.

  • go mod tidy
  • switched to "not internal"
  • changed to use label set instead of "internal"

ebauman added 3 commits July 18, 2023 13:47
Signed-off-by: Eamon Bauman <eamon@eamonbauman.com>
Signed-off-by: Eamon Bauman <eamon@eamonbauman.com>
Signed-off-by: Eamon Bauman <eamon@eamonbauman.com>
@ebauman
Copy link
Member Author

ebauman commented Jul 18, 2023

Anything in this PR not related to the provisioner label is a result of GoLand running gofmt
or me running go mod tidy

@jggoebel
Copy link
Member

Might be safe to merge this after merging the microservice pr. I do not think it would break anything but it could produce more conflicts

@ebauman
Copy link
Member Author

ebauman commented Jul 18, 2023

yeah that's fine, just needs to go in before we can publish any of the 3rd party provisioners.
eventually the logic will get overhauled for our VM provisioning stuff but that's not there yet.

Signed-off-by: Eamon Bauman <eamon@eamonbauman.com>
@ebauman
Copy link
Member Author

ebauman commented Jul 20, 2023

There was a race condition in this PR where immediately upon VM creation, the status of the VM would be updated by the 3rd party provisioner. This conflicted with Gargantua trying to write some status details. Gargantua did not have a conflict retry mechanism so the session failed and was deleted.

@ebauman ebauman merged commit bd05307 into hobbyfarm:master Aug 29, 2023
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.

2 participants