Skip to content

Commit 5333c2f

Browse files
author
Oscar Bonilla
committed
Add syntax highlighting to README
1 parent 1133e6a commit 5333c2f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ These bazel rules download and make available the [Kubebuilder SDK](https://gith
44

55
To use these rules, add the following to your `WORKSPACE` file:
66

7-
```
7+
```starlark
88
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
99

1010
git_repository(
@@ -28,7 +28,7 @@ kustomize_register_toolchain()
2828

2929
And in your `go_test()` files, add `etcd` as a data dependency like this:
3030

31-
```
31+
```starlark
3232
go_test(
3333
name = "go_default_test",
3434
srcs = ["apackage_test.go"],
@@ -42,28 +42,28 @@ go_test(
4242
```
4343
You'll need to run the test as:
4444

45-
```
45+
```shell
4646
bazel test --test_env=KUBEBUILDER_ASSETS=$(bazel info execution_root 2>/dev/null)/$(bazel run @kubebuilder_sdk//:pwd 2>/dev/null) //...
4747
```
4848

4949
You can also add the following to `BUILD.bazel` at the root of your workspace:
5050

51-
```
51+
```starlark
5252
load("@rules_kubebuilder//kubebuilder:def.bzl", "kubebuilder")
5353
kubebuilder(name = "kubebuilder")
5454
```
5555

5656
to be able to run `kubebuilder` like so:
5757

58-
```
59-
$ bazel run //:kubebuilder -- --help
58+
```shell
59+
bazel run //:kubebuilder -- --help
6060
```
6161

6262
## Controller-gen
6363

6464
In order to use `controller-gen` you will need to do something like the following in your `api/v1alpha1` directory (essentially where the `*_type.go` files are):
6565

66-
```
66+
```starlark
6767
load("@io_bazel_rules_go//go:def.bzl", "go_library")
6868
load(
6969
"@rules_kubebuilder//controller-gen:controller-gen.bzl",
@@ -126,8 +126,8 @@ they can be used. Fortunately Go supports cross compiling so in order to build t
126126
need to get and install Go either from [their download page](https://golang.org/doc/install) or from
127127
homebrew by running
128128

129-
```
130-
$ brew install golang
129+
```shell
130+
brew install golang
131131
```
132132

133133
After that you can run the script in `scripts/build-controller-gen.sh` which will compile `controller-gen`

0 commit comments

Comments
 (0)