Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Rename client-config-dir to registry-config-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
darkowlzz committed May 31, 2021
1 parent dfcebe8 commit b569d97
Show file tree
Hide file tree
Showing 28 changed files with 141 additions and 141 deletions.
4 changes: 2 additions & 2 deletions cmd/ignite/cmd/cmdutil/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/)")
}
14 changes: 7 additions & 7 deletions cmd/ignite/cmd/cmdutil/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
2 changes: 1 addition & 1 deletion cmd/ignite/cmd/imgcmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion cmd/ignite/cmd/kerncmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion cmd/ignite/cmd/vmcmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions cmd/ignite/run/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/ignite/run/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions docs/api/ignite_v1alpha4.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ type Configuration struct {
Configuration represents the ignite runtime configuration.
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

## <a name="ConfigurationSpec">type</a> [ConfigurationSpec](https://github.com/weaveworks/ignite/tree/main/pkg/apis/ignite/v1alpha4/types.go?s=9475:9871#L261)
## <a name="ConfigurationSpec">type</a> [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"`
}
```

Expand Down
38 changes: 19 additions & 19 deletions docs/cli/ignite/ignite_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ ignite create <OCI image> [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[=<path>] Enable SSH for the VM. If <path> 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[=<path>] Enable SSH for the VM. If <path> 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
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/ignite/ignite_image_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ ignite image import <OCI image> [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
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/ignite/ignite_kernel_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ ignite kernel import <OCI image> [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
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/ignite/ignite_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ignite run <OCI image> [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)
Expand All @@ -43,6 +42,7 @@ ignite run <OCI image> [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)
Expand Down
38 changes: 19 additions & 19 deletions docs/cli/ignite/ignite_vm_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ ignite vm create <OCI image> [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[=<path>] Enable SSH for the VM. If <path> 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[=<path>] Enable SSH for the VM. If <path> 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
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/ignite/ignite_vm_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ignite vm run <OCI image> [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)
Expand All @@ -43,6 +42,7 @@ ignite vm run <OCI image> [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)
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit b569d97

Please sign in to comment.