Skip to content

Commit

Permalink
Merge pull request cri-o#8194 from bitoku/drop-registries
Browse files Browse the repository at this point in the history
Remove `registries` config and `--registry` option
  • Loading branch information
openshift-merge-bot[bot] committed May 31, 2024
2 parents 5e2cc98 + 82af00d commit fd87228
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 42 deletions.
1 change: 0 additions & 1 deletion completions/bash/crio
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ h
--read-only
--registries-conf
--registries-conf-dir
--registry
--root
--runroot
--runtimes
Expand Down
1 change: 0 additions & 1 deletion completions/fish/crio.fish
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ complete -c crio -n '__fish_crio_no_subcommand' -f -l profile-mem -r -d 'Write a
complete -c crio -n '__fish_crio_no_subcommand' -f -l profile-port -r -d 'Port for the pprof profiler.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l rdt-config-file -r -d 'Path to the RDT configuration file for configuring the resctrl pseudo-filesystem.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l read-only -d 'Setup all unprivileged containers to run as read-only. Automatically mounts the containers\' tmpfs on \'/run\', \'/tmp\' and \'/var/tmp\'.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l registry -r -d 'Registry to be prepended when pulling unqualified images. Can be specified multiple times.'
complete -c crio -n '__fish_crio_no_subcommand' -l root -s r -r -d 'The CRI-O root directory.'
complete -c crio -n '__fish_crio_no_subcommand' -l runroot -r -d 'The CRI-O state directory.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l runtimes -r -d 'OCI runtimes, format is \'runtime_name:runtime_path:runtime_root:runtime_type:privileged_without_host_devices:runtime_config_path:container_min_memory\'.'
Expand Down
1 change: 0 additions & 1 deletion completions/zsh/_crio
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ it later with **--config**. Global options will modify the output.'
'--read-only'
'--registries-conf'
'--registries-conf-dir'
'--registry'
'--root'
'--runroot'
'--runtimes'
Expand Down
7 changes: 0 additions & 7 deletions contrib/test/ci/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,5 @@
[crio]
storage_driver = "overlay"
- name: add quay.io and docker.io as default registries
copy:
dest: /etc/crio/crio.conf.d/01-registries.conf
content: |
[crio.image]
registries = [ "quay.io", "docker.io" ]
- name: build parallel
include_tasks: "build/parallel.yml"
3 changes: 0 additions & 3 deletions docs/crio.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ crio
[--profile]
[--rdt-config-file]=[value]
[--read-only]
[--registry]=[value]
[--root|-r]=[value]
[--runroot]=[value]
[--runtimes]=[value]
Expand Down Expand Up @@ -387,8 +386,6 @@ crio [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]

**--read-only**: Setup all unprivileged containers to run as read-only. Automatically mounts the containers' tmpfs on '/run', '/tmp' and '/var/tmp'.

**--registry**="": Registry to be prepended when pulling unqualified images. Can be specified multiple times.

**--root, -r**="": The CRI-O root directory. (default: "/var/lib/containers/storage")

**--runroot**="": The CRI-O state directory. (default: "/run/containers/storage")
Expand Down
5 changes: 1 addition & 4 deletions docs/crio.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ Specifies the cpuset this pod has access to.
## CRIO.IMAGE TABLE
The `crio.image` table contains settings pertaining to the management of OCI images.

CRI-O reads its configured registries defaults from the system wide containers-registries.conf(5) located in /etc/containers/registries.conf. If you want to modify just CRI-O, you can change the registries configuration in this file. Otherwise, leave `insecure_registries` and `registries` commented out to use the system's defaults from /etc/containers/registries.conf.
CRI-O reads its configured registries defaults from the system wide containers-registries.conf(5) located in /etc/containers/registries.conf.

**default_transport**="docker://"
Default transport for pulling images from a remote container storage.
Expand Down Expand Up @@ -467,9 +467,6 @@ CRI-O reads its configured registries defaults from the system wide containers-r
**insecure_registries**=[]
List of registries to skip TLS verification for pulling images.

