openshift/boilerplate

Allow Configurable Path For config.go

dustman9000 opened this issue · 6 comments

Some repos have their config.go in different path(s). The config.go parsing fails in this case. Add better prereq checks before parsing:

$ make
#boilerplate/_lib/ensure.sh golangci-lint
# GOLANGCI_LINT_CACHE needs to be set to a directory which is writeable
# Relevant issue - https://github.com/golangci/golangci-lint/issues/734
GOLANGCI_LINT_CACHE=/tmp/golangci-cache golangci-lint run -c boilerplate/openshift/golang_osd_cluster_operator/golangci.yml ./...
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOFLAGS= go test  github.com/openshift/must-gather-operator/cmd/manager github.com/openshift/must-gather-operator/pkg/apis github.com/openshift/must-gather-operator/pkg/apis/mustgather github.com/openshift/must-gather-operator/pkg/apis/mustgather/v1alpha1 github.com/openshift/must-gather-operator/pkg/config github.com/openshift/must-gather-operator/pkg/controller github.com/openshift/must-gather-operator/pkg/controller/mustgather github.com/openshift/must-gather-operator/version
?   	github.com/openshift/must-gather-operator/cmd/manager	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/apis	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/apis/mustgather	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/apis/mustgather/v1alpha1	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/config	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/controller	[no test files]
?   	github.com/openshift/must-gather-operator/pkg/controller/mustgather	[no test files]
?   	github.com/openshift/must-gather-operator/version	[no test files]
sed: config/config.go: No such file or directory
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOFLAGS= go build -gcflags="all=-trimpath=/Users/dustinrow/.gvm/pkgsets/go1.13.6/global" -asmflags="all=-trimpath=/Users/dustinrow/.gvm/pkgsets/go1.13.6/global" -o build/_output/bin/ ./cmd/manager
if [ "" == "true" ]; then \
		docker run --rm -v `pwd -P`:`pwd -P` python:2.7.15 /bin/sh -c "cd `pwd`; pip install oyaml; `pwd`/"; \
	else \
		; \
	fi
bash: -c: line 0: syntax error near unexpected token `;'
bash: -c: line 0: `if [ "" == "true" ]; then 	docker run --rm -v `pwd -P`:`pwd -P` python:2.7.15 /bin/sh -c "cd `pwd`; pip install oyaml; `pwd`/"; else 	; fi'
make: *** [generate-syncset] Error 2

We should allow for a configurable make variable such as CONFIG_GO_PATH

I'd actually like us to get away from parsing go files to determine the operator name and namespace.

But even if we don't, IMO we should avoid configurable knobs unless there's no alternative. In this case, would it be a problem to move the file?

Can this be closed @dustman9000? IIRC the case in question was MGO and you successfully moved the file.

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

/close

Reopen if there's still something to be done here.

@2uasimojo: Closing this issue.

In response to this:

/close

Reopen if there's still something to be done here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.