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

OSModifier: Add kernel cmdline in EMU API and update extraCommandLine to a list #11080

Open
wants to merge 7 commits into
base: 3.0-dev
Choose a base branch
from

Conversation

elainezhao96
Copy link
Contributor

@elainezhao96 elainezhao96 commented Nov 14, 2024

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • Ready to merge

Summary

What does the PR accomplish, why was it needed?
Add kernel cmdline in EMU API
related PR that updates trident: https://dev.azure.com/mariner-org/ECF/_git/trident/pullrequest/20937

Change Log
  • update extraCommandLine to a list of strings
  • kernel cmdline in EMU API
Does this affect the toolchain?

NO

Test Methodology
  • Will have trident-e2e pipeline verify the change

@elainezhao96 elainezhao96 marked this pull request as ready for review November 15, 2024 23:35
@elainezhao96 elainezhao96 requested review from a team as code owners November 15, 2024 23:35
toolkit/tools/imagecustomizerapi/kernelextraarguments.go Outdated Show resolved Hide resolved
toolkit/tools/imagecustomizerapi/kernelextraarguments.go Outdated Show resolved Hide resolved
toolkit/tools/osmodifierapi/os.go Outdated Show resolved Hide resolved
toolkit/tools/pkg/imagecustomizerlib/typeConversion.go Outdated Show resolved Hide resolved
@elainezhao96 elainezhao96 changed the title OSModifier: Add services, modules, and kernel cmdline in EMU API OSModifier: Add kernel cmdline in EMU API and update extraCommandLine to a list Nov 21, 2024
@@ -12,10 +12,10 @@ import (
func TestIsoIsValid(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I delete this or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

You could use an empty string for the ExtraCommandLine item.

@@ -12,10 +12,10 @@ import (
func TestIsoIsValid(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use an empty string for the ExtraCommandLine item.

@@ -6,18 +6,6 @@ import (
"strings"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is any of the other code in this file still being used? Can the whole file be deleted?

@@ -215,14 +215,3 @@ func TestOSIsValidOverlayDuplicateWorkDir(t *testing.T) {
err := os.IsValid()
assert.ErrorContains(t, err, "duplicate workDir (/work_root) found in overlay at index 1")
}

func TestOSIsValidInvalidKernelCommandLine(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this test be kept by using a empty string item?

@@ -420,7 +423,8 @@ func (b *LiveOSIsoBuilder) updateGrubCfg(isoGrubCfgFileName string, pxeGrubCfgFi
}

liveosKernelArgs := fmt.Sprintf(kernelArgsLiveOSTemplate, liveOSDir, liveOSImage)
additionalKernelCommandline := liveosKernelArgs + " " + string(savedConfigs.Iso.KernelCommandLine.ExtraCommandLine)
savedArgs := strings.Join(savedConfigs.Iso.KernelCommandLine.ExtraCommandLine, " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use GrubArgsToString here.

@@ -165,7 +166,7 @@ func TestCustomizeImageLiveCd1(t *testing.T) {
savedConfigs = &SavedConfigs{}
err = imagecustomizerapi.UnmarshalYamlFile(savedConfigsFilePath, savedConfigs)
assert.NoErrorf(t, err, "read (%s) file", savedConfigsFilePath)
assert.Equal(t, "rd.info rd.debug", string(savedConfigs.Iso.KernelCommandLine.ExtraCommandLine))
assert.Equal(t, "rd.info rd.debug", strings.Join(savedConfigs.Iso.KernelCommandLine.ExtraCommandLine, " "))
Copy link
Contributor

Choose a reason for hiding this comment

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

assert.Equal can compare lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants