-
Notifications
You must be signed in to change notification settings - Fork 426
pkg/cli/admin/release: support extracting baremetal installer #57
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
Conversation
|
Ah, ok - so the binary is extracted as The only downside is that ultimately I guess we all hope this support will end up in the stock openshift-install binary, and |
|
@markmc If we would rather not put this code into What do you think? |
|
I'd prefer if it wasn't so hidden - should be able to get it easily with Also |
Ah I didn't realize that was part of |
|
Also, even if we need the fallback, it wouldn't be as simple. We would need to do something similar by hand. |
|
/assign @smarterclayton |
Great point. Agree a fallback isn't really viable |
|
This command is used to extract most release tooling by default. If we don’t expect this to be part of GA in 4.2 I think it needs to be more hidden - Ie you need to ask for it explicitly with —command. Also, this command must work against older clusters, so we can’t add a new binary that would fail if used against 4.1. I’d probably prefer image extract is used in 4.2 rather than adding to release extract. If you can make the case that users won’t be able to succeed with that command, then this PR will need to take the above changes into account. |
I wouldn't expect this to change for 4.2, the earliest we could address the issues that would remove the need for a separate baremetal-installer is 4.3. |
|
There is also a related bug I've fixed as a separate PR here: #59
|
| targets[i].AsArchive = true | ||
| targets[i].AsZip = targets[i].OS == "windows" | ||
| // Only non-Hidden targets will be included in an archive. | ||
| for _, target := range availableTargets { |
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.
The ideal outcome is:
oc adm release extract —tools
Doesn’t include it, but
oc adm release extract —command openshift-baremetal-installer
Extracts the binary
oc adm release extract —command openshift-baremetal-installer —command-os=*
Creates an archive.
Hence the suggestion for optional - the explicit request overrides optional, rather than the current behavior here with always excluding from archive.
|
@smarterclayton Ok, so I believe this should work as you expect - see below for some examples. Previously |
|
And just for completeness, the behavior of |
|
What are the contents of the archives from:
…--command='oc' --command-os='*'
?
On Fri, Aug 16, 2019 at 8:05 PM Stephen Benjamin ***@***.***> wrote:
And just for completeness, the behavior of master is:
$ ./oc adm release extract --registry-config /tmp/pull.json --command=openshift-install --command-os='*' --to /tmp/foo registry.svc.ci.openshift.org/ocp/release:4.2
$ ls /tmp/foo
openshift-install
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57?email_source=notifications&email_token=AAI37J54DD3GZFVJSUZ6P53QE3T47A5CNFSM4ILQBYX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4PJ3KI#issuecomment-522100137>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI37J4GJ4OM7KFECBLDVGDQE3T47ANCNFSM4ILQBYXQ>
.
|
|
I think it looks ok, except for Windows, it's missing the exe suffix. Will fix that logic. |
When extracting commands from a release, the command is typically the same as the source executable in the image, however if that is not the case - for example, in the case of the baremetal installer, oc does the wrong thing. If the command is `openshift-baremetal-installer` but it is extracted from `usr/bin/openshift-installer`, oc extracts the file as openshift-installer.
|
@smarterclayton Fixed |
| if len(command) > 0 && currentOS != "*" { | ||
| return fmt.Errorf("command %q does not support the operating system %q", o.Command, currentOS) | ||
| } else { | ||
| return fmt.Errorf("the supported commands are 'oc', and 'openshift-install'") |
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 error message is inaccurate now (there is no guarantee command has been specified). You should also exit early, and the message should retain its original form.
switch {
case len(command) > 0 && currentOS != "*":
case len(command) > 0:
return fmt.Errorf("the supported commands are 'oc' and 'openshift-install'")
default:
return fmt.Errorf("no available commands")
}
to replace this if body.
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.
Ah good point. Updated.
Although, I assume the first case in your example above shouldn't fall through but return the command %q does not support... error?
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, sorry, I meant to add a # add correct error here
52e0659 to
581d645
Compare
When specifying --command-os='*' and --command, we should use an archive as there can be more than one result. This previously didn't work.
The installer for baremetal is in a separate image as part of the release, we need to provide awareness to the `oc` command so we can actually extract the installer. This also introduces the concept of an 'optional' command that is not extracted when using --tools.
|
/test e2e-aws |
|
/lgtm We need to watch carefully after merge to see if this breaks any tooling (such as the archive downloading on openshift-release.svc.ci.openshift.org or ART release tooling generating). @sosiouxme @tbielawa @jwforres be aware No plans to back port this to 4.1 so should have no impact on z stream, unless ART is accidentally using a 4.2 oc binary with 4.1 builds. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smarterclayton, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Looks like this already landed in https://openshift-release-artifacts.svc.ci.openshift.org/4.2.0-0.ci-2019-08-21-125453/ has the tools extracted correctly. |
The installer for baremetal is in a separate image as part of the
release, we need to provide awareness to the
occommand so we canactually extract the installer and replace the release image location.
A user would extract the baremetal installer like this: