Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Switch from go dep to go modules #2795

Merged
merged 1 commit into from
May 14, 2020

Conversation

jberkhahn
Copy link
Contributor

working through this. Currently barfing on a whole bunch of api violations. I think this is because the version of client-go the automated go mod inti gave me is wrong - we were on release v12.0 before. I can't seem to get it to give me that version.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 8, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jberkhahn

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2020
@jberkhahn
Copy link
Contributor Author

@mszostok
-moved the repo-infra stuff into contrib/hack
-added a tools.go in contrib/tools for the codegen libs

@mszostok
Copy link
Contributor

mszostok commented May 10, 2020

Fixes:

  • Add replace directive in go.mod to ensure proper versions

    replace (
    	k8s.io/apiserver => k8s.io/apiserver v0.0.0-20200318004442-78eb7668314c
    	k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
    	k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30
    	sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.2.0
    	sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2
    )
    
  • Add // +build tag in tools.go

  • Move comment under imports in tools.go to get rid of lint error:

    contrib/tools/tools.go:25:2: a blank import should be only in a main or test package, or have a comment justifying it
    
  • Add pin-dependency.sh - This script switches to the preferred version for specified module

  • Add update-vendor.sh - this script updates vendor based on go.mod files

  • Add verify-modules.sh script which is replacement for verify-vendor.sh

  • Remove vendor + dep files

  • Bump controller-runtime from 0.2.0-beta.0 to 0.2.0

  • Adjust go builds commands for tools to work with go mod

  • Add go script to verify the boilerplate - same as kubeadm

  • Add export GO111MODULE=on to Makefile as unit-test uses Go 1.12 on our prow pipeline. PR to change it: Bump Go version to 1.13 for svcat unit-tests kubernetes/test-infra#17567

  • Replace github.com/appscode/jsonpatch with gomodules.xyz/jsonpatch/v2

  • Change healthz endpoints to 8081, as new controller-runtime exposes metrics on 8080

  • Change docker volume mount configuration to ensure better performance (https://docs.docker.com/docker-for-mac/osxfs-caching/)

  • update Dependency Management section in devguide.md

@mszostok mszostok force-pushed the bump_deps branch 7 times, most recently from 33831d6 to c6acf66 Compare May 11, 2020 14:28
@mszostok mszostok changed the title WIP change to go modules Switch from go dep to go modules May 14, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2020
- Add `replace` directive in go.mod to ensure proper versions

- Add `// +build` tag in tools.go

- Move comment under imports  in tools.go to get rid of lint error

- Add `pin-dependency.sh` - This script switches to the preferred version for specified module

- Add  `update-vendor.sh` - this script updates vendor based on go.mod files

- Add `verify-modules.sh` script which is replacement for `verify-vendor.sh`

- Bump controller-runtime from 0.2.0-beta.0 to 0.2.0

- Add  go script to verify the boilerplate - same as [kubeadm](https://github.com/kubernetes/kubeadm)

- Add `export GO111MODULE=on` to Makefile as unit-test uses Go 1.12 on our prow pipeline

- Replace github.com/appscode/jsonpatch with gomodules.xyz/jsonpatch/v2

- Change healthz endpoints to 8081, as new controller-runtime exposes metrics on 8080

- Change docker volume mount configuration to ensure better performance (https://docs.docker.com/docker-for-mac/osxfs-caching/)

- update **Dependency Management** section in devguide.md

Co-authored-by: Mateusz Szostok <[email protected]>
@mszostok
Copy link
Contributor

/test pull-build-all-images-for-arm64

@mszostok
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2020
@k8s-ci-robot k8s-ci-robot merged commit 9c42d6b into kubernetes-retired:master May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants