Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b75e28fe
Unverified
Commit
b75e28fe
authored
Apr 01, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75595 from liggitt/client-go-instructions
Add preliminary go module instructions to client-go
parents
997d5182
3a988cfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
INSTALL.md
staging/src/k8s.io/client-go/INSTALL.md
+42
-0
No files found.
staging/src/k8s.io/client-go/INSTALL.md
View file @
b75e28fe
...
...
@@ -143,6 +143,48 @@ After modifying, run `glide up -v` again to re-populate your /vendor directory.
Optionally, Glide users can also use
[
`glide-vc`
](
https://github.com/sgotti/glide-vc
)
after running
`glide up -v`
to remove unused files from /vendor.
### Go modules
Dependency management tools are built into go 1.11+ in the form of
[
go modules
](
https://github.com/golang/go/wiki/Modules
)
.
If you are using go 1.11 or 1.12 and are working with a project located within
`$GOPATH`
,
you must opt into using go modules:
```
sh
export
GO111MODULE
=
on
```
Ensure your project has a
`go.mod`
file defined at the root of your project.
If you do not already have one,
`go mod init`
will create one for you:
```
sh
go mod init
```
Indicate the matching versions of
`k8s.io/client-go`
,
`k8s.io/api`
, and
`k8s.io/apimachinery`
your project requires:
```
sh
go get k8s.io/client-go@v10.0.0
# replace v10.0.0 with the required version (or use kubernetes-1.x.y tags if desired)
go get k8s.io/api@kubernetes-1.13.4
# replace kubernetes-1.13.4 with the required version
go get k8s.io/apimachinery@kubernetes-1.13.4
# replace kubernetes-1.13.4 with the required version
```
or you can edit your
`go.mod`
file directly to specify required versions:
```
require (
k8s.io/api kubernetes-1.13.4
k8s.io/apimachinery kubernetes-1.13.4
k8s.io/client-go v10.0.0
)
```
You can now import and use the
`k8s.io/client-go`
APIs in your project.
The next time you
`go build`
,
`go test`
, or
`go run`
your project,
`k8s.io/client-go`
and its dependencies will be downloaded (if needed),
and detailed dependency version info will be added to your
`go.mod`
file.
You can also run
`go mod tidy`
to do this directly.
### Dep (Not supported yet!)
[
dep
](
https://github.com/golang/dep
)
is an up-and-coming dependency management
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment