generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 52
Add Bazel files to support Bazel integration #254
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
Merged
k8s-ci-robot
merged 3 commits into
kubernetes-client:master
from
joyanta55:joyanta55/kube_c_bazel
Nov 19, 2024
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Added BUILD file in the kubernetes c client repository helps integrating the library to external Bazel users. | ||
# Following are the changes required from the external Bazel users to do. | ||
|
||
# WORKSPACE | ||
|
||
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
# http_archive( | ||
# name = "rules_foreign_cc", | ||
# sha256 = "a2e6fb56e649c1ee79703e99aa0c9d13c6cc53c8d7a0cbb8797ab2888bbc99a3", | ||
# strip_prefix = "rules_foreign_cc-0.12.0", | ||
# url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.12.0/rules_foreign_cc-0.12.0.tar.gz", | ||
# ) | ||
|
||
# load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") | ||
|
||
# # This sets up some common toolchains for building targets. For more details, please see | ||
# # https://bazelbuild.github.io/rules_foreign_cc/0.12.0/flatten.html#rules_foreign_cc_dependencies | ||
# rules_foreign_cc_dependencies() | ||
|
||
# load("@bazel_features//:deps.bzl", "bazel_features_deps") | ||
|
||
# bazel_features_deps() | ||
|
||
# http_archive( | ||
# name = "kubernetes_c_client", | ||
# sha256 = "10d0c5af1a52a1d2da379e8e45b53978b9dedc90ff195bdff171ae17c1f1dd50", | ||
# strip_prefix = "c-0.11.0", | ||
# url = "https://github.com/kubernetes-client/c/archive/refs/tags/v0.11.0.zip", | ||
# ) | ||
|
||
# BUILD file: | ||
|
||
# load("@rules_cc//cc:defs.bzl", "cc_binary") | ||
# load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
# load("@rules_foreign_cc//foreign_cc:defs.bzl", "make") | ||
# cmake( | ||
# name = "kube_c", | ||
# build_args = [ | ||
# "--verbose", | ||
# "--", # <- Pass remaining options to the native tool. | ||
# "-j 1", | ||
# ], | ||
# lib_source = "@kubernetes_c_client//:kubernetes", | ||
# out_shared_libs = ["libkubernetes.so"], | ||
# ) | ||
|
||
# cc_binary( | ||
# name = "create_pod", | ||
# srcs = ["create_pod.c"], | ||
# deps = [":kube_c"], | ||
# ) | ||
|
||
# cc_binary( | ||
# name = "list_pod", | ||
# srcs = ["list_pod.c"], | ||
# deps = [":kube_c"], | ||
# ) | ||
|
||
# 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 | ||
|
||
# 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. | ||
filegroup( | ||
name = "kubernetes", | ||
srcs = glob(["kubernetes/**"]), | ||
visibility = ["//visibility:public"], | ||
) |
Empty file.
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: line break before the URL