Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump library-go to latest version #4198

Closed
wants to merge 3 commits into from
Closed

Bump library-go to latest version #4198

wants to merge 3 commits into from

Conversation

ahmedwaleedmalik
Copy link

@ahmedwaleedmalik ahmedwaleedmalik commented Sep 18, 2020

Current version adds a dependency for bitbucket.org/ww/goautoneg@v0.0.0-20120707110453-75cd24fc2f2c which is an unstable path and is often not available. This dependency was removed from library-go a while back in this commit.

This fixes #4162

Current version adds a dependency for bitbucket.org/ww/goautoneg@v0.0.0-20120707110453-75cd24fc2f2c which is an unstable path and is often not available. This dependency was removed from library-go a while back
@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 18, 2020
@openshift-ci-robot
Copy link
Contributor

Hi @ahmedwaleedmalik. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed 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.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign smarterclayton
You can assign the PR to them by writing /assign @smarterclayton in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@schmaustech
Copy link

I think even with this change you will still run into the bitbucket.org issue when it comes to machine-api-operator:

+ go generate ./data go: github.com/openshift/machine-api-operator@v0.2.1-0.20200429102619-d36974451290 requires github.com/openshift/library-go@v0.0.0-20200324092245-db2a8546af81 requires bitbucket.org/ww/goautoneg@v0.0.0-20120707110453-75cd24fc2f2c: reading https://api.bitbucket.org/2.0/repositories/ww/goautoneg?fields=scm: 404 Not Found

@rdoxenham
Copy link
Contributor

Yeah, you're going to need something like this done to the go.mod file:

sed -zEi 's|(\n[^\n]*){2}$|\n\tgithub.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200917093739-70fa806b210a&|' go.mod

(Before the last line, add in an extra entry for the library-go module)

@ahmedwaleedmalik
Copy link
Author

Yeah we can simply pin it to a specific version as well by adding this in go.mod:

replace github.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200917093739-70fa806b210a

But I am thinking of updating this module in github.com/openshift/machine-api-operator as well because I am working with that operator in parallel as well. And then bump machine-api-operator version in this PR.

@ahmedwaleedmalik
Copy link
Author

It was already updated in machine-api-operator so i just had to bump it's version here. Although, i'd really suggest running go mod tidy and go mod vendor on your repo because there were a few issues with transitive dependencies.

go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
github.com/openshift/installer/cmd/openshift-install imports
        github.com/openshift/client-go/config/clientset/versioned imports
        k8s.io/client-go/discovery imports
        github.com/googleapis/gnostic/OpenAPIv2: module github.com/googleapis/gnostic@latest found (v0.5.1), but does not contain package github.com/googleapis/gnostic/OpenAPIv2

github.com/googleapis/gnostic/OpenAPIv2 doesn't exist anymore and should be replaced with a valid version now like github.com/googleapis/gnostic v.0.5.1.

Should I update that part in my PR as well ? Also, do you guys run go mod tidy and go mod vendor in your pipelines or is that a manual process ?

@rdoxenham
Copy link
Contributor

@ahmedwaleedmalik - no, I simply clone the installer repo, checkout the 4.5 branch (as that's what's important to me right now), and make the following changes-

sed -i 's/library-go.*/library-go v0.0.0-20200917093739-70fa806b210a/g' go.mod

and

sed -zEi 's|(\n[^\n]*){2}$|\n\tgithub.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200917093739-70fa806b210a&|' go.mod

I can then build the binary I need.

@ahmedwaleedmalik
Copy link
Author

Yeah that is already done in this PR. So, it should be good to go imo

@bdurrow
Copy link

bdurrow commented Oct 3, 2020

This does not resolve the issue for me (in the release-4.5 branch at least). I can resolve the issue with the following workaround:

