Skip to content

Commit

Permalink
Merge pull request #1665 from monopole/introduceApiModule
Browse files Browse the repository at this point in the history
Introduce API module.
  • Loading branch information
k8s-ci-robot authored Oct 21, 2019
2 parents 4f014d0 + 46524d3 commit 644f2dd
Show file tree
Hide file tree
Showing 243 changed files with 1,332 additions and 1,243 deletions.
2 changes: 1 addition & 1 deletion api/filesys/confirmeddir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"testing"

. "sigs.k8s.io/kustomize/v3/api/filesys"
. "sigs.k8s.io/kustomize/api/filesys"
)

func TestJoin(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/filesys/fsinmemory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"reflect"
"testing"

. "sigs.k8s.io/kustomize/v3/api/filesys"
. "sigs.k8s.io/kustomize/api/filesys"
)

func TestExists(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/filesys/fsondisk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"reflect"
"testing"

. "sigs.k8s.io/kustomize/v3/api/filesys"
. "sigs.k8s.io/kustomize/api/filesys"
)

func makeTestDir(t *testing.T) (FileSystem, string) {
Expand Down
2 changes: 1 addition & 1 deletion api/git/cloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/exec"

"github.com/pkg/errors"
"sigs.k8s.io/kustomize/v3/api/filesys"
"sigs.k8s.io/kustomize/api/filesys"
)

// Cloner is a function that can clone a git repo.
Expand Down
2 changes: 1 addition & 1 deletion api/git/repospec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"regexp"
"strings"

"sigs.k8s.io/kustomize/v3/api/filesys"
"sigs.k8s.io/kustomize/api/filesys"
)

// Used as a temporary non-empty occupant of the cloneDir
Expand Down
21 changes: 21 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module sigs.k8s.io/kustomize/api

go 1.13

require (
github.com/evanphx/json-patch v4.5.0+incompatible
github.com/go-openapi/spec v0.19.4
github.com/golang/protobuf v1.3.2 // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 // indirect
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.4
k8s.io/api v0.0.0-20191016225839-816a9b7df678
k8s.io/apimachinery v0.0.0-20191020214737-6c8691705fc5
k8s.io/client-go v11.0.0+incompatible
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d
sigs.k8s.io/yaml v1.1.0
)
162 changes: 162 additions & 0 deletions api/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/hasher/hasher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package hasher_test
import (
"testing"

. "sigs.k8s.io/kustomize/v3/api/hasher"
. "sigs.k8s.io/kustomize/api/hasher"
)

func TestSortArrayAndComputeHash(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/ifc/ifc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
package ifc

import (
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
)

// Validator provides functions to validate annotations and labels
Expand Down
2 changes: 1 addition & 1 deletion api/internal/accumulator/expansion/expand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"testing"

. "sigs.k8s.io/kustomize/v3/api/internal/accumulator/expansion"
. "sigs.k8s.io/kustomize/api/internal/accumulator/expansion"
)

type expected struct {
Expand Down
8 changes: 4 additions & 4 deletions api/internal/accumulator/loadconfigfromcrds.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/go-openapi/spec"
"github.com/pkg/errors"
"k8s.io/kube-openapi/pkg/common"
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)

Expand Down
12 changes: 6 additions & 6 deletions api/internal/accumulator/loadconfigfromcrds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"reflect"
"testing"

"sigs.k8s.io/kustomize/v3/api/ifc"
. "sigs.k8s.io/kustomize/v3/api/internal/accumulator"
"sigs.k8s.io/kustomize/v3/api/internal/loadertest"
"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/ifc"
. "sigs.k8s.io/kustomize/api/internal/accumulator"
"sigs.k8s.io/kustomize/api/internal/loadertest"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
)

// This defines two CRD's: Bee and MyKind.
Expand Down
10 changes: 5 additions & 5 deletions api/internal/accumulator/namereferencetransformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"
"log"

"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/resource"
"sigs.k8s.io/kustomize/v3/api/transform"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/transform"
)

type nameReferenceTransformer struct {
Expand Down
12 changes: 6 additions & 6 deletions api/internal/accumulator/namereferencetransformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"strings"
"testing"

"sigs.k8s.io/kustomize/v3/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/resource"
"sigs.k8s.io/kustomize/v3/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/testutils/resmaptest"
)

func TestNameReferenceHappyRun(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions api/internal/accumulator/refvartransformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ package accumulator
import (
"fmt"

expansion2 "sigs.k8s.io/kustomize/v3/api/internal/accumulator/expansion"
expansion2 "sigs.k8s.io/kustomize/api/internal/accumulator/expansion"

"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/transform"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/transform"
"sigs.k8s.io/kustomize/api/types"
)

type refVarTransformer struct {
Expand Down
12 changes: 6 additions & 6 deletions api/internal/accumulator/refvartransformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"reflect"
"testing"

"sigs.k8s.io/kustomize/v3/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/resource"
"sigs.k8s.io/kustomize/v3/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/api/types"
)

func TestRefVarTransformer(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions api/internal/accumulator/resaccumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"log"
"strings"

"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
)

// ResAccumulator accumulates resources and the rules
Expand Down
16 changes: 8 additions & 8 deletions api/internal/accumulator/resaccumulator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"strings"
"testing"

. "sigs.k8s.io/kustomize/v3/api/internal/accumulator"
"sigs.k8s.io/kustomize/v3/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/v3/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/v3/api/resmap"
"sigs.k8s.io/kustomize/v3/api/resource"
"sigs.k8s.io/kustomize/v3/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/v3/api/types"
. "sigs.k8s.io/kustomize/api/internal/accumulator"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/testutils/resmaptest"
"sigs.k8s.io/kustomize/api/types"
)

func makeResAccumulator(t *testing.T) (*ResAccumulator, *resource.Factory) {
Expand Down
6 changes: 3 additions & 3 deletions api/internal/loadertest/fakeloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package loadertest
import (
"log"

"sigs.k8s.io/kustomize/v3/api/filesys"
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/v3/api/loader"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/loader"
)

// FakeLoader encapsulates the delegate Loader and the fake file system.
Expand Down
9 changes: 0 additions & 9 deletions api/internal/tools/tools.go

This file was deleted.

2 changes: 1 addition & 1 deletion api/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package inventory
import (
"encoding/json"

"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/api/resid"
)

//Refs is a reference map. Each key is the id
Expand Down
4 changes: 2 additions & 2 deletions api/inventory/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package inventory_test
import (
"testing"

. "sigs.k8s.io/kustomize/v3/api/inventory"
"sigs.k8s.io/kustomize/v3/api/resid"
. "sigs.k8s.io/kustomize/api/inventory"
"sigs.k8s.io/kustomize/api/resid"
)

func makeRefs() (Refs, Refs) {
Expand Down
2 changes: 1 addition & 1 deletion api/k8sdeps/configmapandsecret/configmapfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/pkg/errors"
"k8s.io/api/core/v1"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/types"
)

func makeFreshConfigMap(
Expand Down
10 changes: 5 additions & 5 deletions api/k8sdeps/configmapandsecret/configmapfactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/kustomize/v3/api/filesys"
"sigs.k8s.io/kustomize/v3/api/kv"
"sigs.k8s.io/kustomize/v3/api/loader"
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/kv"
"sigs.k8s.io/kustomize/api/loader"
"sigs.k8s.io/kustomize/api/testutils/valtest"
"sigs.k8s.io/kustomize/api/types"
)

func makeEnvConfigMap(name string) *corev1.ConfigMap {
Expand Down
4 changes: 2 additions & 2 deletions api/k8sdeps/configmapandsecret/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package configmapandsecret

import (
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/types"
)

// Factory makes ConfigMaps and Secrets.
Expand Down
2 changes: 1 addition & 1 deletion api/k8sdeps/configmapandsecret/secretfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"

corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/types"
)

func makeFreshSecret(
Expand Down
10 changes: 5 additions & 5 deletions api/k8sdeps/configmapandsecret/secretfactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/kustomize/v3/api/filesys"
"sigs.k8s.io/kustomize/v3/api/kv"
"sigs.k8s.io/kustomize/v3/api/loader"
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/kv"
"sigs.k8s.io/kustomize/api/loader"
"sigs.k8s.io/kustomize/api/testutils/valtest"
"sigs.k8s.io/kustomize/api/types"
)

func makeEnvSecret(name string) *corev1.Secret {
Expand Down
6 changes: 3 additions & 3 deletions api/k8sdeps/kunstruct/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/util/yaml"
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/v3/api/k8sdeps/configmapandsecret"
"sigs.k8s.io/kustomize/v3/api/types"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/k8sdeps/configmapandsecret"
"sigs.k8s.io/kustomize/api/types"
)

// KunstructuredFactoryImpl hides construction using apimachinery types.
Expand Down
2 changes: 1 addition & 1 deletion api/k8sdeps/kunstruct/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"reflect"
"testing"

"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/api/ifc"
)

func TestSliceFromBytes(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/k8sdeps/kunstruct/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/kustomize/v3/api/hasher"
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/api/hasher"
"sigs.k8s.io/kustomize/api/ifc"
)

// kustHash computes a hash of an unstructured object.
Expand Down
4 changes: 2 additions & 2 deletions api/k8sdeps/kunstruct/unstructadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/kustomize/v3/api/ifc"
"sigs.k8s.io/kustomize/v3/api/resid"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/resid"
)

var _ ifc.Kunstructured = &UnstructAdapter{}
Expand Down
Loading

0 comments on commit 644f2dd

Please sign in to comment.