Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-19545: add optional release registry field to the IBI installation config #9394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions pkg/asset/imagebased/image/imagebased_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"c3VwZXItc2VjcmV0Cg==\"}}}"
seedImage: quay.io/openshift-kni/seed-image:4.16.0
seedVersion: 4.16.0
installationDisk: /dev/vda
releaseRegistry: mirror.quay.io
networkConfig:
interfaces:
- name: eth0
Expand Down Expand Up @@ -395,6 +396,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