[brad@gca-dev-00-builder openshift-installer]$ git diff go.mod
diff --git a/go.mod b/go.mod
index aadf08c3f..19108f4b2 100644
--- a/go.mod
+++ b/go.mod
@@ -146,4 +146,5 @@ replace (
        sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200120114645-8a9592f1f87b // Pin OpenShift fork
        sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20200526112135-319a35b2e38e // Pin OpenShift fork
        sigs.k8s.io/controller-tools => github.com/abhinavdahiya/controller-tools v0.3.1-0.20200430222905-6fdf2d5fc069 // Using fork for sigs.k8s.io/controller-tools#427
+       github.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200924151131-575c4875cdbe //bgd
 )
[brad@gca-dev-00-builder openshift-installer]$ go mod tidy
warning: ignoring symlink /home/brad/okd/openshift-installer/pkg/asset/store/data
[brad@gca-dev-00-builder openshift-installer]$ go mod vendor
warning: ignoring symlink /home/brad/okd/openshift-installer/pkg/asset/store/data
[brad@gca-dev-00-builder openshift-installer]$ git status
Refresh index: 100% (12906/12906), done.
On branch release-4.5
Your branch is up to date with 'origin/release-4.5'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   go.mod
	modified:   go.sum
	modified:   vendor/github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers/status.go
	modified:   vendor/golang.org/x/net/http2/transport.go
	modified:   vendor/golang.org/x/sys/unix/errors_freebsd_386.go
	modified:   vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
	modified:   vendor/golang.org/x/sys/unix/mkall.sh
	modified:   vendor/golang.org/x/sys/unix/mkerrors.sh
	modified:   vendor/golang.org/x/sys/unix/syscall_freebsd.go
	modified:   vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
	modified:   vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
	modified:   vendor/golang.org/x/sys/unix/syscall_linux.go
	modified:   vendor/golang.org/x/sys/unix/syscall_unix.go
	modified:   vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
	modified:   vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
	modified:   vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
	modified:   vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
	modified:   vendor/golang.org/x/sys/unix/zerrors_linux.go
	modified:   vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go
	modified:   vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go
	modified:   vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go
	modified:   vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
	modified:   vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
	modified:   vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
	modified:   vendor/golang.org/x/sys/unix/ztypes_linux.go
	modified:   vendor/modules.txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go
	vendor/golang.org/x/sys/unix/syscall_illumos.go
	vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go

no changes added to commit (use "git add" and/or "git commit -a")
[brad@gca-dev-00-builder openshift-installer]$ git diff go.mod
diff --git a/go.mod b/go.mod
index aadf08c3f..c8730125c 100644
--- a/go.mod
+++ b/go.mod
@@ -48,7 +48,7 @@ require (
        github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 // indirect
        github.com/openshift-metal3/terraform-provider-ironic v0.2.1
        github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible
-       github.com/openshift/client-go v0.0.0-20200320150128-a906f3d8e723
+       github.com/openshift/client-go v0.0.0-20200521150516-05eb9880269c
        github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e
        github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668
        github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200120152131-1b09fd9e7156
@@ -85,14 +85,14 @@ require (
        golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
        golang.org/x/lint v0.0.0-20200302205851-738671d3881b
        golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
-       golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
+       golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
        google.golang.org/api v0.14.0
        gopkg.in/AlecAivazis/survey.v1 v1.8.9-0.20200217094205-6773bdf39b7f
        gopkg.in/ini.v1 v1.51.0
        gopkg.in/yaml.v2 v2.2.8
-       k8s.io/api v0.18.2
-       k8s.io/apiextensions-apiserver v0.18.2
-       k8s.io/apimachinery v0.18.2
+       k8s.io/api v0.18.3
+       k8s.io/apiextensions-apiserver v0.18.3
+       k8s.io/apimachinery v0.18.3
        k8s.io/client-go v12.0.0+incompatible
        k8s.io/klog v1.0.0
        k8s.io/utils v0.0.0-20200327001022-6496210b90e8
@@ -114,6 +114,7 @@ replace (
        github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20190821174549-a2a477909c1d // Pin OpenShift fork
        github.com/openshift/api => github.com/openshift/api v0.0.0-20200413201024-c6e8c9b6eb9a // Pin API
        github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20200116152001-92a2713fa240 // Pin client-go
+       github.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200924151131-575c4875cdbe //bgd
        github.com/openshift/machine-config-operator => github.com/openshift/machine-config-operator v0.0.1-0.20200130220348-e5685c0cf530 // Pin MCO so it doesn't get downgraded
        github.com/terraform-providers/terraform-provider-aws => github.com/openshift/terraform-provider-aws v1.60.1-0.20200630224953-76d1fb4e5699 // Pin to openshift fork with tag v2.67.0-openshift
        github.com/terraform-providers/terraform-provider-azurerm => github.com/openshift/terraform-provider-azurerm v1.40.1-0.20200707062554-97ea089cc12a // release-2.17.0 branch
[brad@gca-dev-00-builder openshift-installer]$ hack/build.sh
+ minimum_go_version=1.13
++ go version
++ cut -d ' ' -f 3
+ current_go_version=go1.15.2
++ version 1.15.2
++ IFS=.
++ printf '%03d%03d%03d\n' 1 15 2
++ unset IFS
++ version 1.13
++ IFS=.
++ printf '%03d%03d%03d\n' 1 13
++ unset IFS
+ '[' 001015002 -lt 001013000 ']'
+ MODE=release
++ git rev-parse --verify 'HEAD^{commit}'
+ GIT_COMMIT=9893a482f310ee72089872f1a4caea3dbec34f28
++ git describe --always --abbrev=40 --dirty
+ GIT_TAG=unreleased-master-3176-g9893a482f310ee72089872f1a4caea3dbec34f28-dirty
+ GOFLAGS=-mod=vendor
+ LDFLAGS=' -X github.com/openshift/installer/pkg/version.Raw=unreleased-master-3176-g9893a482f310ee72089872f1a4caea3dbec34f28-dirty -X github.com/openshift/installer/pkg/version.Commit=9893a482f310ee72089872f1a4caea3dbec34f28'
+ TAGS=
+ OUTPUT=bin/openshift-install
+ export CGO_ENABLED=0
+ CGO_ENABLED=0
+ case "${MODE}" in
+ LDFLAGS=' -X github.com/openshift/installer/pkg/version.Raw=unreleased-master-3176-g9893a482f310ee72089872f1a4caea3dbec34f28-dirty -X github.com/openshift/installer/pkg/version.Commit=9893a482f310ee72089872f1a4caea3dbec34f28 -s -w'
+ TAGS=' release'
+ test '' '!=' y
+ go generate ./data
writing assets_vfsdata.go
+ echo ' release'
+ grep -q libvirt
+ go build -mod=vendor -ldflags ' -X github.com/openshift/installer/pkg/version.Raw=unreleased-master-3176-g9893a482f310ee72089872f1a4caea3dbec34f28-dirty -X github.com/openshift/installer/pkg/version.Commit=9893a482f310ee72089872f1a4caea3dbec34f28 -s -w' -tags ' release' -o bin/openshift-install ./cmd/openshift-install
[brad@gca-dev-00-builder openshift-installer]$

@ahmedwaleedmalik
Copy link
Author

@bdurrow I was unable to re-produce your issue with the latest master branch. For the current issue just pinning github.com/openshift/library-go to it's latest version removes the transitive dependency that is causing issues

@abhinavdahiya
Copy link
Contributor

I think #4266 should have bumped the master to latest version of library-go that this should be fixed now.
/close

@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: Closed this PR.

In response to this:

I think #4266 should have bumped the master to latest version of library-go that this should be fixed now.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bitbucket.org/ww/goautoneg@v0.0.0-20120707110453-75cd24fc2f2c is often down, please reference another URL
6 participants