Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeConfig ¶
func DescribeConfig(w io.Writer, cfg *configfile.ConfigFile)
DescribeConfig creates a function that can write information about a configuration file.
Example (CredHelpers) ¶
cfg, err := ReadConfig(filepath.Join("testdata", "credhelpers")) if err != nil { panic(err) } DescribeConfig(os.Stdout, cfg)
Output: Docker config: Auth: <none> Credential helpers: Registry Helper asia.gcr.io gcloud eu.gcr.io gcloud gcr.io gcloud us.gcr.io gcloud
Example (CustomAuth) ¶
cfg, err := ReadConfig(filepath.Join("testdata", "customauth")) if err != nil { panic(err) } DescribeConfig(os.Stdout, cfg)
Output: Docker config: Auth: Registry Username Email https://gcr.io _json_key not@val.id Credential helpers: <none>
func DescribeDefaultConfig ¶
DescribeDefaultConfig writes debug info about the default docker configuration to the given writer.
func DescribeWorkloadIdentity ¶
DescribeWorkloadIdentity writes debug info about the identity that can be accessed via the GCE Metadata server.
If the server can't be reached, a message gets printed that the server couldn't be found.
func GetAuthKeyChain ¶
GetAuthKeyChain constructs the default auth key chain to authenticate with GCP services, e.g. GCR.
func ReadConfig ¶
func ReadConfig(configPath string) (*configfile.ConfigFile, error)
ReadConfig is a utility function to read a docker config from a path. if the path is blank the default config is used.
Example ¶
cfg, err := ReadConfig(filepath.Join("testdata", "credhelpers")) if err != nil { panic(err) } fmt.Println(cfg.CredentialHelpers)
Output: map[asia.gcr.io:gcloud eu.gcr.io:gcloud gcr.io:gcloud us.gcr.io:gcloud]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.