Skip to content

Commit

Permalink
Merge pull request #8 from maquanyi/develop
Browse files Browse the repository at this point in the history
Add registry/distribution/standalone setting
  • Loading branch information
genedna committed Aug 4, 2015
2 parents 97319c4 + 2625a93 commit 4a663a8
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ var (
DBPasswd string
DBDB int64
//Dockyard
BackendDriver string
ImagePath string
Domains string
BackendDriver string
ImagePath string
Domains string
RegistryVersion string
DistributionVersion string
Standalone string
)

func SetConfig(path string) error {
Expand Down Expand Up @@ -135,5 +138,23 @@ func SetConfig(path string) error {
err = fmt.Errorf("Domains value is null")
}

if registryVersion := conf.String("dockyard::registry"); registryVersion != "" {
RegistryVersion = registryVersion
} else if registryVersion == "" {
err = fmt.Errorf("Registry version value is null")
}

if distributionVersion := conf.String("dockyard::distribution"); distributionVersion != "" {
DistributionVersion = distributionVersion
} else if distributionVersion == "" {
err = fmt.Errorf("Distribution version value is null")
}

if standalone := conf.String("dockyard::Standalone"); standalone != "" {
Standalone = standalone
} else if standalone == "" {
err = fmt.Errorf("Standalone version value is null")
}

return err
}

0 comments on commit 4a663a8

Please sign in to comment.