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

lxd: Wake up on initial startup #57

Merged
merged 1 commit into from
Mar 21, 2023
Merged

lxd: Wake up on initial startup #57

merged 1 commit into from
Mar 21, 2023

Conversation

stgraber
Copy link
Contributor

This allows for LXD to perform its initial startup, generate certificate, ... prior to MicroCloud needing it, making the bootstrap process much faster on slow systems.

This allows for LXD to perform its initial startup, generate
certificate, ... prior to MicroCloud needing it, making the bootstrap
process much faster on slow systems.

Signed-off-by: Stéphane Graber <stephane.graber@canonical.com>
@stgraber
Copy link
Contributor Author

@masnax kinda felt like I should have put something in lxd.go instead but wasn't sure of what exactly as I didn't want to have to instantiate a new object just to call this. Anyway, improvements welcome ;)

@stgraber stgraber merged commit c4373a5 into canonical:main Mar 21, 2023
@masnax
Copy link
Contributor

masnax commented Mar 21, 2023

Seems like the right place to put it. If you want, you can accomplish the same thing through the MicroCloud proxy by adding a method to LXDService

func (s *LXDService) GetServer() (api.Server, error) {
	c, err := s.client("")
	if err != nil {
		return err
	}

       return c.GetServer()
}

and you’d call it with

resources, err := s.Services[types.LXD].(*service.LXDService).GetServer()

Or you could always just make LXDService.client() exportable.

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.

None yet

2 participants