Skip to content

Commit 7896a75

Browse files
Merge pull request #976 from jhadvig/CONSOLE-4523
CONSOLE-4523: Add rhel8 and rhel9 oc binaries for Linux OS in CLI downloads
2 parents fe800f5 + 3683964 commit 7896a75

File tree

4 files changed

+55
-7
lines changed

4 files changed

+55
-7
lines changed

bindata/assets/deployments/downloads-deployment.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,26 @@ spec:
125125
126126
for arch, operating_system, path in [
127127
('amd64', 'linux', '/usr/share/openshift/linux_amd64/oc'),
128+
('amd64', 'linux', '/usr/share/openshift/linux_amd64/oc.rhel8'),
129+
('amd64', 'linux', '/usr/share/openshift/linux_amd64/oc.rhel9'),
128130
('amd64', 'mac', '/usr/share/openshift/mac/oc'),
129131
('amd64', 'windows', '/usr/share/openshift/windows/oc.exe'),
130132
('arm64', 'linux', '/usr/share/openshift/linux_arm64/oc'),
133+
('arm64', 'linux', '/usr/share/openshift/linux_arm64/oc.rhel8'),
134+
('arm64', 'linux', '/usr/share/openshift/linux_arm64/oc.rhel9'),
131135
('arm64', 'mac', '/usr/share/openshift/mac_arm64/oc'),
132136
('ppc64le', 'linux', '/usr/share/openshift/linux_ppc64le/oc'),
137+
('ppc64le', 'linux', '/usr/share/openshift/linux_ppc64le/oc.rhel8'),
138+
('ppc64le', 'linux', '/usr/share/openshift/linux_ppc64le/oc.rhel9'),
133139
('s390x', 'linux', '/usr/share/openshift/linux_s390x/oc'),
140+
('s390x', 'linux', '/usr/share/openshift/linux_s390x/oc.rhel8'),
141+
('s390x', 'linux', '/usr/share/openshift/linux_s390x/oc.rhel9'),
134142
]:
135143
basename = os.path.basename(path)
136144
target_path = os.path.join(arch, operating_system, basename)
137-
os.mkdir(os.path.join(arch, operating_system))
145+
os.makedirs(os.path.join(arch, operating_system), exist_ok=True)
138146
os.symlink(path, target_path)
139-
base_root, _ = os.path.splitext(basename)
140-
archive_path_root = os.path.join(arch, operating_system, base_root)
147+
archive_path_root = os.path.join(arch, operating_system, basename)
141148
with tarfile.open('{}.tar'.format(archive_path_root), 'w') as tar:
142149
tar.add(path, basename)
143150
with zipfile.ZipFile('{}.zip'.format(archive_path_root), 'w') as zip:

pkg/console/controllers/clidownloads/controller.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,20 @@ func PlatformBasedOCConsoleCLIDownloads(host, cliDownloadsName string) *v1.Conso
184184
archType string
185185
}{
186186
{"Linux for x86_64", "amd64/linux", "oc.tar"},
187+
{"Linux for x86_64 - RHEL 8", "amd64/linux", "oc.rhel8.tar"},
188+
{"Linux for x86_64 - RHEL 9", "amd64/linux", "oc.rhel9.tar"},
187189
{"Mac for x86_64", "amd64/mac", "oc.zip"},
188-
{"Windows for x86_64", "amd64/windows", "oc.zip"},
190+
{"Windows for x86_64", "amd64/windows", "oc.exe.zip"},
189191
{"Linux for ARM 64", "arm64/linux", "oc.tar"},
192+
{"Linux for ARM 64 - RHEL 8", "arm64/linux", "oc.rhel8.tar"},
193+
{"Linux for ARM 64 - RHEL 9", "arm64/linux", "oc.rhel9.tar"},
190194
{"Mac for ARM 64", "arm64/mac", "oc.zip"},
191195
{"Linux for IBM Power, little endian", "ppc64le/linux", "oc.tar"},
196+
{"Linux for IBM Power, little endian - RHEL 8", "ppc64le/linux", "oc.rhel8.tar"},
197+
{"Linux for IBM Power, little endian - RHEL 9", "ppc64le/linux", "oc.rhel9.tar"},
192198
{"Linux for IBM Z", "s390x/linux", "oc.tar"},
199+
{"Linux for IBM Z - RHEL 8", "s390x/linux", "oc.rhel8.tar"},
200+
{"Linux for IBM Z - RHEL 9", "s390x/linux", "oc.rhel9.tar"},
193201
}
194202

195203
links := []v1.CLIDownloadLink{}
@@ -212,7 +220,7 @@ func PlatformBasedOCConsoleCLIDownloads(host, cliDownloadsName string) *v1.Conso
212220
Spec: v1.ConsoleCLIDownloadSpec{
213221
Description: `With the OpenShift command line interface, you can create applications and manage OpenShift projects from a terminal.
214222
215-
The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features.
223+
The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features. You can download oc using the following links.
216224
`,
217225
DisplayName: "oc - OpenShift Command Line Interface (CLI)",
218226
Links: links,

pkg/console/controllers/clidownloads/controller_test.go

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,42 @@ func TestPlatformBasedOCConsoleCLIDownloads(t *testing.T) {
116116
Spec: v1.ConsoleCLIDownloadSpec{
117117
Description: `With the OpenShift command line interface, you can create applications and manage OpenShift projects from a terminal.
118118
119-
The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features.
119+
The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features. You can download oc using the following links.
120120
`,
121121
DisplayName: "oc - OpenShift Command Line Interface (CLI)",
122122
Links: []v1.CLIDownloadLink{
123123
{
124124
Href: "https://www.example.com/amd64/linux/oc.tar",
125125
Text: "Download oc for Linux for x86_64",
126126
},
127+
{
128+
Href: "https://www.example.com/amd64/linux/oc.rhel8.tar",
129+
Text: "Download oc for Linux for x86_64 - RHEL 8",
130+
},
131+
{
132+
Href: "https://www.example.com/amd64/linux/oc.rhel9.tar",
133+
Text: "Download oc for Linux for x86_64 - RHEL 9",
134+
},
127135
{
128136
Href: "https://www.example.com/amd64/mac/oc.zip",
129137
Text: "Download oc for Mac for x86_64",
130138
},
131139
{
132-
Href: "https://www.example.com/amd64/windows/oc.zip",
140+
Href: "https://www.example.com/amd64/windows/oc.exe.zip",
133141
Text: "Download oc for Windows for x86_64",
134142
},
135143
{
136144
Href: "https://www.example.com/arm64/linux/oc.tar",
137145
Text: "Download oc for Linux for ARM 64",
138146
},
147+
{
148+
Href: "https://www.example.com/arm64/linux/oc.rhel8.tar",
149+
Text: "Download oc for Linux for ARM 64 - RHEL 8",
150+
},
151+
{
152+
Href: "https://www.example.com/arm64/linux/oc.rhel9.tar",
153+
Text: "Download oc for Linux for ARM 64 - RHEL 9",
154+
},
139155
{
140156
Href: "https://www.example.com/arm64/mac/oc.zip",
141157
Text: "Download oc for Mac for ARM 64",
@@ -144,10 +160,26 @@ The oc binary offers the same capabilities as the kubectl binary, but it is furt
144160
Href: "https://www.example.com/ppc64le/linux/oc.tar",
145161
Text: "Download oc for Linux for IBM Power, little endian",
146162
},
163+
{
164+
Href: "https://www.example.com/ppc64le/linux/oc.rhel8.tar",
165+
Text: "Download oc for Linux for IBM Power, little endian - RHEL 8",
166+
},
167+
{
168+
Href: "https://www.example.com/ppc64le/linux/oc.rhel9.tar",
169+
Text: "Download oc for Linux for IBM Power, little endian - RHEL 9",
170+
},
147171
{
148172
Href: "https://www.example.com/s390x/linux/oc.tar",
149173
Text: "Download oc for Linux for IBM Z",
150174
},
175+
{
176+
Href: "https://www.example.com/s390x/linux/oc.rhel8.tar",
177+
Text: "Download oc for Linux for IBM Z - RHEL 8",
178+
},
179+
{
180+
Href: "https://www.example.com/s390x/linux/oc.rhel9.tar",
181+
Text: "Download oc for Linux for IBM Z - RHEL 9",
182+
},
151183
{
152184
Href: "https://www.example.com/oc-license",
153185
Text: "LICENSE",

test/e2e/downloads_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestDownloadsEndpoint(t *testing.T) {
4242
req := getRequest(t, link.Href)
4343
client := getInsecureClient()
4444
resp, err := client.Do(req)
45+
t.Logf("Requesting %s at %s\n", link.Text, link.Href)
4546

4647
if err != nil {
4748
t.Fatalf("http error getting %s at %s: %s", link.Text, link.Href, err)

0 commit comments

Comments
 (0)