Closed BIAOXYZ closed 5 years ago
@BIAOXYZ The SDK is still using dep
with Gopkg.toml
and Gopkg.lock
, so you won't be able to build operator-sdk
with go modules enabled.
Can you try setting export GO111MODULE=off
and running make install
again.
@joelanford Thanks. I personally thought it had already been changed to be based on Go module. And after I turn off GO111MODULE
, the compiling succeeds just as before (I have successfully compiled a former operator-sdk version several months ago, maybe before Golang 1.2.x?). This issue can be closed.
PS: Could we need some small changes in this page (developer_guide.md)? I mean, maybe explicitly indicate that it would be better to turn off GO111MODULE
flag?
Hi @joelanford, there is something new appears. In the same environment (two CentOS virtual machines with the same configuration), compiling operator-sdk succeeds in one machine (see my last post above) but fails in another. They are both in the same commit: d6903be02d4e8541e777b25af0498fe31e2e41e8.
To reproduce:
root@myopenshift:operator-sdk$ git reset --hard
HEAD is now at d6903be Makefile: remove test/ansible from ci-ansible (#1623)
root@myopenshift:operator-sdk$ git clean -df
Removing vendor/github.com/operator-framework/operator-sdk/
root@myopenshift:operator-sdk$ git status
# On branch dev-subtract-1
nothing to commit, working directory clean
root@myopenshift:operator-sdk$ git log --oneline | head
d6903be Makefile: remove test/ansible from ci-ansible (#1623)
5507e00 pkg/metrics: pass rest.Config to avoid flag issue in library (#1626)
907c4a7 cmd/operator-sdk/alpha/*,internal/olm: added alpha subcommands to manage OLM installation (#1577)
af139c3 CHANGELOG.md,doc/dev/release.md: get patch versions into main CHANGELOG, clarify release doc (#1621)
e0342c4 Upgrade the version of the dependency controller-runtime from `v0.1.10` to `v0.1.12` (#1612)
261d8d5 fix: Fix a link in README (#1617)
4d7b853 hack/tests,test/e2e: separate testing and scaffolding of E2E te… (#1586)
998ffb1 .travis.yml: don't run travis on release branches (#1616)
0fc5746 cmd/operator-sdk/olmcatalog: scaffold package.yaml for a set of… (#1364)
eedbe31 cmd/operator-sdk/new: make git init opt-in with --git-init flag (#1588)
root@myopenshift:operator-sdk$ make dep
# Gopkg.lock is out of sync with Gopkg.toml and project imports:
github.com/operator-framework/operator-sdk/cmd/operator-sdk/add: imported or required, but missing from Gopkg.lock's input-impo rts
github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha: imported or required, but missing from Gopkg.lock's input-im ports
github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha/olm: imported or required, but missing from Gopkg.lock's inpu t-imports
github.com/operator-framework/operator-sdk/cmd/operator-sdk/build: imported or required, but missing from Gopkg.lock's input-im ports
github.com/operator-framework/operator-sdk/cmd/operator-sdk/completion: imported or required, but missing from Gopkg.lock's inp ut-imports
github.com/operator-framework/operator-sdk/cmd/operator-sdk/generate: imported or required, but missing from Gopkg.lock's input -imports
...
...
...
(22) try github.com/operator-framework/operator-sdk@v0.8.1
(23) ✗ github.com/operator-framework/operator-sdk at v0.8.1 has problem subpkg(s):
(23) github.com/operator-framework/operator-sdk/internal/pkg/scorecard/plugins is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/kube-metrics is missing; required by (root). github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha is missing; required by (root). github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha/olm is missing; required by (root). github.com/operator-framework/operator-sdk/internal/flags is missing; required by (root). github.com/operator-framework/operator-sdk/internal/flags/watch is missing; required by (root). github.com/operator-framework/operator-sdk/internal/olm is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scorecard/helpers is missing; required by (root).
(22) try github.com/operator-framework/operator-sdk@v0.8.0
(23) ✗ github.com/operator-framework/operator-sdk at v0.8.0 has problem subpkg(s):
(23) github.com/operator-framework/operator-sdk/internal/flags/watch is missing; required by (root). github.com/operator-framework/operator-sdk/internal/olm is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scorecard/helpers is missing; required by (root).github.com/operator-framework/operator-sdk/internal/pkg/scorecard/plugins is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/kube-metrics is missing; required by (root). github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha is missing; required by (root).github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha/olm is missing; required by (root). github.com/operator-framework/operator-sdk/internal/flags is missing; required by (root).
(22) try github.com/operator-framework/operator-sdk@v0.7.1
(23) ✗ github.com/operator-framework/operator-sdk at v0.7.1 has problem subpkg(s):
(23) github.com/operator-framework/operator-sdk/internal/olm is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scaffold/internal/testutil is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/kube-metrics is missing; required by (root). github.com/operator-framework/operator-sdk/test/test-framework/pkg/controller/memcachedrs is missing; required by (root). github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scaffold/internal/deps is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/restmapper is missing; required by (root). github.com/operator-framework/operator-sdk/cmd/operator-sdk/alpha/olm is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/ansible/metrics is missing; required by (root). github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha1 is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scorecard/plugins is missing; required by (root). github.com/operator-framework/operator-sdk/internal/flags/watch is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scorecard is missing; required by (root). github.com/operator-framework/operator-sdk/internal/pkg/scorecard/helpers is missing; required by (root). github.com/operator-framework/operator-sdk/internal/flags is missing; required by (root).
...
...
...
(134) ? attempt github.com/hashicorp/hcl with 2 pkgs; at least 1 versions to try
(191) try github.com/hashicorp/hcl@v1.0.0
(191) ✓ select github.com/hashicorp/hcl@v1.0.0 w/10 pkgs
✓ found solution with 795 packages from 134 projects
Solver wall times by segment:
b-list-pkgs: 29.830553551s
b-gmal: 19.267843557s
b-deduce-proj-root: 2.56594415s
b-source-exists: 1.691998284s
select-atom: 1.005807468s
satisfy: 916.149689ms
b-list-versions: 701.149145ms
b-rev-present-in: 537.846479ms
new-atom: 29.92888ms
add-atom: 3.730054ms
select-root: 3.652775ms
other: 1.537902ms
TOTAL: 56.556141934s
# Bringing vendor into sync
(1/1) Wrote github.com/operator-framework/operator-sdk@master: new project
root@myopenshift:operator-sdk$ make install
can't load package: package github.com/operator-framework/operator-sdk/cmd/operator-sdk: cannot find package "github.com/operator-framework/operator-sdk/cmd/operator-sdk" in any of:
/usr/local/go/src/github.com/operator-framework/operator-sdk/cmd/operator-sdk (from $GOROOT)
/root/go/src/github.com/operator-framework/operator-sdk/cmd/operator-sdk (from $GOPATH)
make: *** [install] Error 1
I then remember I forgot to install bzr and hg. But after installing the two, compiling can still not succeed.
@BIAOXYZ You seem to be on a branch # On branch dev-subtract-1
and not on master? What about your version of dep
, what is it?
@LiliC branch dev-subtract-1
is the same as the second latest master
(you can see the commit numbers below). The reason why I reset back one commit in branch dev-subtract-1
is to keep the codebases in the two machines totally the same.
root@myopenshift:operator-sdk$ dep version
dep:
version : v0.5.4
build date : 2019-07-01
git hash : 1f7c19e
go version : go1.12.6
go compiler : gc
platform : linux/amd64
features : ImportDuringSolve=false
root@myopenshift:operator-sdk$ echo $GO111MODULE
off
root@myopenshift:operator-sdk$ git log --oneline | wc -l
1284
root@myopenshift:operator-sdk$ git checkout master
Switched to branch 'master'
root@myopenshift:operator-sdk$ git log --oneline | wc -l
1285
@BIAOXYZ I tried reproducing your issue with no success. As you say, the build works on one machine and fails on the other. Therefore it appears your issue is indeed environmental, so I'm going to close this issue. I would check your vendored dependency's versions, make sure the code is in fact the same between machines, and check your dep version. If you can reliably recreate the dependency issues, feel free to open another ticket (since the original issue does not match the one now being discussed).
@estroz OK, I will try again and find the reason.
Bug Report
What did you do? Try to compile the latest version of operator-sdk.
What did you expect to see? After successfully executing
make dep
, I expect thatmake install
step will also succeed.What did you see instead? Under which circumstances?
Environment
Additional context
This is the content of the go.mod file in the root path of the repo. I have try to mannually change the
k8s.io/api
part of it following the way of https://github.com/kubernetes/client-go/issues/551. But it still does not work.