Skip to content

Commit 17a5811

Browse files
committed
Install preflight binary on Linux machines
Adding preflight to the list of OpenShift binaries installed. For now, this is only available on Linux machines and won't be added to anyone using Darwin.
1 parent c6172d4 commit 17a5811

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

hack/bin/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ genrule(
3838
visibility = ["//visibility:public"],
3939
)
4040

41+
genrule(
42+
name = "fetch_preflight",
43+
srcs = select({
44+
":k8": ["@preflight_linux//file"],
45+
}),
46+
outs = ["preflight"],
47+
cmd = "cp $(SRCS) $@",
48+
visibility = ["//visibility:public"],
49+
)
50+
4151
genrule(
4252
name = "fetch_faq",
4353
srcs = select({

hack/bin/deps.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ OPENSHIFT_REPO = "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/o
2222

2323
# filenames and versions from ${OPENSHIFT_REPO}/sha256sum.txt
2424
OPENSHIFT_BINS = {
25+
"preflight": {
26+
# currently, preflight is only available on linux
27+
"preflight_linux": {
28+
"url": "https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.2.1/preflight-linux-amd64",
29+
"sha": "e5754a81d4baae4f4956fc0842179a3daeac4778e202450f886a9afb05d218ba",
30+
},
31+
},
2532
"oc": {
2633
"oc_darwin": {
2734
"url": "{}/openshift-client-mac-{}.tar.gz".format(OPENSHIFT_REPO, OPENSHIFT_VERSION),
@@ -71,6 +78,7 @@ def install():
7178
install_operator_sdk()
7279
install_opm()
7380
install_openshift()
81+
install_preflight()
7482

7583
# Install golang.org/x/build as kubernetes/repo-infra requires it for the
7684
# build-tar bazel target.
@@ -413,6 +421,17 @@ filegroup(
413421
"""
414422
)
415423

424+
def install_preflight():
425+
versions = OPENSHIFT_BINS["preflight"]
426+
427+
for k, v in versions.items():
428+
http_file(
429+
name = k,
430+
executable = 1,
431+
sha256 = v["sha"],
432+
urls = [v["url"]]
433+
)
434+
416435
## Fetch crdb used in our container
417436
def install_crdb():
418437
http_archive(

pkg/resource/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ go_library(
5757
go_test(
5858
name = "go_default_test",
5959
srcs = [
60-
"cluster_test.go",
6160
"certificate_test.go",
61+
"cluster_test.go",
6262
"discovery_service_test.go",
6363
"pod_distruption_budget_test.go",
6464
"public_service_test.go",

0 commit comments

Comments
 (0)