mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 10:00:01 +08:00 
			
		
		
		
	 b01a330d37
			
		
	
	b01a330d37
	
	
	
		
			
			Changes SSH key behavior such that there is a single persisted key for all machines across all providers. If there is no key that is located at `.local/share/containers/podman/machine/` then it is created. The keys are not deleted when the last machine on the host is removed. The main motivation for this change is it leads to fewer files created on the host as a result of vm configuration. Having `n` machines on your system doesn't result in `2n` machine-related files in `.ssh` on your system anymore. As a result of ssh keys being persisted by default, the `--save-keys` flag on `podman machine rm` will no longer be supported. Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
		
			
				
	
	
		
			47 lines
		
	
	
		
			857 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			857 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package e2e_test
 | |
| 
 | |
| type rmMachine struct {
 | |
| 	/*
 | |
| 	  -f, --force           Stop and do not prompt before rming
 | |
| 	      --save-ignition   Do not delete ignition file
 | |
| 	      --save-image      Do not delete the image file
 | |
| 
 | |
| 	*/
 | |
| 	force        bool
 | |
| 	saveIgnition bool
 | |
| 	saveImage    bool
 | |
| 
 | |
| 	cmd []string
 | |
| }
 | |
| 
 | |
| func (i *rmMachine) buildCmd(m *machineTestBuilder) []string {
 | |
| 	cmd := []string{"machine", "rm"}
 | |
| 	if i.force {
 | |
| 		cmd = append(cmd, "--force")
 | |
| 	}
 | |
| 	if i.saveIgnition {
 | |
| 		cmd = append(cmd, "--save-ignition")
 | |
| 	}
 | |
| 	if i.saveImage {
 | |
| 		cmd = append(cmd, "--save-image")
 | |
| 	}
 | |
| 	cmd = append(cmd, m.name)
 | |
| 	i.cmd = cmd
 | |
| 	return cmd
 | |
| }
 | |
| 
 | |
| func (i *rmMachine) withForce() *rmMachine {
 | |
| 	i.force = true
 | |
| 	return i
 | |
| }
 | |
| 
 | |
| func (i *rmMachine) withSaveIgnition() *rmMachine {
 | |
| 	i.saveIgnition = true
 | |
| 	return i
 | |
| }
 | |
| 
 | |
| func (i *rmMachine) withSaveImage() *rmMachine {
 | |
| 	i.saveImage = true
 | |
| 	return i
 | |
| }
 |