Commit Graph
153 Commits
Author SHA1 Message Date
Michael Adam c3ed3fc2a2 build: add make target lint
The newly added make target 'lint' runs various linters
on the code base.

Signed-off-by: Michael Adam <obnox@samba.org>
2025-01-27 20:40:11 +01:00
Michael Adam 11a15d3adf ci: refactor a shellcheck make target out of the github ci workflow
This is to allow developers to conveniently run the same check locally
as run in the CI.

Signed-off-by: Michael Adam <obnox@samba.org>
2025-01-24 18:37:58 +01:00
Michael Adam 5c39ac537a build: remove broken make target lint
The lint make target is not used anywhere in the codebase and is particular not run in the CI.
It was recently discovered that `make lint` does not even work at all.
It was subsequently suggested to remove the broken and unused target altogether.

This change settles that issue by removing the lint target and the preparatory
 golint installation target.

Fixes: #15317

Signed-off-by: Michael Adam <obnox@samba.org>
2025-01-24 18:20:49 +01:00
Michael Adam 8addaff330 ci: extract make targets from linters workflow
This extracts two functionalities from
the linters ci workflow into make targets for
convenient local execution: yamllint and pylint

Signed-off-by: Michael Adam <obnox@samba.org>
2025-01-22 18:30:42 +01:00
Michael Adam 795e188024 ci: rework docs-related workflow and make targets a bit
This change continues an effort started earlier to make some
make targets and ci workflows more consistent and systematic.
see https://github.com/rook/rook/pull/14922

it adds a  make target gen.helm-docs as an alias to helm-docs.
Additionally, gen.docs is added as alias to docs.
targets check.docs and check.helm-docs are removed because it was agreed
that targets using git are of little value to developers.
Their functionality is moved back into the corresponding docs workflow.

xiFinally, the  redundant "Check helm-docs" check is removed from the
docs-check workflow

Signed-off-by: Michael Adam <obnox@samba.org>
2025-01-09 20:31:14 +01:00
Michael AdamandBlaine Gardner 04741fb899 build: make generating make targets more systematic
This addresses a suggestion from a review comment in another PR.

The goal of this change is to make generating make targets more systematic.

Firstly, generating targets are made available under a more systematic naming
 following the pattern of "gen.foo".
more concretely, the following targets are introduced as aliases of the corresponding existing
 targets:

* gen.codegen
* gen.rbac
* gen.crds
* gen.docs
* gen.crd-docs

additionally, a  new "generate" make target is added that invokes all generating targets.

Co-authored-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Signed-off-by: Michael Adam <obnox@samba.org>
2024-10-30 12:11:01 +01:00
Michael Adam d9d0d8e1d3 ci: rename 'check-helm-docs' to 'check.helm-docs
This makes the naming of ci-related make targets more systematic and
consistent.

It is based on PR https://github.com/rook/rook/pull/14672
 and continues the pattern started in that PR.

Signed-off-by: Michael Adam <obnox@samba.org>
2024-09-06 17:49:17 +02:00
Michael Adam 93179a41f3 ci: slightly rework the docs-check workflow
This reworks the docs-check ci workflow in several ways:

* It renames the make target 'check-docs' to the  more systematic 'check.docs'.
* It adds a 'docs'mode to the  files validation script, and uses the script in `make check.docs`.

Overall, the workflow and local make targets are more systematic and
consistent with this change.

Signed-off-by: Michael Adam <obnox@samba.org>
2024-09-05 22:09:40 +02:00
subhamkrai 2556e14780 build: changes forced by latest controller-runtime
this commit contains changes that are forced by latest
controller-runtime version v0.19.0.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-08-20 21:21:42 +05:30
Blaine Gardner 33f5407dd4 multus: add host checking to validation tool
In order to help users check that they have implemented the newly-added
Multus host configuration prerequisites, add a check to the validation
tool to verify connectivity.

Because users who are already running clusters with Multus enabled, add
a flag that allows users to only check for host configuration
prerequisites. This mode will not start the large number of clients that
would normally be started because those clients could disrupt a running
Rook cluster negatively.

Host checking pods require host network access. Many Kubernetes
distributions have pod security features enabled. In order to allow
non-Vanilla distros to run this tool, allow specifying a service account
that pods will run as, which can be configured by the admin to allow
test pods.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-07-10 13:41:38 -06:00
subhamkrai 43e0c1cdb3 build: add support for go 1.22
Few day's back go 1.22 is release. Let's add that
as valid version to build on. Also, adding 1.22 as
test matric for linux build CI.

https://tip.golang.org/doc/go1.22

Signed-off-by: subhamkrai <srai@redhat.com>
2024-03-27 10:34:21 +05:30
subhamkrai dd8c3c9974 build: remove csv related files
remove csv related files/content which are not used/required for
upstream uses.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-03-11 21:01:53 +05:30
Alexander Trost fcf52207f8 build: use /usr/bin/env to look up script interpreters
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2023-11-21 14:38:22 +01:00
travisn 0bf117493d build: avoid crd edits when building on mac
On mac development machines, the crds are being left in a
state of change with the description removed and the
OBC CRDs removed from crds.yaml and resources.yaml.
By skipping the related env vars, these resources
are no longer left unexpectedly modified.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-09-15 08:00:57 -06:00
subhamkrai 1b652f8176 build: add check to validate crd in csv
In the past we had few cases where the new crd
was missed adding in metadata-common.yaml file.
So, now we'll check if crds.yaml and metadata-common.yaml
crd name are matching.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-09-06 19:37:25 +05:30
Michael Adam 04670d3f76 ci: simplify the docs-check workflow by extracting functionality
This simplifies the docs-check workflow definition by extracting  functionality
directly coded into the workflow file into new make targets 'check-docs'
and 'check-helm-docs' and replacing the code in the workflow file by the simple invocation of
new make targets. As a side effect, it makes it easily possible for a
developer to check locally if they forgot to commit any autogenerated
docs.

Signed-off-by: Michael Adam <obnox@samba.org>
2023-09-01 18:17:02 +02:00
Michael AdamandBlaine Gardner 22882c5358 multus: auto-update the validation job manifest file with help text
Signed-off-by: Michael Adam <obnox@samba.org>

this change  introduces a new 'make target 'docs'that generates part of the documentation

It particular, it runs the `helm-docs` target.

Additionally, `make docs`  updates the  multus validation job manifest
by inserting the output of `rook multus validation run --help` between
two newly introduced markers.

The result of running `make docs` is intended to be committed to git after running

Fixes: #12706

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: Michael Adam <obnox@samba.org>

Update build/deploy/generate-deploy-examples.sh

Signed-off-by: Michael Adam <obnox@samba.org>
2023-08-25 18:37:16 +02:00
parth-gr 8175bc0218 build: make crds should be able to build generated docs
Currently, if there is any change in the API we need to separately
run the make generate-crd-docs but with this change
make crds will also update the generated docs

Also improved the file locations

Closes: https://github.com/rook/rook/issues/12310

Signed-off-by: parth-gr <paarora@redhat.com>
2023-06-15 20:11:23 +05:30
Javier 661e476969 docs: auto-generate the documentation for CRDs
add generate-crd-docs.sh tool for auto-generate the documentation for CRDs automatically

Closes: #1873
Signed-off-by: Javier <sjavierlopez@gmail.com>
2023-05-01 19:23:27 -06:00
parth-grandBlaine Gardner 69ae9569cd build: update k8s version to 1.26.1
Update the Kubernetes API version used to 1.26.1, and start testing
against Kubernetes version 1.26.1 in CI.

Co-authored-by: parth-gr <paarora@redhat.com>
Co-authored-by: Blaine Gardner <blaine.gardner@redhat.com>

Signed-off-by: parth-gr <paarora@redhat.com>
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2023-02-23 20:18:47 -07:00
subhamkrai 9abe1169ca build: fix csv generation during make build
we need to export variable in different lines
to work in Makefile, exporting in single doesn't
work.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-02-21 09:00:39 +05:30
subhamkrai 4699e8885a build: add rbac which are required
adding necessary rbac and also updating
csv-gen script.

Closes: https://github.com/rook/rook/issues/10141
Signed-off-by: subhamkrai <srai@redhat.com>
2023-02-17 23:00:03 +05:30
subhamkrai 45a10dcb85 core: upgrade to latest operator-sdk v1.25.0
upgrading to latest operator-sdk later version
and changing the way of csv generation.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-02-13 17:08:09 +05:30
Zuhair 792a261ca9 docs: auto generate helm chart docs using helm-docs
Signed-off-by: Zuhair AlSader <zuhair@koor.tech>
2022-12-02 17:08:50 -05:00
Blaine Gardner 1e9bbae583 docs: move PSPs from common.yaml to psp.yaml
Also update docs. Use `make gen-rbac` to generate psp.yaml.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-08-25 16:39:52 -06:00
Travis Nielsen 24e416069a core: update controller runtime to v0.6.2
The dependencies in controller runtim v0.5 were getting old
and causing go module issues on macos. Now with the update to
v0.6.2 the module dependency issue is solved. For another
day we should update the controller runtime to even newer.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-08-11 12:41:11 -06:00
Alexander Trost de28a21879 build: add separate docs build and preview targets
This adds two new make target for building and previewing the current
state of the documentation locally.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2022-06-27 13:29:25 +02:00
subhamkrai 6de3e3d48d build: update go-ceph version and remove ceph_preview
updating go ceph version to 0.15.0 will no longer require
`ceph_preview` during build. Also if added in VsCode workspace
we can remove that now.

Signed-off-by: subhamkrai <srai@redhat.com>
2022-04-21 11:38:11 +05:30
Blaine Gardner bca2f128ab build: generate a separate NFS CSI RBAC manifest
Because the NFS CSI driver is optional and rarely deployed, make RBAC
for this driver an optional example that is generated by the helm chart.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-04-12 16:57:11 -06:00
Travis Nielsen 738a300827 build: remove obsolete cross build container
The cross build container is not used anymore since the conversion
to github actions. Now the obsolete scripts and makefiles are
cleaned up to remove some confusing leftovers from the
cross container.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-04-07 13:42:18 -06:00
Sébastien Han 8512b6a0e1 build: set LC_ALL on the make target
Simply applying `LC_ALL=C` will work for the current shell only. For all
the shells and sub-shell to use it, we must set it globally.
Making it the first thing in the Make entrypoint now so the CRD and RBAC
sorting works on all the platforms.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-18 12:01:04 +01:00
Blaine Gardner bcc7d3e541 build: generate common.yaml from helm charts
Generate deploy/examples/common.yaml from Helm charts. There were still
a few differences between common.yaml and the Helm charts. Where there
were differences we assume common.yaml was the most up-to-date.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-07 13:54:27 -07:00
Blaine Gardner 2c4b66957c build: generate CSV from helm charts
In order to generate common.yaml from Helm charts, we have to have a
different way of generating CSV than from meta-comments in common.yaml.
This implementation changes what appears in the CSV's RBAC somewhat, but
these changes could be considered bugs fixed by using the new Helm
generation method.
- a few PSP related resources are removed from CSV
- resources related to 'rook-ceph-purge-osd' Job are added to CSV
- ClusterRoleBinding 'rook-ceph-object-bucket' is added to CSV

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-30 08:35:54 -07:00
Blaine Gardner 51fc36d591 build: prevent parallel build collisions for ceph
Prevent parallel build collisions in the 'ceph' image by building
prerequisites for the builds before running the build targets in
parallel. Build targets can collide and try to create the same target at
nearly the same time, causing failures.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-30 08:09:24 -07:00
Blaine Gardner 113e2f849d build: use yq for RBAC yaml parsing
Use yq instead of Python for parsing RBAC from the Helm chart. We need
to use yq v4.14.1 or higher to fix yq's handling of the yaml header
markers ('---'). Update the Makefile's yq version to v4, which also
requires updating the script to update the CRDs. This was quite easy.

It is very difficult, however, to change the version of yq used by the
CSV generating/parsing scripts, which already used their own yq
download. Continue using yq v3 for this.

