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

Enable cloud-init to inject ssh key on applehv #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/macadam/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
initOpts.DiskSize = 50
initOpts.SSHIdentityPath = sshIdentityPath
initOpts.Username = username
initOpts.CloudInit = true // this should be calculated based on the image we want to start ??

Check failure on line 199 in cmd/macadam/init.go

View workflow job for this annotation

GitHub Actions / build (oldstable)

initOpts.CloudInit undefined (type *"github.com/containers/podman/v5/pkg/machine/define".InitOptions has no field or method CloudInit)
Copy link
Collaborator

Choose a reason for hiding this comment

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

most likely, but we can deal with this later, I don't think it's going to be a problem to add cloudinit config to an image which does not use it.

/*
_, _, err = shim.VMExists(machineName, []vmconfigs.VMProvider{provider})
if err == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/imagepullers/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (puller *NoopImagePuller) SetSourceURI(sourcePath string) {

func imageExtension(sourceURI string) string {
if strings.HasSuffix(sourceURI, ".tar.gz") {
return "tar.gz"
return ".tar.gz"
}
return filepath.Ext(sourceURI)
}
Expand All @@ -50,7 +50,7 @@ func (puller *NoopImagePuller) LocalPath() (*define.VMFile, error) {
return nil, err
}

vmFile, err := dirs.DataDir.AppendToNewVMFile(fmt.Sprintf("%s-%s.%s", puller.machineName, puller.vmType.String(), imageExtension(puller.sourceURI)), nil)
vmFile, err := dirs.DataDir.AppendToNewVMFile(fmt.Sprintf("%s-%s%s", puller.machineName, puller.vmType.String(), imageExtension(puller.sourceURI)), nil)
if err != nil {
return nil, err
}
Expand Down
Loading