Skip to content

Commit

Permalink
fix check for zosrc creation
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamadazmy committed Nov 26, 2021
1 parent aeb99c0 commit f46b212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/primitives/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

const (
// this probably need a way to update. for now just hard code it
cloudContainerFlist = "https://hub.grid.tf/omar0.3bot/cloud-container.flist"
cloudContainerFlist = "https://hub.grid.tf/azmy.3bot/cloud-container.flist"
cloudContainerName = "cloud-container"
)

Expand Down
7 changes: 4 additions & 3 deletions pkg/vm/ch.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ func (m *Machine) findVirtioFsMount() (*VirtioFS, error) {
}

func (m *Machine) buildZosRC() error {
if len(m.Environment) == 0 || m.Entrypoint == "" {
if len(m.Environment) == 0 && m.Entrypoint == "" {
// nothing to add in .zosrc
return nil
}

fs, err := m.findVirtioFsMount()
if err != nil {
return err
Expand Down Expand Up @@ -216,7 +217,7 @@ func (m *Machine) buildZosRC() error {
return nil
}

func (m *Machine) appendEnv(file *os.File) error {
func (m *Machine) appendEnv(file io.Writer) error {
for k, v := range m.Environment {
if _, err := fmt.Fprintf(file, "export %s=%s\n", k, quote(v)); err != nil {
return err
Expand All @@ -225,7 +226,7 @@ func (m *Machine) appendEnv(file *os.File) error {
return nil
}

func (m *Machine) appendEntrypoint(file *os.File) error {
func (m *Machine) appendEntrypoint(file io.Writer) error {
parts, err := shlex.Split(m.Entrypoint)
if err != nil {
return errors.Wrap(err, "invalid entrypoint")
Expand Down

0 comments on commit f46b212

Please sign in to comment.