// Create creates a bundle in the depot and starts its init process
Create creates a bundle in the depot and starts its init process
// Create creates a bundle in the depot and starts its init process
func (c *Containerizer) Create(spec gardener.DesiredContainerSpec) error {
	mlog := plog.Start("create", lager.Data{"handle": spec.Handle})
	defer mlog.Info("created")
	if err := c.depot.Create(spec.Handle, c.bundler.Bundle(spec)); err != nil {
		return mlog.Err("create", err)
	}
	path, err := c.depot.Lookup(spec.Handle)
	if err != nil {
		return mlog.Err("lookup", err)
	}
	stdoutR, stdoutW := io.Pipe()
	if c.runner.withLog(mlog).Start(path, spec.Handle, garden.ProcessIO{
		Stdout: io.MultiWriter(mlog.Start("start-stdout"), stdoutW),
		Stderr: mlog.Start("start-stderr"),
	}); err != nil {
		return mlog.Err("start", err)
	}
	if err := c.startChecker.Check(stdoutR); err != nil {
		return mlog.Err("check", err)
	}
	return nil
}
func ( c * Containerizer ) Create ( spec gardener . DesiredContainerSpec ) error { mlog := plog . Start ( " " , lager . Data { " " : spec . Handle } ) defer mlog . Info ( " " ) if err := c . depot . Create ( spec . Handle , c . bundler . Bundle ( spec ) ) ; err != nil { return mlog . Err ( " " , err ) } path , err := c . depot . Lookup ( spec . Handle ) if err != nil { return mlog . Err ( " " , err ) } stdoutR , stdoutW := io . Pipe ( ) if c . runner . withLog ( mlog ) . Start ( path , spec . Handle , garden . ProcessIO { Stdout : io . MultiWriter ( mlog . Start ( " " ) , stdoutW ) , Stderr : mlog . Start ( " " ) , } ) ; err != nil { return mlog . Err ( " " , err ) } if err := c . startChecker . Check ( stdoutR ) ; err != nil { return mlog . Err ( " " , err ) } return nil }
Create creates a bundle in the depot and starts its init process
Create creates a bundle in the depot and starts its init process