示例#1
0
func PortsService(do *definitions.Do) error {
	service, err := loaders.LoadServiceDefinition(do.Name, false, do.Operations.ContainerNumber)
	if err != nil {
		return err
	}

	if IsServiceExisting(service.Service, service.Operations) {
		logger.Debugf("Service exists, getting port mapping.\n")
		return perform.PrintPortMappings(service.Operations.SrvContainerID, do.Args)
	}

	return nil
}
示例#2
0
func PortsChain(do *definitions.Do) error {
	chain, err := loaders.LoadChainDefinition(do.Name, false, do.Operations.ContainerNumber)
	if err != nil {
		return err
	}

	if IsChainExisting(chain) {
		logger.Debugf("Chain exists, getting port mapping.\n")
		return perform.PrintPortMappings(chain.Operations.SrvContainerID, do.Args)
	}

	return nil
}