internal

package
v0.9.1-beta3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppExtension is the extension used by an application.
	AppExtension = ".dockerapp"
	// MetadataFileName is metadata file name
	MetadataFileName = "metadata.yml"
	// ComposeFileName is compose file name
	ComposeFileName = "docker-compose.yml"
	// ParametersFileName is parameters file name
	ParametersFileName = "parameters.yml"

	// DeprecatedSettingsFileName is the deprecated settings file name (replaced by ParametersFileName)
	DeprecatedSettingsFileName = "settings.yml"

	// Namespace is the reverse DNS namespace used with labels and CNAB custom actions.
	Namespace = "com.docker.app."
	// CnabNamespace is the namespace used with the CNAB well known custom actions
	CnabNamespace = "io.cnab."

	// ActionStatusNameDeprecated is the name of the docker custom "status" action
	// Deprecated: use ActionStatusName instead
	ActionStatusNameDeprecated = Namespace + "status"
	// ActionStatusName is the name of the CNAB well known custom "status" action - TODO: Extract this constant to the cnab-go library
	ActionStatusName = CnabNamespace + "status"
	// ActionStatusJSONName is the name of the CNAB well known custom "status+json" action - TODO: Extract this constant to the cnab-go library
	ActionStatusJSONName = CnabNamespace + "status+json"
	// ActionInspectName is the name of the custom "inspect" action
	ActionInspectName = Namespace + "inspect"
	// ActionRenderName is the name of the custom "render" action
	ActionRenderName = Namespace + "render"

	// CredentialDockerContextName is the name of the credential containing a Docker context
	CredentialDockerContextName = Namespace + "context"
	// CredentialDockerContextPath is the path to the credential containing a Docker context
	CredentialDockerContextPath = "/cnab/app/context.dockercontext"
	// CredentialRegistryName is the name of the credential containing registry credentials
	CredentialRegistryName = Namespace + "registry-creds"
	// CredentialRegistryPath is the name to the credential containing registry credentials
	CredentialRegistryPath = "/cnab/app/registry-creds.json"

	// ParameterOrchestratorName is the name of the parameter containing the orchestrator
	ParameterOrchestratorName = Namespace + "orchestrator"
	// ParameterKubernetesNamespaceName is the name of the parameter containing the kubernetes namespace
	ParameterKubernetesNamespaceName = Namespace + "kubernetes-namespace"
	// ParameterRenderFormatName is the name of the parameter containing the render format
	ParameterRenderFormatName = Namespace + "render-format"
	// ParameterInspectFormatName is the name of the parameter containing the inspect format
	ParameterInspectFormatName = Namespace + "inspect-format"
	// ParameterArgs is the name of the parameter containing labels to be applied to service containers
	ParameterArgs = Namespace + "args"
	// ParameterShareRegistryCredsName is the name of the parameter which indicates if credentials should be shared
	ParameterShareRegistryCredsName = Namespace + "share-registry-creds"

	// DockerStackOrchestratorEnvVar is the environment variable set by the CNAB runtime to select
	// the stack orchestrator.
	DockerStackOrchestratorEnvVar = "DOCKER_STACK_ORCHESTRATOR"
	// DockerKubernetesNamespaceEnvVar is the environment variable set by the CNAB runtime to select
	// the kubernetes namespace.
	DockerKubernetesNamespaceEnvVar = "DOCKER_KUBERNETES_NAMESPACE"
	// DockerRenderFormatEnvVar is the environment variable set by the CNAB runtime to select
	// the render output format.
	DockerRenderFormatEnvVar = "DOCKER_RENDER_FORMAT"
	// DockerInspectFormatEnvVar is the environment variable set by the CNAB runtime to select
	// the inspect output format.
	DockerInspectFormatEnvVar = "DOCKER_INSPECT_FORMAT"

	DockerArgsPath = "/cnab/app/args.json"

	// CustomDockerAppName is the custom variable set by Docker App to
	// save custom informations
	CustomDockerAppName = "com.docker.app"

	// LabelAppNamespace is the label used to track app resources
	LabelAppNamespace = Namespace + "namespace"
	// LabelAppVersion is the label used to identify what version of docker app was used to create the app
	LabelAppVersion = Namespace + "version"
)

Variables

View Source
var (
	// Version is the git tag that this was built from.
	Version = "unknown"
	// GitCommit is the commit that this was built from.
	GitCommit = "unknown"
)
View Source
var (
	// MetadataVersion defines the current schema version
	MetadataVersion = "v0.2"
)

Functions

func AppNameFromDir

func AppNameFromDir(dirName string) string

AppNameFromDir takes a path to an app directory and returns the application's name

func DirNameFromAppName

func DirNameFromAppName(appName string) string

DirNameFromAppName takes an application name and returns the corresponding directory name

func FullVersion

func FullVersion() string

FullVersion returns a string of version information.

func InsecureRegistriesFromEngine

func InsecureRegistriesFromEngine(dockerCli command.Cli) ([]string, error)

InsecureRegistriesFromEngine reads the registry configuration from the daemon and returns a list of all insecure ones.

func ValidateAppName

func ValidateAppName(appName string) error

ValidateAppName takes an app name and returns an error if it doesn't match the expected format

Types

type DockerDesktopAwareStore

type DockerDesktopAwareStore struct {
	store.Store
}

func (DockerDesktopAwareStore) GetMetadata

func (s DockerDesktopAwareStore) GetMetadata(name string) (store.Metadata, error)

func (DockerDesktopAwareStore) List

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL