Bug 1882699

Summary: Make gen-doc work outside of GOPATH
Product: OpenShift Container Platform Reporter: Ivo Meixner <imeixner>
Component: Insights OperatorAssignee: Martin Kunc <mkunc>
Status: CLOSED ERRATA QA Contact: Pavel Šimovec <psimovec>
Severity: medium Docs Contact: Marc Muehlfeld <mmuehlfe>
Priority: medium    
Version: 4.6CC: aos-bugs, avicenzi, inecas, tremes
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 16:45:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivo Meixner 2020-09-25 11:20:40 UTC
Description of problem:
Right now, running `make gen-doc` when the Insights Operator repository is not cloned into the GOPATH results in strange errors because that's what the code expects. It would be nice to fix that since I.O. now uses modern Go with modules and therefore cloning into GOPATH is no longer necessary, nor is it desirable.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Pavel Šimovec 2020-09-25 22:49:50 UTC
One commit before the one in mentione PR:
running make gen-doc
...
GatherMachineSet
Error when running Example in package home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig method ExampleMostRecentMetrics
exit status 1
sample2973194451432506304.go:2:9: cannot find package "." in:
	/home/psimovec/zaloha/insights-operator/vendor/home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig

Error when running Example in package home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig method ExampleClusterOperators
exit status 1
sample7734107962907469252.go:2:9: cannot find package "." in:
	/home/psimovec/zaloha/insights-operator/vendor/home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig

Error when running Example in package home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig method ExampleNodes
exit status 1
sample777803314506547199.go:2:9: cannot find package "." in:
	/home/psimovec/zaloha/insights-operator/vendor/home/psimovec/zaloha/insights-operator/pkg/gather/clusterconfig

Done%                                                                                                                                                                                                          


After applying commit from this PR
...
GatherMachineSet
ExampleMostRecentMetrics
ExampleClusterOperators
ExampleNodes
ExampleMostRecentMetrics
ExampleClusterOperators
ExampleNodes
Done
make gen-doc  74.55s user 5.21s system 511% cpu 15.597 total

Comment 5 errata-xmlrpc 2020-10-27 16:45:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196