Skip to content

Commit

Permalink
openshift/v4.18: Remove GRUB password support
Browse files Browse the repository at this point in the history
  • Loading branch information
yasminvalim committed Dec 2, 2024
1 parent f8b4b3b commit 89f6a55
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 84 deletions.
1 change: 0 additions & 1 deletion config/openshift/v4_18/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (c Config) ToMachineConfig4_18Unvalidated(options common.TranslateOptions)
if r.IsFatal() {
return result.MachineConfig{}, ts, r
}
ts = translateUserGrubCfg(&cfg, &ts)

// wrap
ts = ts.PrefixPaths(path.New("yaml"), path.New("json", "spec", "config"))
Expand Down
83 changes: 0 additions & 83 deletions config/openshift/v4_18/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,89 +272,6 @@ func TestTranslateConfig(t *testing.T) {
{From: path.New("yaml", "openshift", "fips"), To: path.New("json", "spec", "fips")},
},
},
// Test Grub config
{
Config{
Metadata: Metadata{
Name: "z",
Labels: map[string]string{
ROLE_LABEL_KEY: "z",
},
},
Config: fcos.Config{
Grub: fcos.Grub{
Users: []fcos.GrubUser{
{
Name: "root",
PasswordHash: util.StrToPtr("grub.pbkdf2.sha512.10000.874A958E526409..."),
},
},
},
},
},
result.MachineConfig{
ApiVersion: result.MC_API_VERSION,
Kind: result.MC_KIND,
Metadata: result.Metadata{
Name: "z",
Labels: map[string]string{
ROLE_LABEL_KEY: "z",
},
},
Spec: result.Spec{
Config: types.Config{
Ignition: types.Ignition{
Version: "3.4.0",
},
Storage: types.Storage{
Filesystems: []types.Filesystem{
{
Device: "/dev/disk/by-label/boot",
Format: util.StrToPtr("ext4"),
Path: util.StrToPtr("/boot"),
},
},
Files: []types.File{
{
Node: types.Node{
Path: "/boot/grub2/user.cfg",
},
FileEmbedded1: types.FileEmbedded1{
Contents: types.Resource{
Source: util.StrToPtr("data:,%23%20Generated%20by%20Butane%0A%0Aset%20superusers%3D%22root%22%0Apassword_pbkdf2%20root%20grub.pbkdf2.sha512.10000.874A958E526409...%0A"),
Compression: util.StrToPtr(""),
},
},
},
},
},
},
},
},
[]translate.Translation{
{From: path.New("yaml", "version"), To: path.New("json", "apiVersion")},
{From: path.New("yaml", "version"), To: path.New("json", "kind")},
{From: path.New("yaml", "version"), To: path.New("json", "spec")},
{From: path.New("yaml"), To: path.New("json", "spec", "config")},
{From: path.New("yaml", "ignition"), To: path.New("json", "spec", "config", "ignition")},
{From: path.New("yaml", "version"), To: path.New("json", "spec", "config", "ignition", "version")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "filesystems")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "filesystems", 0)},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "filesystems", 0, "path")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "filesystems", 0, "device")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "filesystems", 0, "format")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0)},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0, "path")},
// "append" field is a remnant of translations performed in fcos config
// TODO: add a delete function to translation.TranslationSet and delete "append" translation
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0, "append")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0, "contents")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0, "contents", "source")},
{From: path.New("yaml", "grub", "users"), To: path.New("json", "spec", "config", "storage", "files", 0, "contents", "compression")},
},
},
}

for i, test := range tests {
Expand Down

0 comments on commit 89f6a55

Please sign in to comment.