In order to make sure the scripts are using the right version of yq, add
basic validation to them to verify they are running v3 or v4 as required
for their operation.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-30 08:08:08 -07:00
Sébastien Han 6fb67a297d build: only produce binary for linux
We now build rook to build only for linux platforms and not darwin nor
windows anymore.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-04 15:13:40 +01:00
Sébastien Han e08755ef61 build: make CGO_ENABLED configurable
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-04 15:13:40 +01:00
Satoru Takeuchi 737567937a Merge pull request #9047 from cybozu-go/build-fix-the-default-target
build: fix the default target of Makefile
2021-10-29 09:27:31 +09:00
Sébastien Han f2cb792e9f rgw: add support for updating user caps
User's capabilities can now be updated from the admin ops API.

Closes: https://github.com/rook/rook/issues/8683
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-28 14:17:13 +02:00
Satoru Takeuchi 98a4049fae build: fix the default target of Makefile
The current default target of Makefile is "_output/charts".

```
$ make -d
...
Successfully remade target file '/home/sat/go/src/github.com/rook/rook/_output/charts'.
```

It's because Makefile first includes "build/makelib/helm.mk", this file defines
some targets, and the first entry is regarded as the default target.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-10-27 13:38:54 +00:00
Blaine Gardner 221281cab3 build: fix offline image build race condition
When generating the offline image list, the threaded crossbuild can
try to generate the image list from muliple jobs at once, resulting in
undefined behavior (usually an empty file) for the output file. To fix
this, we can generate this file in the `build.common` step which is not
run in parallel.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-10-11 16:07:28 -06:00
Blaine Gardner 74d3492ee5 build: fix double include of build/makelib/helm.mk
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-09-30 15:29:54 -06:00
Blaine Gardner e2ba16f710 build: start tracking rbac generated from helm chart
This is a starting step to be able to generate common.yaml from Helm
charts. For right now, we merely want to be able to determine when the
rendered output of the Helm chart changes.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-09-30 12:20:24 -06:00
Travis Nielsen 0a0b9c98bd build: remove obsolete flex driver
The flex driver has been fully deprecated and thus removed from Rook.
Before upgrading to v1.8, users will need to convert existing flex volumes
from flex to csi volumes.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-09-23 16:17:20 -06:00
Blaine Gardner 9138732c81 build: stage CSV files into tmp while building
If a user were to `make build` Rook, and after the Ceph CSV was
generated and before make had finished, the Rook repo would be left with
changes caused by the build modifying files temporarily in-place.

All CSV template generation in the Ceph makefile is now self-contained
and can be configured to operate outside of the main repo so that files
are not modified in-place.

In-place modification of files was also incorrect. On Mac some files
with `-e` trailing were left, and in-place backups were also present in
the form `<filename>''`. Therefore, also fix the generation to fix
in-place modifications.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-07-27 16:11:58 -06:00
Blaine Gardner d260b81e97 core: persist VolumeClaimTemplate metadtata
Allow metadata on VolumeClaimTemplates in StorageClassDeviceSets to be
persisted. The latest changes to controller-gen allows us to embed
objectmeta for embedded types.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-04-27 13:37:48 -06:00
Satoru Takeuchi a4277d2913 Merge pull request #7723 from travisn/build-linux-only
build: Only build linux platform
2021-04-22 17:35:05 +09:00
Travis Nielsen 2398b1636b build: only build linux platform
No need to include darwin and windows in the list of platforms
since rook is only containerized and expected to run in a linux
environment.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-04-21 14:57:31 -06:00
Satoru Takeuchi 8a48dbb00d ceph: stop vendoring
We generate vendor directory in building process. It doesn't reduce
build time. In addition, we have encountered some vendoring-related
problems. So let's stop vendoring.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-04-21 02:01:56 +00:00
Sébastien Han 57131e1a90 ci: build and run various make commands on MacOS
Introducing a small action on MacOS to help us catch errors with various
'make' command on OSX, most notably 'sed' versus 'gnu-sed'.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-04-20 17:21:08 +02:00