Documentation
¶
Index ¶
- func AppendDockerAuth(dockerAuths map[string][]docker.AuthConfiguration, ...) map[string][]docker.AuthConfiguration
- func ExtractAuthAttributes(attributes []persistence.Attribute, httpAuthAttrs map[string]map[string]string, ...) error
- func LoadImagesFromPkgParts(client *dockerclient.Client, imageFiles map[string]string) error
- func ProcessImageFetch(cfg *config.HorizonConfig, client *docker.Client, ...) error
- func SkipCheckFn(client *dockerclient.Client) func(repotag string) (bool, error)
- type FetchCommand
- type TorrentWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDockerAuth ¶
func AppendDockerAuth(dockerAuths map[string][]docker.AuthConfiguration, auth docker.AuthConfiguration) map[string][]docker.AuthConfiguration
this function append the docker auth object into the map if it does not exists in the map.
func ExtractAuthAttributes ¶
func ExtractAuthAttributes(attributes []persistence.Attribute, httpAuthAttrs map[string]map[string]string, dockerAuthConfigurations map[string][]docker.AuthConfiguration) error
append the auth attribute to the given auth maps
func LoadImagesFromPkgParts ¶
func LoadImagesFromPkgParts(client *dockerclient.Client, imageFiles map[string]string) error
imageFiles is a mapping of Pkg file path to docker image repotag
func ProcessImageFetch ¶
func ProcessImageFetch(cfg *config.HorizonConfig, client *docker.Client, containerConfig *events.ContainerConfig, httpAuthAttrs map[string]map[string]string, dockerAuthConfigurations map[string][]docker.AuthConfiguration, pemFiles []string) error
This function is used by external caller such as hzn command to load the container images. containerConfig: it contains the deployment info and the docker auth from the exchange for the service image docker repository. httpAuthAttrs: the http auths for fetching the packages fromt he image server if torrent url is set in containerConfig. dockerAuthConfigurations: additional docker auths for fetching the container images from the docker repository. pemFiles: public key files for verifying the deployment signature or torrent signature.
If the images are from a docker repo, the order of docker auths that will be used are 1) from the exchagne (contained in containerConfig) 2) from the dockerAuthConfigurations 3) from the config.DockerCredFilePath file. 4) from /root/.docker/config.json if 3) is not set.
If the image is from a image server, the order of the http auth that will be used are: 1) from the httpAuthAttrs 2) from the env variable $HZN_ORG_ID/$HZN_DEVICE_ID:$HZN_DEVICE_TOKEN if httpAuthAttrs is not set for this image. 3) try without auth if 2) fails.
func SkipCheckFn ¶
func SkipCheckFn(client *dockerclient.Client) func(repotag string) (bool, error)
TODO: user needs to use image IDs instead of repotags to avoid overwriting or otherwise mistaken handling because of name collisions
Types ¶
type FetchCommand ¶
type FetchCommand struct {
LaunchContext interface{}
}
func (FetchCommand) ShortString ¶
func (f FetchCommand) ShortString() string
type TorrentWorker ¶
type TorrentWorker struct {
worker.BaseWorker // embedded field
// contains filtered or unexported fields
}
func NewTorrentWorker ¶
func NewTorrentWorker(name string, config *config.HorizonConfig, db *bolt.DB) *TorrentWorker
func (*TorrentWorker) CommandHandler ¶
func (b *TorrentWorker) CommandHandler(command worker.Command) bool
func (*TorrentWorker) Messages ¶
func (w *TorrentWorker) Messages() chan events.Message
func (*TorrentWorker) NewEvent ¶
func (w *TorrentWorker) NewEvent(incoming events.Message)
func (*TorrentWorker) NewFetchCommand ¶
func (t *TorrentWorker) NewFetchCommand(launchContext interface{}) *FetchCommand