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-10209: Pass in icsp file to be used for 'oc adm release extract' #4115
MGMT-10209: Pass in icsp file to be used for 'oc adm release extract' #4115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ICSP configuration is used solely for extracting the installer binary from the release image in the assisted-service pod (running on the HUB cluster).
I think that the HUB cluster should have the ICSP (I think it's even mounted inside the pod)
so we probably would get it from there.
@avishayt perhaps we should define an API for installing from mirror registry and allow users to provide ICSP (currently they need to use install-config override)
pkg/generator/generator.go
Outdated
@@ -32,6 +32,7 @@ type Config struct { | |||
ReleaseImageMirror string | |||
DummyIgnition bool `envconfig:"DUMMY_IGNITION"` | |||
InstallInvoker string `envconfig:"INSTALL_INVOKER" default:"assisted-installer"` | |||
IcspFile string `envconfig:"ICSP_FILE" default:""` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who should set this env?
What should be the content of IcspFile
is it the imageContentSourcePolicy content or file path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be set when running BILLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this will be set when running BLLI, it will be the file path of a mounted ICSP API file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are currently passing into to the assisted-service container the registries.conf file, mounted in /etc/containers, and this is used here to set up the ImageContentSources in the install-config. We could also use that to build up an ImageContenSourcePolicy API to pass into the 'oc' command if that is the preferred way to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be set in MCE. Doing this is a pre-requisite to switching to the official oc
command instead of using a fork.
BILLI is the first user only because it has to use official builds.
If linking to github in the commit message, please use a permalink |
|
Codecov Report
@@ Coverage Diff @@
## master #4115 +/- ##
==========================================
+ Coverage 65.28% 65.66% +0.38%
==========================================
Files 186 186
Lines 26342 26887 +545
==========================================
+ Hits 17197 17655 +458
- Misses 7567 7627 +60
- Partials 1578 1605 +27
|
Fixed |
Pass in an ICSP file via an environment variable to be used when running the oc command to extract the installer. Note that the ImageContentSources are also in the generated install-config https://github.com/openshift/assisted-service/blob/master/internal/installcfg/installcfg.go#L113. This PR allows the ICSP to be passed in, in the API format that the oc command expects.
81a7c75
to
b342025
Compare
I'm not sure I understand the question. We weren't planning on doing a install-config override from BLLI, but even so I don't think that would help in passing the ICSP to 'oc'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main question is whether it'd be possible to generate the ICSP from the /etc/containers/registries.conf
file and write it to a tempfile. That would save having to configure it in two places, and possibly eliminate a lot of the boilerplate here.
Talk of adding an API for this makes it unclear whether that would be flexible enough for all use cases though.
pkg/generator/generator.go
Outdated
@@ -32,6 +32,7 @@ type Config struct { | |||
ReleaseImageMirror string | |||
DummyIgnition bool `envconfig:"DUMMY_IGNITION"` | |||
InstallInvoker string `envconfig:"INSTALL_INVOKER" default:"assisted-installer"` | |||
IcspFile string `envconfig:"ICSP_FILE" default:""` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be set in MCE. Doing this is a pre-requisite to switching to the official oc
command instead of using a fork.
BILLI is the first user only because it has to use official builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just add few logging
if err != nil { | ||
return "", err | ||
} | ||
if _, err := icspFile.Write(contents); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add logging of the ICSP content.
It should allow us to debug issues in case something goes wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, added.
} | ||
|
||
if len(installCfg.ImageContentSources) == 0 { | ||
// No ImageContentSources were defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider logging here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added logging.
internal/ignition/ignition.go
Outdated
return "", err | ||
} | ||
if contents == nil { | ||
log.Infof("No ImageContentsSources in install-config to build ICSP file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to pass log in to this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also typo in ImageContentSources
/lgtm |
/lgtm |
/test ? |
@eranco74: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test edge-e2e-ai-operator-ztp-disconnected |
/lgtm |
/test edge-e2e-ai-operator-ztp-disconnected |
Need openshift/release#30488 to fix the tests. |
/test edge-e2e-ai-operator-ztp-disconnected |
Even after openshift/release#30488, IPv6 dev-scripts jobs are still broken by https://bugzilla.redhat.com/show_bug.cgi?id=2087096 |
Hopefully openshift/release#30508 should fix IPv6. |
W00t! |
@zaneb: once the present PR merges, I will cherry-pick it on top of release-4.11 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bfournie, pawanpinjarkar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@bfournie: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@zaneb: new pull request created: #4141 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…openshift#4115) * MGMT-10209: Pass in icsp file to be used for 'oc adm release extract' Pass in an ICSP file via an environment variable to be used when running the oc command to extract the installer. Note that the ImageContentSources are also in the generated install-config https://github.com/openshift/assisted-service/blob/master/internal/installcfg/installcfg.go#L113. This PR allows the ICSP to be passed in, in the API format that the oc command expects. * generate mockRelease * Get the ImageContentSources for icsp file from install-config * Fixes for defer * added logging and unit tests * fixes for logging * fixes for logging * fixes for logging * fixes for logging * revert PR 3700 and get latest oc image * revert PR 3700 and get latest oc image
…openshift#4115) * MGMT-10209: Pass in icsp file to be used for 'oc adm release extract' Pass in an ICSP file via an environment variable to be used when running the oc command to extract the installer. Note that the ImageContentSources are also in the generated install-config https://github.com/openshift/assisted-service/blob/master/internal/installcfg/installcfg.go#L113. This PR allows the ICSP to be passed in, in the API format that the oc command expects. * generate mockRelease * Get the ImageContentSources for icsp file from install-config * Fixes for defer * added logging and unit tests * fixes for logging * fixes for logging * fixes for logging * fixes for logging * revert PR 3700 and get latest oc image * revert PR 3700 and get latest oc image
Pass in an ICSP file to the 'oc' command to extract the installer. The ICSP file is created using the ImageContentSources in the install-config.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Assignees
/cc @
/cc @
Checklist
docs
, README, etc)Reviewers Checklist