**registries**=["docker.io"]
List of registries to be used when pulling an unqualified image. Note support for this option has been dropped and it has no effect. Please refer to `containers-registries.conf(5)` for configuring unqualified-search registries.

**big_files_temporary_dir**=""
Path to the temporary directory to use for storing big files, used to store image blobs and data streams related to containers image management.

Expand Down
9 changes: 0 additions & 9 deletions internal/criocli/criocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ func mergeConfig(config *libconfig.Config, ctx *cli.Context) error {
if ctx.IsSet("insecure-registry") {
config.InsecureRegistries = StringSliceTrySplit(ctx, "insecure-registry")
}
if ctx.IsSet("registry") {
config.Registries = StringSliceTrySplit(ctx, "registry")
}
if ctx.IsSet("default-transport") {
config.DefaultTransport = ctx.String("default-transport")
}
Expand Down Expand Up @@ -635,12 +632,6 @@ func getCrioFlags(defConf *libconfig.Config) []cli.Flag {
'--insecure-registry'.`,
EnvVars: []string{"CONTAINER_INSECURE_REGISTRY"},
},
&cli.StringSliceFlag{
Name: "registry",
Value: cli.NewStringSlice(defConf.Registries...),
Usage: "Registry to be prepended when pulling unqualified images. Can be specified multiple times.",
EnvVars: []string{"CONTAINER_REGISTRY"},
},
&cli.StringFlag{
Name: "default-transport",
Usage: "A prefix to prepend to image names that cannot be pulled as-is.",
Expand Down
9 changes: 0 additions & 9 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,6 @@ type ImageConfig struct {
InsecureRegistries []string `toml:"insecure_registries"`
// ImageVolumes controls how volumes specified in image config are handled
ImageVolumes ImageVolumesType `toml:"image_volumes"`
// Registries holds a list of registries used to pull unqualified images
Registries []string `toml:"registries"`
// Temporary directory for big files
BigFilesTemporaryDir string `toml:"big_files_temporary_dir"`
// AutoReloadRegistries if set to true, will automatically
Expand Down Expand Up @@ -762,13 +760,6 @@ func (c *Config) UpdateFromDropInFile(path string) error {
t.Crio.Storage = storageDriver
}

// Registries are deprecated in cri-o.conf and turned into a NOP.
// Users should use registries.conf instead, so let's log it.
if len(t.Crio.Image.Registries) > 0 {
t.Crio.Image.Registries = nil
logrus.Warnf("Support for the 'registries' option has been dropped but it is referenced in %q. Please use containers-registries.conf(5) for configuring unqualified-search registries instead.", path)
}

t.toConfig(c)
return nil
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/config/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,10 +1399,7 @@ const templateStringCrioRuntimeTimezone = `# timezone To set the timezone for a
const templateStringCrioImage = `# The crio.image table contains settings pertaining to the management of OCI images.
#
# CRI-O reads its configured registries defaults from the system wide
# containers-registries.conf(5) located in /etc/containers/registries.conf. If
# you want to modify just CRI-O, you can change the registries configuration in
# this file. Otherwise, leave insecure_registries and registries commented out to
# use the system's defaults from /etc/containers/registries.conf.
# containers-registries.conf(5) located in /etc/containers/registries.conf.
[crio.image]
`
Expand Down
1 change: 0 additions & 1 deletion test/docs-validation/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ var (
"plugin_dirs": "cni-plugin-dir",
"insecure_registries": "insecure-registry",
"log_to_journald": "log-journald",
"registries": "registry",
"storage_option": "storage-opt",
}
)
Expand Down
2 changes: 0 additions & 2 deletions test/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ function setup_crio() {
--irqbalance-config-restore-file "$IRQBALANCE_CONFIG_RESTORE_FILE" \
--signature-policy "$SIGNATURE_POLICY" \
--signature-policy-dir "$SIGNATURE_POLICY_DIR" \
--registry "quay.io" \
--registry "docker.io" \
-r "$TESTDIR/crio" \
--runroot "$TESTDIR/crio-run" \
--cni-default-network "$CNI_DEFAULT_NETWORK" \
Expand Down

0 comments on commit fd87228

Please sign in to comment.