Skip to content

Commit

Permalink
MGMT-19545: add release registry field to IBI installation config
Browse files Browse the repository at this point in the history
This change adds the optional `ReleaseRegistry` field in the IBI installation
config. This field is used as a replacement for the seed release registry in the
seed cluster's image pull-specs, when the seed container image is generated in
a disconnected SNO (i.e. with mirror registries configured).

Signed-off-by: Michail Resvanis <[email protected]>
  • Loading branch information
mresvanis committed Jan 23, 2025
1 parent fef4be9 commit 124da37
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/asset/imagebased/image/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ibiConfigurationFile struct {
ExtraPartitionNumber uint `json:"extraPartitionNumber,omitempty"`
ExtraPartitionStart string `json:"extraPartitionStart,omitempty"`
InstallationDisk string `json:"installationDisk"`
ReleaseRegistry string `json:"releaseRegistry,omitempty"`
SeedImage string `json:"seedImage"`
SeedVersion string `json:"seedVersion"`
Shutdown bool `json:"shutdown,omitempty"`
Expand Down Expand Up @@ -96,6 +97,7 @@ func (i *Ignition) Generate(_ context.Context, dependencies asset.Parents) error
ExtraPartitionNumber: ibiConfig.ExtraPartitionNumber,
ExtraPartitionStart: ibiConfig.ExtraPartitionStart,
InstallationDisk: ibiConfig.InstallationDisk,
ReleaseRegistry: ibiConfig.ReleaseRegistry,
SeedVersion: ibiConfig.SeedVersion,
SeedImage: ibiConfig.SeedImage,
Shutdown: ibiConfig.Shutdown,
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/imagebased/image/ignition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ podman rm lca-cli
/usr/local/bin/lca-cli ibi -f "${ibi_config}"
`,

"/var/tmp/ibi-configuration.json": "{\"extraPartitionLabel\":\"var-lib-containers\",\"extraPartitionNumber\":5,\"extraPartitionStart\":\"-40G\",\"installationDisk\":\"/dev/vda\",\"seedImage\":\"quay.io/openshift-kni/seed-image:4.16.0\",\"seedVersion\":\"4.16.0\"}\n",
"/var/tmp/ibi-configuration.json": "{\"extraPartitionLabel\":\"var-lib-containers\",\"extraPartitionNumber\":5,\"extraPartitionStart\":\"-40G\",\"installationDisk\":\"/dev/vda\",\"releaseRegistry\":\"mirror.quay.io\",\"seedImage\":\"quay.io/openshift-kni/seed-image:4.16.0\",\"seedVersion\":\"4.16.0\"}\n",

"/etc/containers/registries.conf": "credential-helpers = []\nshort-name-mode = \"\"\nunqualified-search-registries = []\n\n[[registry]]\n location = \"quay.io\"\n mirror-by-digest-only = true\n prefix = \"\"\n\n [[registry.mirror]]\n location = \"mirror-quay.io\"\n",

Expand Down
1 change: 1 addition & 0 deletions pkg/asset/imagebased/image/imagebased_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ func ibiConfig() *ImageBasedInstallationConfigBuilder {
ExtraPartitionStart: "-40G",
ExtraPartitionLabel: defaultExtraPartitionLabel,
ExtraPartitionNumber: 5,
ReleaseRegistry: "mirror.quay.io",
Shutdown: false,
SSHKey: "",
PullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"c3VwZXItc2VjcmV0Cg==\"}}}",
Expand Down
4 changes: 4 additions & 0 deletions pkg/types/imagebased/imagebased_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ type InstallationConfig struct {
// PullSecret is the secret to use when pulling images.
PullSecret string `json:"pullSecret"`

// ReleaseRegistry is the container image registry that hosts the OpenShift release-image content.
// +optional
ReleaseRegistry string `json:"releaseRegistry,omitempty"`

// SeedImage is the seed image to use for the installation. This image will be
// used to prepare the installation disk.
SeedImage string `json:"seedImage"`
Expand Down

0 comments on commit 124da37

Please sign in to comment.