Skip to content

Commit ae7d2e8

Browse files
committed
address reviews, add workflow to exercise code
1 parent def79dc commit ae7d2e8

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,11 @@ jobs:
6161
kubectl describe node
6262
cd examples/
6363
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/kubernetes/build/:/usr/local/lib make memcheck
64+
- name: use bazel for examples
65+
run: |
66+
curl -LO "https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64"
67+
chmod +x bazelisk-linux-amd64
68+
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
69+
cd examples/
70+
bazel build kube_c
71+

BUILD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
# deps = [":kube_c"],
5757
# )
5858

59-
# Make sure you install the pre-requisites (libyaml,libwebsocket etc.) beforehand. A working example can be found here https://github.com/joyanta55/kubernetes_c_bazel/tree/main
59+
# Make sure you install the pre-requisites (libyaml,libwebsocket etc.) beforehand. A working example can be found here
60+
61+
# https://github.com/joyanta55/kubernetes_c_bazel/tree/main
6062

6163
# In summary, the below filegroup allows to import kubernetes C client (i.e. lib_source = "@kubernetes_c_client//:kubernetes"), use cmake or make bazel rule provided by rules_foreign_cc (https://github.com/bazel-contrib/rules_foreign_cc) to build and use.
6264
filegroup(

WORKSPACE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
http_archive(
3+
name = "rules_foreign_cc",
4+
sha256 = "a2e6fb56e649c1ee79703e99aa0c9d13c6cc53c8d7a0cbb8797ab2888bbc99a3",
5+
strip_prefix = "rules_foreign_cc-0.12.0",
6+
url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.12.0/rules_foreign_cc-0.12.0.tar.gz",
7+
)
8+
9+
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
10+
11+
# This sets up some common toolchains for building targets. For more details, please see
12+
# https://bazelbuild.github.io/rules_foreign_cc/0.12.0/flatten.html#rules_foreign_cc_dependencies
13+
rules_foreign_cc_dependencies()
14+
15+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
16+
17+
bazel_features_deps()
18+

examples/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_binary")
2+
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
3+
load("@rules_foreign_cc//foreign_cc:defs.bzl", "make")
4+
cmake(
5+
name = "kube_c",
6+
build_args = [
7+
"--verbose",
8+
"--", # <- Pass remaining options to the native tool.
9+
"-j 1",
10+
],
11+
lib_source = "//:kubernetes",
12+
out_shared_libs = ["libkubernetes.so"],
13+
)

0 commit comments

Comments
 (0)