Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ mustgather-example.yaml
saas-must-gather-operator-bundle
# IDE
.idea
# Binaries used by make
bin/
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,23 @@ include boilerplate/generated-includes.mk
.PHONY: boilerplate-update
boilerplate-update:
@boilerplate/update

OPENAPI_GEN_PKG := k8s.io/kube-openapi/cmd/openapi-gen
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen

# go-install-tool will 'go install' any package $2 and install it to $1.
define go-install-tool
@{ \
set -e ;\
echo "Downloading $(2)" ;\
GOBIN=$(shell dirname $(1)) go install $(2) ;\
echo "Installed in $(1)" ;\
rm -rf $$TMP_DIR ;\
}
endef
Comment on lines +12 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove unused TMP_DIR cleanup.

The macro references $$TMP_DIR on line 19 but never creates it. This appears to be residual code from a copy-paste of the go-get-tool macro in standard.mk (which does create and use TMP_DIR).

Apply this diff to remove the unused cleanup:

 define go-install-tool
 @{ \
 set -e ;\
 echo "Downloading $(2)" ;\
 GOBIN=$(shell dirname $(1)) go install $(2) ;\
 echo "Installed in $(1)" ;\
-rm -rf $$TMP_DIR ;\
 }
 endef
🤖 Prompt for AI Agents
In Makefile around lines 12 to 21, the go-install-tool macro calls rm -rf
$$TMP_DIR even though TMP_DIR is never created or used; remove the unused
cleanup line (rm -rf $$TMP_DIR) from the macro so it no longer references a
non-existent TMP_DIR and leave the rest of the macro intact.


.PHONY: install-tools
install-tools:
$(call go-install-tool, $(shell pwd)/bin/controller-gen, $(CONTROLLER_GEN_PKG))
$(call go-install-tool, $(shell pwd)/bin/openapi-gen, $(OPENAPI_GEN_PKG))

40 changes: 1 addition & 39 deletions api/v1alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions boilerplate/openshift/golang-osd-operator/standard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ rm -rf $$TMP_DIR ;\
}
endef

CONTROLLER_GEN = controller-gen
OPENAPI_GEN = openapi-gen
CONTROLLER_GEN = ../bin/controller-gen
OPENAPI_GEN = ./bin/openapi-gen
KUSTOMIZE = kustomize
YQ = yq

Expand All @@ -216,13 +216,13 @@ op-generate:
.PHONY: openapi-generate
openapi-generate:
find ./api -maxdepth 2 -mindepth 1 -type d | xargs -t -I% \
$(OPENAPI_GEN) --logtostderr=true \
-i % \
-o "" \
-O zz_generated.openapi \
-p % \
-h /dev/null \
-r "-"
$(OPENAPI_GEN) \
--logtostderr \
--output-dir ./api/v1alpha1 \
--output-pkg my.module/api/v1alpha1 \
--output-file zz_generated.openapi.go \
--go-header-file /dev/null \
--report-filename -

.PHONY: manifests
manifests:
Expand Down
2 changes: 1 addition & 1 deletion deploy/crds/managed.openshift.io_mustgathers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.1-0.20250818134112-b624019bbe8d
controller-gen.kubebuilder.io/version: v0.18.0
name: mustgathers.managed.openshift.io
spec:
group: managed.openshift.io
Expand Down
39 changes: 26 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.24.0
require (
github.com/blang/semver/v4 v4.0.0
github.com/go-logr/logr v1.4.2
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.1
github.com/onsi/ginkgo/v2 v2.23.3
github.com/onsi/gomega v1.37.0
github.com/openshift/api v0.0.0-20240522145529-93d6bda14341
github.com/openshift/operator-custom-metrics v0.5.0
github.com/openshift/osde2e-common v0.0.0-20240604133256-b7200cad0cca
Expand All @@ -16,8 +16,9 @@ require (
k8s.io/api v0.33.3
k8s.io/apimachinery v0.33.3
k8s.io/client-go v0.33.3
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3
sigs.k8s.io/controller-runtime v0.21.0
sigs.k8s.io/controller-tools v0.18.0
)

require (
Expand All @@ -32,6 +33,7 @@ require (
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
Expand All @@ -40,19 +42,23 @@ require (
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/moby/spdystream v0.5.0 // indirect
Expand All @@ -68,21 +74,25 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.38.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.3 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/term v0.31.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.26.0 // indirect
golang.org/x/tools v0.32.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
Expand All @@ -91,6 +101,8 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.33.0 // indirect
k8s.io/cli-runtime v0.28.2 // indirect
k8s.io/code-generator v0.33.0 // indirect
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kubectl v0.28.2 // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
Expand All @@ -100,5 +112,6 @@ require (
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.2.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading