app/plan.go
func (s *planService) ensureDefault() error {
	plans, err := s.storage.FindAll()
	if err != nil {
		return err
	}
	if len(plans) > 0 {
		return nil
	}
	configMemory, _ := config.GetInt("docker:memory")
	configSwap, _ := config.GetInt("docker:swap")
	dp := appTypes.Plan{
		Name:     "autogenerated",
		Memory:   int64(configMemory) * 1024 * 1024,
		Swap:     int64(configSwap-configMemory) * 1024 * 1024,
		CpuShare: 100,
		Default:  true,
	}
	return s.storage.Insert(dp)
}
func (s *planService) ensureDefault() error {
	plans, err := s.storage.FindAll()
	if err != nil {
		return err
	}
	if len(plans) > 0 {
		return nil
	}
	configMemory, _ := config.GetInt("docker:memory")
	configSwap, _ := config.GetInt("docker:swap")
	dp := appTypes.Plan{
		Name:     "autogenerated",
		Memory:   int64(configMemory) * 1024 * 1024,
		Swap:     int64(configSwap-configMemory) * 1024 * 1024,
		CpuShare: 100,
		Default:  true,
	}
	return s.storage.Insert(dp)
}
// ensureDefault creates and stores an autogenerated plan in case of no plans
// exists.