diff --git a/cmd/ignite/cmd/cmdutil/flags.go b/cmd/ignite/cmd/cmdutil/flags.go index 6b093d782..013f99ec7 100644 --- a/cmd/ignite/cmd/cmdutil/flags.go +++ b/cmd/ignite/cmd/cmdutil/flags.go @@ -36,6 +36,6 @@ func AddSSHFlags(fs *pflag.FlagSet, identityFile *string, timeout *uint32) { fs.Uint32Var(timeout, "timeout", constants.SSH_DEFAULT_TIMEOUT_SECONDS, "Timeout waiting for connection in seconds") } -func AddClientConfigDirFlag(fs *pflag.FlagSet, dir *string) { - fs.StringVar(dir, "client-config-dir", "", "Directory containing the client configuration (default ~/.docker/)") +func AddRegistryConfigDirFlag(fs *pflag.FlagSet, dir *string) { + fs.StringVar(dir, "registry-config-dir", "", "Directory containing the registry configuration (default ~/.docker/)") } diff --git a/cmd/ignite/cmd/cmdutil/providers.go b/cmd/ignite/cmd/cmdutil/providers.go index 180f3a7aa..36ecdaa03 100644 --- a/cmd/ignite/cmd/cmdutil/providers.go +++ b/cmd/ignite/cmd/cmdutil/providers.go @@ -6,17 +6,17 @@ import ( "github.com/weaveworks/ignite/pkg/providers" ) -// ResolveClientConfigDir reads various configuration to resolve the client +// ResolveRegistryConfigDir reads various configuration to resolve the registry // configuration directory. -func ResolveClientConfigDir() { +func ResolveRegistryConfigDir() { if providers.ComponentConfig != nil { - // Set the providers client config dir from ignite configuration if + // Set the providers registry config dir from ignite configuration if // it's empty. When it's set in the providers and in the ignite // configuration, log about the override. - if providers.ClientConfigDir == "" { - providers.ClientConfigDir = providers.ComponentConfig.Spec.ClientConfigDir - } else if providers.ComponentConfig.Spec.ClientConfigDir != "" { - log.Debug("client-config-dir flag overriding the ignite configuration") + if providers.RegistryConfigDir == "" { + providers.RegistryConfigDir = providers.ComponentConfig.Spec.RegistryConfigDir + } else if providers.ComponentConfig.Spec.RegistryConfigDir != "" { + log.Debug("registry-config-dir flag overriding the ignite configuration") } } } diff --git a/cmd/ignite/cmd/imgcmd/import.go b/cmd/ignite/cmd/imgcmd/import.go index 0c631e910..d1f0f6c45 100644 --- a/cmd/ignite/cmd/imgcmd/import.go +++ b/cmd/ignite/cmd/imgcmd/import.go @@ -38,5 +38,5 @@ func NewCmdImport(out io.Writer) *cobra.Command { func addImportFlags(fs *pflag.FlagSet) { runtimeflag.RuntimeVar(fs, &providers.RuntimeName) - cmdutil.AddClientConfigDirFlag(fs, &providers.ClientConfigDir) + cmdutil.AddRegistryConfigDirFlag(fs, &providers.RegistryConfigDir) } diff --git a/cmd/ignite/cmd/kerncmd/import.go b/cmd/ignite/cmd/kerncmd/import.go index 36a05fe01..19e41b899 100644 --- a/cmd/ignite/cmd/kerncmd/import.go +++ b/cmd/ignite/cmd/kerncmd/import.go @@ -38,5 +38,5 @@ func NewCmdImport(out io.Writer) *cobra.Command { func addImportFlags(fs *pflag.FlagSet) { runtimeflag.RuntimeVar(fs, &providers.RuntimeName) - cmdutil.AddClientConfigDirFlag(fs, &providers.ClientConfigDir) + cmdutil.AddRegistryConfigDirFlag(fs, &providers.RegistryConfigDir) } diff --git a/cmd/ignite/cmd/vmcmd/create.go b/cmd/ignite/cmd/vmcmd/create.go index ed088a8b6..3650ec46d 100644 --- a/cmd/ignite/cmd/vmcmd/create.go +++ b/cmd/ignite/cmd/vmcmd/create.go @@ -88,5 +88,5 @@ func addCreateFlags(fs *pflag.FlagSet, cf *run.CreateFlags) { runtimeflag.RuntimeVar(fs, &providers.RuntimeName) networkflag.NetworkPluginVar(fs, &providers.NetworkPluginName) cmdutil.AddIDPrefixFlag(fs, &providers.IDPrefix) - cmdutil.AddClientConfigDirFlag(fs, &providers.ClientConfigDir) + cmdutil.AddRegistryConfigDirFlag(fs, &providers.RegistryConfigDir) } diff --git a/cmd/ignite/run/create.go b/cmd/ignite/run/create.go index 723b5b486..6c8df71b1 100644 --- a/cmd/ignite/run/create.go +++ b/cmd/ignite/run/create.go @@ -59,8 +59,8 @@ func (cf *CreateFlags) NewCreateOptions(args []string, fs *flag.FlagSet) (*Creat baseVM.Spec = providers.ComponentConfig.Spec.VMDefaults } - // Resolve client configuration used for pulling image if required. - cmdutil.ResolveClientConfigDir() + // Resolve registry configuration used for pulling image if required. + cmdutil.ResolveRegistryConfigDir() // Initialize the VM's Prefixer baseVM.Status.IDPrefix = providers.IDPrefix diff --git a/cmd/ignite/run/import.go b/cmd/ignite/run/import.go index 9d88dfb56..2a5ecdb2f 100644 --- a/cmd/ignite/run/import.go +++ b/cmd/ignite/run/import.go @@ -17,7 +17,7 @@ func ImportImage(source string) (image *api.Image, err error) { return nil, err } - cmdutil.ResolveClientConfigDir() + cmdutil.ResolveRegistryConfigDir() ociRef, err := meta.NewOCIImageRef(source) if err != nil { @@ -41,7 +41,7 @@ func ImportKernel(source string) (kernel *api.Kernel, err error) { return nil, err } - cmdutil.ResolveClientConfigDir() + cmdutil.ResolveRegistryConfigDir() ociRef, err := meta.NewOCIImageRef(source) if err != nil { diff --git a/docs/api/ignite_v1alpha4.md b/docs/api/ignite_v1alpha4.md index e75eb64d4..efb64d116 100644 --- a/docs/api/ignite_v1alpha4.md +++ b/docs/api/ignite_v1alpha4.md @@ -166,15 +166,15 @@ type Configuration struct { Configuration represents the ignite runtime configuration. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -## type [ConfigurationSpec](https://github.com/weaveworks/ignite/tree/main/pkg/apis/ignite/v1alpha4/types.go?s=9475:9871#L261) +## type [ConfigurationSpec](https://github.com/weaveworks/ignite/tree/main/pkg/apis/ignite/v1alpha4/types.go?s=9475:9883#L261) ``` go type ConfigurationSpec struct { - Runtime igniteRuntime.Name `json:"runtime,omitempty"` - NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` - VMDefaults VMSpec `json:"vmDefaults,omitempty"` - IDPrefix string `json:"idPrefix,omitempty"` - ClientConfigDir string `json:"clientConfigDir,omitempty"` + Runtime igniteRuntime.Name `json:"runtime,omitempty"` + NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` + VMDefaults VMSpec `json:"vmDefaults,omitempty"` + IDPrefix string `json:"idPrefix,omitempty"` + RegistryConfigDir string `json:"registryConfigDir,omitempty"` } ``` diff --git a/docs/cli/ignite/ignite_create.md b/docs/cli/ignite/ignite_create.md index ae5fd9e1d..5a2f9245d 100644 --- a/docs/cli/ignite/ignite_create.md +++ b/docs/cli/ignite/ignite_create.md @@ -34,25 +34,25 @@ ignite create [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) - --config string Specify a path to a file with the API resources you want to pass - -f, --copy-files strings Copy files/directories from the host to the created VM - --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) - -h, --help help for create - --id-prefix string Prefix string for system identifiers (default ignite) - --kernel-args string Set the command line for the kernel (default "console=ttyS0 reboot=k panic=1 pci=off ip=dhcp") - -k, --kernel-image oci-image Specify an OCI image containing the kernel at /boot/vmlinux and optionally, modules (default weaveworks/ignite-kernel:5.4.108) - -l, --label stringArray Set a label (foo=bar) - --memory size Amount of RAM to allocate for the VM (default 512.0 MB) - -n, --name string Specify the name - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -p, --ports strings Map host ports to VM ports - --require-name Require VM name to be passed, no name generation - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) - --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) - -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) - --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) - -v, --volumes volume Expose block devices from the host inside the VM + --config string Specify a path to a file with the API resources you want to pass + -f, --copy-files strings Copy files/directories from the host to the created VM + --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) + -h, --help help for create + --id-prefix string Prefix string for system identifiers (default ignite) + --kernel-args string Set the command line for the kernel (default "console=ttyS0 reboot=k panic=1 pci=off ip=dhcp") + -k, --kernel-image oci-image Specify an OCI image containing the kernel at /boot/vmlinux and optionally, modules (default weaveworks/ignite-kernel:5.4.108) + -l, --label stringArray Set a label (foo=bar) + --memory size Amount of RAM to allocate for the VM (default 512.0 MB) + -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) + -p, --ports strings Map host ports to VM ports + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) + --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) + -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) + --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) + -v, --volumes volume Expose block devices from the host inside the VM ``` ### Options inherited from parent commands diff --git a/docs/cli/ignite/ignite_image_import.md b/docs/cli/ignite/ignite_image_import.md index 330a1192e..bda74abad 100644 --- a/docs/cli/ignite/ignite_image_import.md +++ b/docs/cli/ignite/ignite_image_import.md @@ -17,9 +17,9 @@ ignite image import [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) - -h, --help help for import - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + -h, --help help for import + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands diff --git a/docs/cli/ignite/ignite_kernel_import.md b/docs/cli/ignite/ignite_kernel_import.md index aaf40b2c5..5988fe9bd 100644 --- a/docs/cli/ignite/ignite_kernel_import.md +++ b/docs/cli/ignite/ignite_kernel_import.md @@ -17,9 +17,9 @@ ignite kernel import [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) - -h, --help help for import - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + -h, --help help for import + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands diff --git a/docs/cli/ignite/ignite_run.md b/docs/cli/ignite/ignite_run.md index de3930600..5ebd382d8 100644 --- a/docs/cli/ignite/ignite_run.md +++ b/docs/cli/ignite/ignite_run.md @@ -27,7 +27,6 @@ ignite run [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) --config string Specify a path to a file with the API resources you want to pass -f, --copy-files strings Copy files/directories from the host to the created VM --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) @@ -43,6 +42,7 @@ ignite run [flags] -n, --name string Specify the name --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) --require-name Require VM name to be passed, no name generation --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) diff --git a/docs/cli/ignite/ignite_vm_create.md b/docs/cli/ignite/ignite_vm_create.md index 9f7108666..def7403d3 100644 --- a/docs/cli/ignite/ignite_vm_create.md +++ b/docs/cli/ignite/ignite_vm_create.md @@ -34,25 +34,25 @@ ignite vm create [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) - --config string Specify a path to a file with the API resources you want to pass - -f, --copy-files strings Copy files/directories from the host to the created VM - --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) - -h, --help help for create - --id-prefix string Prefix string for system identifiers (default ignite) - --kernel-args string Set the command line for the kernel (default "console=ttyS0 reboot=k panic=1 pci=off ip=dhcp") - -k, --kernel-image oci-image Specify an OCI image containing the kernel at /boot/vmlinux and optionally, modules (default weaveworks/ignite-kernel:5.4.108) - -l, --label stringArray Set a label (foo=bar) - --memory size Amount of RAM to allocate for the VM (default 512.0 MB) - -n, --name string Specify the name - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -p, --ports strings Map host ports to VM ports - --require-name Require VM name to be passed, no name generation - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) - --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) - -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) - --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) - -v, --volumes volume Expose block devices from the host inside the VM + --config string Specify a path to a file with the API resources you want to pass + -f, --copy-files strings Copy files/directories from the host to the created VM + --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) + -h, --help help for create + --id-prefix string Prefix string for system identifiers (default ignite) + --kernel-args string Set the command line for the kernel (default "console=ttyS0 reboot=k panic=1 pci=off ip=dhcp") + -k, --kernel-image oci-image Specify an OCI image containing the kernel at /boot/vmlinux and optionally, modules (default weaveworks/ignite-kernel:5.4.108) + -l, --label stringArray Set a label (foo=bar) + --memory size Amount of RAM to allocate for the VM (default 512.0 MB) + -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) + -p, --ports strings Map host ports to VM ports + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) + --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) + -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) + --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) + -v, --volumes volume Expose block devices from the host inside the VM ``` ### Options inherited from parent commands diff --git a/docs/cli/ignite/ignite_vm_run.md b/docs/cli/ignite/ignite_vm_run.md index 0a66cb23a..375721113 100644 --- a/docs/cli/ignite/ignite_vm_run.md +++ b/docs/cli/ignite/ignite_vm_run.md @@ -27,7 +27,6 @@ ignite vm run [flags] ### Options ``` - --client-config-dir string Directory containing the client configuration (default ~/.docker/) --config string Specify a path to a file with the API resources you want to pass -f, --copy-files strings Copy files/directories from the host to the created VM --cpus uint VM vCPU count, 1 or even numbers between 1 and 32 (default 1) @@ -43,6 +42,7 @@ ignite vm run [flags] -n, --name string Specify the name --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports + --registry-config-dir string Directory containing the registry configuration (default ~/.docker/) --require-name Require VM name to be passed, no name generation --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) diff --git a/docs/usage.md b/docs/usage.md index 40a220b61..5036c7cfb 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -104,7 +104,7 @@ image pull will fail with errors related to the specific credential helper. In presence of both auth tokens and credential helpers in a configuration file, credential helper takes precedence. -The `--registry-config-dir` flag can be used to override the default directory(`$HOME/.docker/config.json`). +The `--registry-config-dir` flag can be used to override the default directory(`$HOME/.docker/`). This can also be done from the ignite [Configuration](./ignite-configuration). When using the `containerd` runtime to pull images, TLS verification can be disabled, diff --git a/e2e/registry_auth_test.go b/e2e/registry_auth_test.go index 630ddb378..3d00e6043 100644 --- a/e2e/registry_auth_test.go +++ b/e2e/registry_auth_test.go @@ -22,11 +22,11 @@ const ( httpsTestKernelImage = "127.5.0.1:5443/weaveworks/ignite-kernel:test" ) -// client config with auth info for the registry setup in +// registry config with auth info for the registry setup in // e2e/util/setup-private-registry.sh. // NOTE: Update the auth token if the credentials in setup-private-registry.sh // is updated. -const clientConfigContent = ` +const registryConfigContent = ` { "auths": { "http://127.5.0.1:5080": { @@ -65,21 +65,21 @@ func TestPullFromAuthRegistry(t *testing.T) { os.Setenv(containerd.InsecureRegistriesEnvVar, "http://127.5.0.1:5080,https://127.5.0.1:5443") defer os.Unsetenv(containerd.InsecureRegistriesEnvVar) - // Create a client config directory to use in test. + // Create a registry config directory to use in test. emptyDir, err := ioutil.TempDir("", "ignite-test") assert.NilError(t, err) defer os.RemoveAll(emptyDir) - // Create a client config directory to use in test. - ccDir, err := ioutil.TempDir("", "ignite-test") + // Create a registry config directory to use in test. + rcDir, err := ioutil.TempDir("", "ignite-test") assert.NilError(t, err) - defer os.RemoveAll(ccDir) + defer os.RemoveAll(rcDir) // Ensure the directory exists and create a config file in the // directory. - assert.NilError(t, os.MkdirAll(ccDir, 0755)) - configPath := filepath.Join(ccDir, "config.json") - assert.NilError(t, os.WriteFile(configPath, []byte(clientConfigContent), 0600)) + assert.NilError(t, os.MkdirAll(rcDir, 0755)) + configPath := filepath.Join(rcDir, "config.json") + assert.NilError(t, os.WriteFile(configPath, []byte(registryConfigContent), 0600)) defer os.Remove(configPath) templateConfig := `--- @@ -88,16 +88,16 @@ kind: Configuration metadata: name: test-config spec: - clientConfigDir: %s + registryConfigDir: %s ` - igniteConfigContent := fmt.Sprintf(templateConfig, ccDir) + igniteConfigContent := fmt.Sprintf(templateConfig, rcDir) type testCase struct { - name string - runtime runtime.Name - clientConfigFlag string - igniteConfig string - wantErr bool + name string + runtime runtime.Name + registryConfigFlag string + igniteConfig string + wantErr bool } cases := []testCase{ { @@ -111,57 +111,57 @@ spec: wantErr: true, }, { - name: "client config flag - containerd", - runtime: runtime.RuntimeContainerd, - clientConfigFlag: ccDir, + name: "registry config flag - containerd", + runtime: runtime.RuntimeContainerd, + registryConfigFlag: rcDir, }, { - name: "client config flag - docker", - runtime: runtime.RuntimeDocker, - clientConfigFlag: ccDir, + name: "registry config flag - docker", + runtime: runtime.RuntimeDocker, + registryConfigFlag: rcDir, }, { - name: "client config in ignite config - containerd", + name: "registry config in ignite config - containerd", runtime: runtime.RuntimeContainerd, igniteConfig: igniteConfigContent, }, { - name: "client config in ignite config - docker", + name: "registry config in ignite config - docker", runtime: runtime.RuntimeDocker, igniteConfig: igniteConfigContent, }, - // Following sets the client config dir to a location without a valid - // client config file, although the client config dir in the ignite + // Following sets the registry config dir to a location without a valid + // registry config file, although the registry config dir in the ignite // config is correct, the import fails due to bad configuration by the // flag override. { - name: "flag override client config - containerd", - runtime: runtime.RuntimeContainerd, - clientConfigFlag: emptyDir, - igniteConfig: igniteConfigContent, - wantErr: true, + name: "flag override registry config - containerd", + runtime: runtime.RuntimeContainerd, + registryConfigFlag: emptyDir, + igniteConfig: igniteConfigContent, + wantErr: true, }, { - name: "flag override client config - docker", - runtime: runtime.RuntimeDocker, - clientConfigFlag: emptyDir, - igniteConfig: igniteConfigContent, - wantErr: true, + name: "flag override registry config - docker", + runtime: runtime.RuntimeDocker, + registryConfigFlag: emptyDir, + igniteConfig: igniteConfigContent, + wantErr: true, }, - // Following sets the client config dir via flag without any actual - // client config. Import fails due to missing auth info in the given - // client config dir. + // Following sets the registry config dir via flag without any actual + // registry config. Import fails due to missing auth info in the given + // registry config dir. { - name: "invalid client config - containerd", - runtime: runtime.RuntimeContainerd, - clientConfigFlag: emptyDir, - wantErr: true, + name: "invalid registry config - containerd", + runtime: runtime.RuntimeContainerd, + registryConfigFlag: emptyDir, + wantErr: true, }, { - name: "invalid client config - docker", - runtime: runtime.RuntimeDocker, - clientConfigFlag: emptyDir, - wantErr: true, + name: "invalid registry config - docker", + runtime: runtime.RuntimeDocker, + registryConfigFlag: emptyDir, + wantErr: true, }, } @@ -195,8 +195,8 @@ spec: // Construct the ignite image import command. imageImportCmdArgs := []string{"--runtime", rt.runtime.String()} - if len(rt.clientConfigFlag) > 0 { - imageImportCmdArgs = append(imageImportCmdArgs, "--client-config-dir", rt.clientConfigFlag) + if len(rt.registryConfigFlag) > 0 { + imageImportCmdArgs = append(imageImportCmdArgs, "--registry-config-dir", rt.registryConfigFlag) } if len(igniteConfigPath) > 0 { imageImportCmdArgs = append(imageImportCmdArgs, "--ignite-config", igniteConfigPath) diff --git a/go.mod b/go.mod index 7a26b6f2f..b1e12834e 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d // indirect golang.org/x/sys v0.0.0-20210510120138-977fb7262007 - golang.org/x/tools v0.1.1 // indirect + golang.org/x/tools v0.1.2 // indirect google.golang.org/genproto v0.0.0-20210416161957-9910b6c460de // indirect google.golang.org/grpc v1.37.0 // indirect gotest.tools v2.2.0+incompatible diff --git a/go.sum b/go.sum index 3fe693f08..0946b6129 100644 --- a/go.sum +++ b/go.sum @@ -1285,8 +1285,8 @@ golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/apis/ignite/types.go b/pkg/apis/ignite/types.go index 9f898eeac..b86a400b5 100644 --- a/pkg/apis/ignite/types.go +++ b/pkg/apis/ignite/types.go @@ -259,9 +259,9 @@ type Configuration struct { // ConfigurationSpec defines the ignite configuration. type ConfigurationSpec struct { - Runtime igniteRuntime.Name `json:"runtime,omitempty"` - NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` - VMDefaults VMSpec `json:"vmDefaults,omitempty"` - IDPrefix string `json:"idPrefix,omitempty"` - ClientConfigDir string `json:"clientConfigDir,omitempty"` + Runtime igniteRuntime.Name `json:"runtime,omitempty"` + NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` + VMDefaults VMSpec `json:"vmDefaults,omitempty"` + IDPrefix string `json:"idPrefix,omitempty"` + RegistryConfigDir string `json:"registryConfigDir,omitempty"` } diff --git a/pkg/apis/ignite/v1alpha3/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha3/zz_generated.conversion.go index d9398492e..7baeaddf4 100644 --- a/pkg/apis/ignite/v1alpha3/zz_generated.conversion.go +++ b/pkg/apis/ignite/v1alpha3/zz_generated.conversion.go @@ -376,7 +376,7 @@ func autoConvert_ignite_ConfigurationSpec_To_v1alpha3_ConfigurationSpec(in *igni return err } out.IDPrefix = in.IDPrefix - // WARNING: in.ClientConfigDir requires manual conversion: does not exist in peer-type + // WARNING: in.RegistryConfigDir requires manual conversion: does not exist in peer-type return nil } diff --git a/pkg/apis/ignite/v1alpha4/types.go b/pkg/apis/ignite/v1alpha4/types.go index 2ced76c6f..45995c504 100644 --- a/pkg/apis/ignite/v1alpha4/types.go +++ b/pkg/apis/ignite/v1alpha4/types.go @@ -259,9 +259,9 @@ type Configuration struct { // ConfigurationSpec defines the ignite configuration. type ConfigurationSpec struct { - Runtime igniteRuntime.Name `json:"runtime,omitempty"` - NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` - VMDefaults VMSpec `json:"vmDefaults,omitempty"` - IDPrefix string `json:"idPrefix,omitempty"` - ClientConfigDir string `json:"clientConfigDir,omitempty"` + Runtime igniteRuntime.Name `json:"runtime,omitempty"` + NetworkPlugin igniteNetwork.PluginName `json:"networkPlugin,omitempty"` + VMDefaults VMSpec `json:"vmDefaults,omitempty"` + IDPrefix string `json:"idPrefix,omitempty"` + RegistryConfigDir string `json:"registryConfigDir,omitempty"` } diff --git a/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go index 4adb5fff0..00aadc551 100644 --- a/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go +++ b/pkg/apis/ignite/v1alpha4/zz_generated.conversion.go @@ -361,7 +361,7 @@ func autoConvert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(in *Conf return err } out.IDPrefix = in.IDPrefix - out.ClientConfigDir = in.ClientConfigDir + out.RegistryConfigDir = in.RegistryConfigDir return nil } @@ -377,7 +377,7 @@ func autoConvert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(in *igni return err } out.IDPrefix = in.IDPrefix - out.ClientConfigDir = in.ClientConfigDir + out.RegistryConfigDir = in.RegistryConfigDir return nil } diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index fd6fed19d..388cfc712 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -1955,7 +1955,7 @@ func schema_pkg_apis_ignite_v1alpha4_ConfigurationSpec(ref common.ReferenceCallb Format: "", }, }, - "clientConfigDir": { + "registryConfigDir": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", diff --git a/pkg/providers/providers.go b/pkg/providers/providers.go index 9bc2fbba8..b9bd45e78 100644 --- a/pkg/providers/providers.go +++ b/pkg/providers/providers.go @@ -37,10 +37,10 @@ var Storage storage.Storage var ComponentConfig *api.Configuration -// ClientConfigDir is the container runtime client configuration directory. +// RegistryConfigDir is the container runtime registry configuration directory. // This is used during operations like image import for loading registry // configurations. -var ClientConfigDir string +var RegistryConfigDir string type ProviderInitFunc func() error diff --git a/pkg/runtime/auth/auth.go b/pkg/runtime/auth/auth.go index 6f920d2b0..8f9628e75 100644 --- a/pkg/runtime/auth/auth.go +++ b/pkg/runtime/auth/auth.go @@ -19,7 +19,7 @@ type AuthCreds func(string) (string, string, error) // NewAuthCreds returns an AuthCreds which loads the credentials from the // docker client config. func NewAuthCreds(refHostname string, configPath string) (AuthCreds, string, error) { - log.Debugf("runtime.auth: client config dir path: %q", configPath) + log.Debugf("runtime.auth: registry config dir path: %q", configPath) // Load does not raise an error on ENOENT dockerConfigFile, err := dockercliconfig.Load(configPath) diff --git a/pkg/runtime/containerd/client.go b/pkg/runtime/containerd/client.go index 2a164a6e1..baf23f01b 100644 --- a/pkg/runtime/containerd/client.go +++ b/pkg/runtime/containerd/client.go @@ -213,7 +213,7 @@ func (cc *ctdClient) PullImage(image meta.OCIImageRef) error { refDomain := refdocker.Domain(named) // Create a remote resolver for the domain. - resolver, err := newRemoteResolver(refDomain, providers.ClientConfigDir) + resolver, err := newRemoteResolver(refDomain, providers.RegistryConfigDir) if err != nil { return err } diff --git a/pkg/runtime/docker/client.go b/pkg/runtime/docker/client.go index f35fc7743..76b779029 100644 --- a/pkg/runtime/docker/client.go +++ b/pkg/runtime/docker/client.go @@ -69,7 +69,7 @@ func (dc *dockerClient) PullImage(image meta.OCIImageRef) (err error) { } // Get available credentials from docker cli config. - authCreds, _, err := auth.NewAuthCreds(refDomain, providers.ClientConfigDir) + authCreds, _, err := auth.NewAuthCreds(refDomain, providers.RegistryConfigDir) if err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 67b7572a3..c302575e0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -563,7 +563,7 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# golang.org/x/tools v0.1.1 +# golang.org/x/tools v0.1.2 ## explicit golang.org/x/tools/go/ast/astutil golang.org/x/tools/imports