image-builder: rename --store to --cache
Closes #77. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
parent
0580eb1106
commit
ee38c45122
2 changed files with 7 additions and 7 deletions
|
|
@ -151,7 +151,7 @@ func cmdManifest(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
func cmdBuild(cmd *cobra.Command, args []string) error {
|
||||
storeDir, err := cmd.Flags().GetString("store")
|
||||
cacheDir, err := cmd.Flags().GetString("cache")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
|
|||
|
||||
buildOpts := &buildOptions{
|
||||
OutputDir: outputDir,
|
||||
StoreDir: storeDir,
|
||||
StoreDir: cacheDir,
|
||||
WriteManifest: slices.Contains(extraArtifacts, "manifest"),
|
||||
}
|
||||
return buildImage(res, mf.Bytes(), buildOpts)
|
||||
|
|
@ -242,7 +242,7 @@ operating sytsems like centos and RHEL with easy customizations support.`,
|
|||
}
|
||||
buildCmd.Flags().AddFlagSet(manifestCmd.Flags())
|
||||
// XXX: add --rpmmd cache too and put under /var/cache/image-builder/dnf
|
||||
buildCmd.Flags().String("store", "/var/cache/image-builder/store", `osbuild store directory to cache intermediata build artifacts"`)
|
||||
buildCmd.Flags().String("cache", "/var/cache/image-builder/store", `osbuild directory to cache intermediate build artifacts"`)
|
||||
rootCmd.AddCommand(buildCmd)
|
||||
|
||||
return rootCmd.Execute()
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ func TestBuildIntegrationHappy(t *testing.T) {
|
|||
"qcow2",
|
||||
fmt.Sprintf("--blueprint=%s", makeTestBlueprint(t, testBlueprint)),
|
||||
"--distro", "centos-9",
|
||||
"--store", tmpdir,
|
||||
"--cache", tmpdir,
|
||||
})
|
||||
defer restore()
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ func TestBuildIntegrationHappy(t *testing.T) {
|
|||
// ensure osbuild was run exactly one
|
||||
assert.Equal(t, 1, len(fakeOsbuildCmd.Calls()))
|
||||
osbuildCall := fakeOsbuildCmd.Calls()[0]
|
||||
// --store is passed correctly to osbuild
|
||||
// --cache is passed correctly to osbuild
|
||||
storePos := slices.Index(osbuildCall, "--store")
|
||||
assert.True(t, storePos > -1)
|
||||
assert.Equal(t, tmpdir, osbuildCall[storePos+1])
|
||||
|
|
@ -375,7 +375,7 @@ func TestBuildIntegrationSwitchOutputDir(t *testing.T) {
|
|||
"build",
|
||||
"qcow2",
|
||||
"--distro", "centos-9",
|
||||
"--store", tmpdir,
|
||||
"--cache", tmpdir,
|
||||
"--output-dir", "some-output-dir",
|
||||
})
|
||||
defer restore()
|
||||
|
|
@ -410,7 +410,7 @@ func TestBuildIntegrationExtraArtifactsManifest(t *testing.T) {
|
|||
"build",
|
||||
"qcow2",
|
||||
"--distro", "centos-9",
|
||||
"--store", outputDir,
|
||||
"--cache", outputDir,
|
||||
"--extra-artifacts", "manifest",
|
||||
"--output-dir", outputDir,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue