Introduce API module.

This commit is contained in:
Jeffrey Regan
2019-10-21 13:22:04 -07:00
parent 4f014d0262
commit 46524d3b6a
243 changed files with 1332 additions and 1243 deletions

View File

@@ -305,8 +305,8 @@ A Go plugin for kustomize looks like this:
> package main
>
> import (
> "sigs.k8s.io/kustomize/v3/pkg/ifc"
> "sigs.k8s.io/kustomize/v3/pkg/resmap"
> "sigs.k8s.io/kustomize/api/ifc"
> "sigs.k8s.io/kustomize/api/resmap"
> ...
> )
>

View File

@@ -52,7 +52,8 @@ kustomize and the plugin_.
This means a one-time run of
```
GOPATH=${whatever} GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3
# Or whatever is appropriate at time of reading
GOPATH=${whatever} GO111MODULE=on go get sigs.k8s.io/kustomize/api
```
and then a normal development cycle using

View File

@@ -46,7 +46,7 @@ Need v3.0.0 for what follows, and you must _compile_
it (not download the binary from the release page):
```shell
GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/kustomize
```
## Make a home for plugins

View File

@@ -30,14 +30,14 @@ See the [installation docs](INSTALL.md).
## Go API Versioning
The public methods in the public packages
of module `sigs.k8s.io/kusomize` constitute
of module `sigs.k8s.io/kustomize/api` constitute
the _kustomize Go API_.
#### Version sigs.k8s.io/kustomize/v3 and earlier
[import path]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
In `v3` (and preceeding major versions), the
In `kustomize/v3` (and preceeding major versions), the
kustomize program and the API live the same Go
module at `sigs.k8s.io/kustomize`, at [import path]
`sigs.k8s.io/kustomize/v3`.
@@ -83,10 +83,11 @@ The last option seems the most appealing.
#### The first stable API version is coming
The first stable API version will launch at
The first stable API version will launch
as the Go module
```
sigs.k8s.io/kustomize/api/v1
sigs.k8s.io/kustomize/api
```
The _kustomize_ program itself (`main.go`
@@ -105,7 +106,9 @@ obey semver with a sustainable public
surface, informed by current usage. Clients
should import packages from this module, i.e.
from import paths prefixed by
`sigs.k8s.io/kustomize/api/v1`. The kustomize binary
`sigs.k8s.io/kustomize/api/` at first,
and later by `sigs.k8s.io/kustomize/api/v2/`.
The kustomize binary
itself is an API client requiring this module.
The clients and API will evolve independently.

View File

@@ -35,5 +35,5 @@ chmod u+x kustomize
<!-- @installkustomize @testAgainstLatestRelease -->
```
go install sigs.k8s.io/kustomize/v3/cmd/kustomize
go install sigs.k8s.io/kustomize/kustomize
```