blueprint: sshkey to users in images blueprint conversion
The sshkey customization in osbuild/images has been dropped. In osbuild-composer we maintain it for backwards compatibility, converting each to a user customization, which is a superset of the sshkey.
This commit is contained in:
parent
1f21f8e217
commit
ec01c6908b
2 changed files with 5 additions and 14 deletions
|
|
@ -292,14 +292,7 @@ func Convert(bp Blueprint) iblueprint.Blueprint {
|
|||
ikernel := iblueprint.KernelCustomization(*kernel)
|
||||
customizations.Kernel = &ikernel
|
||||
}
|
||||
if sshkeys := c.SSHKey; sshkeys != nil {
|
||||
isshkeys := make([]iblueprint.SSHKeyCustomization, len(sshkeys))
|
||||
for idx := range sshkeys {
|
||||
isshkeys[idx] = iblueprint.SSHKeyCustomization(sshkeys[idx])
|
||||
}
|
||||
customizations.SSHKey = isshkeys
|
||||
}
|
||||
if users := c.User; users != nil {
|
||||
if users := c.GetUsers(); users != nil { // contains both user customizations and converted sshkey customizations
|
||||
iusers := make([]iblueprint.UserCustomization, len(users))
|
||||
for idx := range users {
|
||||
iusers[idx] = iblueprint.UserCustomization(users[idx])
|
||||
|
|
|
|||
|
|
@ -236,13 +236,11 @@ func TestConvert(t *testing.T) {
|
|||
Name: "kernel-name",
|
||||
Append: "kernel-append",
|
||||
},
|
||||
SSHKey: []iblueprint.SSHKeyCustomization{
|
||||
{
|
||||
User: "ssh-user",
|
||||
Key: "ssh-key",
|
||||
},
|
||||
},
|
||||
User: []iblueprint.UserCustomization{
|
||||
{
|
||||
Name: "ssh-user", // converted from sshkey
|
||||
Key: common.ToPtr("ssh-key"),
|
||||
},
|
||||
{
|
||||
Name: "user-name",
|
||||
Description: common.ToPtr("user-desc"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue