registries

package
v0.0.0-...-7bdb5b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Package registries contains shared infrastructure to build/update /etc/containers/registries.conf based on cluster-wide configuration.

NOTE: This has users outside of the machine-config-operator repository!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditRegistriesConfig

func EditRegistriesConfig(config *sysregistriesv2.V2RegistriesConf, insecureScopes, blockedScopes []string, icspRules []*apioperatorsv1alpha1.ImageContentSourcePolicy,
	idmsRules []*apicfgv1.ImageDigestMirrorSet, itmsRules []*apicfgv1.ImageTagMirrorSet,
) error

EditRegistriesConfig edits, IN PLACE, the /etc/containers/registries.conf configuration provided in config, to: - Mark scope entries in insecureScopes as insecure (TLS is not required, and TLS certificate verification is not required when TLS is used) - Mark scope entries in blockedScopes as blocked (any attempts to access them fail) - Implement ImageContentSourcePolicy rules in icspRules. - Implement ImageDigestMirrorSet rules in idmsRules. - Implement ImageTagMirrorSet rules in itmsRules. "scopes" can be any of whole registries, which means that the configuration applies to everything on that registry, including any possible separately-configured namespaces/repositories within that registry. or can be wildcard entries, which means that we accept wildcards in the form of *.example.registry.com for insecure and blocked registries only. We do not accept them for mirror configuration. A valid scope is in the form of registry/namespace...[/repo] (can also refer to sysregistriesv2.Registry.Prefix) NOTE: Validation of wildcard entries is done before EditRegistriesConfig is called in the MCO code.

func IsValidRegistriesConfScope

func IsValidRegistriesConfScope(scope string) bool

IsValidRegistriesConfScope returns true if scope is a valid scope for the Prefix key in registries.conf This function can be used to validate the registries entries prior to calling EditRegistriesConfig in the MCO or builds code

func ScopeIsNestedInsideScope

func ScopeIsNestedInsideScope(subScope, superScope string) bool

ScopeIsNestedInsideScope returns true if a subScope value (as in sysregistriesv2.Registry.Prefix / sysregistriesv2.Endpoint.Location) is a sub-scope of superScope.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL