lxd/db/containers.go
func ContainerToArgs(container *Container) ContainerArgs {
	args := ContainerArgs{
		ID:           container.ID,
		Project:      container.Project,
		Name:         container.Name,
		Node:         container.Node,
		Ctype:        ContainerType(container.Type),
		Architecture: container.Architecture,
		Ephemeral:    container.Ephemeral,
		CreationDate: container.CreationDate,
		Stateful:     container.Stateful,
		LastUsedDate: container.LastUseDate,
		Description:  container.Description,
		Config:       container.Config,
		Devices:      container.Devices,
		Profiles:     container.Profiles,
		ExpiryDate:   container.ExpiryDate,
	}

	if args.Devices == nil {
		args.Devices = types.Devices{}
	}

	return args
}
func ContainerToArgs(container *Container) ContainerArgs {
	args := ContainerArgs{
		ID:           container.ID,
		Project:      container.Project,
		Name:         container.Name,
		Node:         container.Node,
		Ctype:        ContainerType(container.Type),
		Architecture: container.Architecture,
		Ephemeral:    container.Ephemeral,
		CreationDate: container.CreationDate,
		Stateful:     container.Stateful,
		LastUsedDate: container.LastUseDate,
		Description:  container.Description,
		Config:       container.Config,
		Devices:      container.Devices,
		Profiles:     container.Profiles,
		ExpiryDate:   container.ExpiryDate,
	}

	if args.Devices == nil {
		args.Devices = types.Devices{}
	}

	return args
}
func ContainerToArgs ( container * Container ) ContainerArgs { args := ContainerArgs { ID : container . ID , Project : container . Project , Name : container . Name , Node : container . Node , Ctype : ContainerType ( container . Type ) , Architecture : container . Architecture , Ephemeral : container . Ephemeral , CreationDate : container . CreationDate , Stateful : container . Stateful , LastUsedDate : container . LastUseDate , Description : container . Description , Config : container . Config , Devices : container . Devices , Profiles : container . Profiles , ExpiryDate : container . ExpiryDate , } if args . Devices == nil { args . Devices = types . Devices { } } return args }
// ContainerToArgs is a convenience to convert the new Container db struct into
// the legacy ContainerArgs.
ContainerToArgs is a convenience to convert the new Container db struct into the legacy ContainerArgs .