Determine the best default value for the image property for this
Kubernetes deployment goal event. If there is no image associated
with the after commit of the push, it checks if a Docker registry
is provided at sdm.configuration.sdm.docker.registry
and uses
that and the repo name to return an image. If neither of those
exist, a Docker Hub-like image name generated from the repository
owner and name. In the latter two cases, it tries to read a
version for this commit from the graph. If it exists it uses it at
the image tag. If it does not, it uses the tag "latest".
SDM Kubernetes deployment goal event
Kubernetes deployment goal object
Handler context
Docker image associated with goal push after commit, or best guess
Given the goal event, KubernetesDeploy goal, and handler context generate a default KubernetesApplication object.
This function uses defaultImage to determine the image.
SDM Kubernetes deployment goal event
Kubernetes deployment goal configuration
Handler context
a valid default KubernetesApplication for this SDM goal deployment event
Remove any invalid characters from Docker image name component
name
to make it a valid Docker image name component. If
hubOwner
is true, it ensures the name contains only alphanumeric
characters.
From https://docs.docker.com/engine/reference/commandline/tag/:
An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. The hostname must comply with standard DNS rules, but may not contain underscores. If a hostname is present, it may optionally be followed by a port number in the format :8080. If not present, the command uses Docker’s public registry located at registry-1.docker.io by default. Name components may contain lowercase letters, digits and separators. A separator is defined as a period, one or two underscores, or one or more dashes. A name component may not start or end with a separator.
A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.
Name component to clean up.
If true
only allow characters valid for a Docker Hub user/org
Valid Docker image name component.
Parse Dockerfile and return port of first argument to the first
EXPOSE command. it can suggessfully convert to an integer. If
there are no EXPOSE commands or if it cannot successfully convert
the EXPOSE arguments to an integer, undefined
is returned.
Project to look for Dockerfile in
port number or undefined
if no EXPOSE commands are found
Package return of dockerPort in KubernetesApplication.
Generate KubernetesApplication from goal, goal registration, project, and goal invocation. The priority of the various sources of KubernetesApplication data are, from lowest to highest:
{ ns: defaultNamespace }
.atomist/kubernetes
Specific sources can be enabled/disabled via the KubernetesDeployRegistration.dataSources.
Kubernetes deployment goal
Goal registration/configuration for k8Deploy
The Kubernetes deployment goal currently triggered.
The SdmGoalEvent augmented with KubernetesApplication in the data
Fetch KubernetesApplication from goal event. If the goal event
does not contain Kubernetes application information in its data
property, undefined
is returned. If the value of the goal event
data cannot be parsed as JSON, an error is thrown.
SDM goal event to retrieve the Kubernetes application data from
Parsed KubernetesApplication object
Read configured Kubernetes partial specs from repository.
Project to look for specs
KubernetesApplication object with requested specs populated
Generated using TypeDoc
JSON propery under the goal event data where the [[KubernetesDeployment]] goal KubernetesApplication data are stored, i.e., the value of
goal.data[sdmPackK8s]
.