예제 #1
0
func (db *deploymentBuilder) completeConstruction() error {
	return firsterr.Returned(
		db.retrieveDeploy,
		db.retrieveImageLabels,
		db.assignClusterName,
		db.unpackDeployConfig,
		db.determineManifestKind,
	)
}
예제 #2
0
func manifestIDFromValues(qv *QueryValues) (sous.ManifestID, error) {
	var r, o, f string
	var err error
	err = firsterr.Returned(
		func() error { r, err = qv.Single("repo"); return err },
		func() error { o, err = qv.Single("offset", ""); return err },
		func() error { f, err = qv.Single("flavor", ""); return err },
	)
	if err != nil {
		return sous.ManifestID{}, err
	}

	return sous.ManifestID{
		Source: sous.SourceLocation{
			Repo: r,
			Dir:  o,
		},
		Flavor: f,
	}, nil
}
예제 #3
0
func sourceIDFromValues(qv *QueryValues) (sous.SourceID, error) {
	var r, o, vs string
	var v semv.Version
	var err error
	var sid sous.SourceID

	return sid, firsterr.Returned(
		func() error { r, err = qv.Single("repo"); return err },
		func() error { o, err = qv.Single("offset", ""); return err },
		func() error { vs, err = qv.Single("version", ""); return err },
		func() error { v, err = semv.Parse(vs); return err },
		func() error {
			sid = sous.SourceID{
				Location: sous.SourceLocation{
					Repo: r,
					Dir:  o,
				},
				Version: v,
			}
			return nil
		},
	)
}