Skip to content

Commit

Permalink
Fix recovery-system.uri env var mapping
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <dcassany@suse.com>
  • Loading branch information
davidcassany committed Feb 27, 2024
1 parent 82da3fd commit d986262
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,21 +326,23 @@ var _ = Describe("Config", Label("config"), func() {
Expect(err).ShouldNot(HaveOccurred())
err = os.Setenv("ELEMENTAL_INSTALL_SYSTEM", "itwillbeignored")
Expect(err).ShouldNot(HaveOccurred())
err = os.Setenv("ELEMENTAL_INSTALL_REPOVERY_SYSTEM", "recovery/image:from_env_vars")
Expect(err).ShouldNot(HaveOccurred())
err = os.Setenv("ELEMENTAL_INSTALL_CLOUD_INIT", "path/to/file1.yaml,/absolute/path/to/file2.yaml")
Expect(err).ShouldNot(HaveOccurred())
err = os.Setenv("ELEMENTAL_INSTALL_DISABLE_BOOT_ENTRY", "true")
Expect(err).ShouldNot(HaveOccurred())

spec, err := ReadInstallSpec(cfg, flags)
Expect(err).ShouldNot(HaveOccurred())
// Overwrites target from environment variables
// Overwrites target and recovery-system from environment variables
Expect(spec.Target == "/env/disk")
Expect(spec.RecoverySystem.Source.Value() == "recovery/image:from_env_vars")
// Overwrites system image, flags have priority over files and env vars
Expect(spec.System.Value() == "image/from:flag")
// Overwerites default value for DisableBootEntry from an env var
Expect(spec.DisableBootEntry).To(BeTrue())
// Uses recovery and no-format defined in confing.yaml
Expect(spec.RecoverySystem.Source.Value() == "recovery/image:latest")
// Uses no-format defined in confing.yaml
Expect(spec.NoFormat == true)
// Gets multiple cloud-init files from env vars as comma separated values
Expect(len(spec.CloudInit)).To(Equal(2))
Expand Down

0 comments on commit d986262

Please sign in to comment.