Skip to content

Commit 99d43aa

Browse files
committed
Use the ImageDigest SourcePolicy to configure image registry on bootstrap host
A new policy was added to the ImageDigestSource configuration that allows the user to specify policy when there is a failure pulling an image from the source. Update the image registry configuration on the bootstrap host with this SourcePolicy.
1 parent fb1c669 commit 99d43aa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

data/data/bootstrap/files/etc/containers/registries.conf.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
location = "{{ $r.Endpoint.Location }}"
44
insecure = {{ $r.Endpoint.Insecure }}
55
mirror-by-digest-only = {{ $r.MirrorByDigestOnly }}
6+
blocked = {{ $r.Blocked }}
67

78
{{ range $m := $r.Mirrors -}}
89
[[registry.mirror]]

pkg/asset/imagebased/image/registriesconf.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/containers/image/v5/pkg/sysregistriesv2"
77
"github.com/pelletier/go-toml"
88

9+
configv1 "github.com/openshift/api/config/v1"
910
"github.com/openshift/installer/pkg/asset"
1011
"github.com/openshift/installer/pkg/asset/ignition/bootstrap"
1112
"github.com/openshift/installer/pkg/types"
@@ -73,6 +74,7 @@ func (i *RegistriesConf) generateRegistriesConf(imageDigestSources []types.Image
7374
registry := sysregistriesv2.Registry{}
7475
registry.Endpoint.Location = group.Source
7576
registry.MirrorByDigestOnly = true
77+
registry.Blocked = group.SourcePolicy == configv1.NeverContactSource
7678
for _, mirror := range group.Mirrors {
7779
registry.Mirrors = append(registry.Mirrors, sysregistriesv2.Endpoint{Location: mirror})
7880
}

0 commit comments

Comments
 (0)