mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 09:40:49 +00:00
Compare commits
8 Commits
api/v0.1.1
...
release-pl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a8faced8f | ||
|
|
3c06debf98 | ||
|
|
fcee91eafd | ||
|
|
b0b3a705f4 | ||
|
|
67c8fbcc3c | ||
|
|
9b50b78ec8 | ||
|
|
943a1b0195 | ||
|
|
f77143cd34 |
@@ -1,4 +1,4 @@
|
|||||||
module sigs.k8s.io/kustomize/kustomize/v3
|
module sigs.k8s.io/kustomize/kustomize
|
||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
@@ -8,8 +8,6 @@ require (
|
|||||||
github.com/pkg/errors v0.8.1
|
github.com/pkg/errors v0.8.1
|
||||||
github.com/spf13/cobra v0.0.5
|
github.com/spf13/cobra v0.0.5
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
sigs.k8s.io/kustomize/api v0.0.1
|
sigs.k8s.io/kustomize/api v0.1.1
|
||||||
sigs.k8s.io/yaml v1.1.0
|
sigs.k8s.io/yaml v1.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
replace sigs.k8s.io/kustomize/api v0.0.1 => ../api
|
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKf
|
|||||||
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d h1:Xpe6sK+RY4ZgCTyZ3y273UmFmURhjtoJiwOMbQsXitY=
|
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d h1:Xpe6sK+RY4ZgCTyZ3y273UmFmURhjtoJiwOMbQsXitY=
|
||||||
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
||||||
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
|
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
|
||||||
|
sigs.k8s.io/kustomize/api v0.1.1 h1:W2dWXex2MhF4/EZNokZllvet2RejCHqdAFklufN7VTg=
|
||||||
|
sigs.k8s.io/kustomize/api v0.1.1/go.mod h1:FyfJD1q1QMjC/TvK78b6cCtZB+mbpnGIo9YOvbucJes=
|
||||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/resource"
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/build"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/build"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/config"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/config"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/create"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/create"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/version"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewDefaultCommand returns the default (aka root) command for kustomize command.
|
// NewDefaultCommand returns the default (aka root) command for kustomize command.
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type createFlags struct {
|
type createFlags struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
|
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
var factory = kunstruct.NewKunstructuredFactoryImpl()
|
var factory = kunstruct.NewKunstructuredFactoryImpl()
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type addBaseOptions struct {
|
type addBaseOptions struct {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// kindOfAdd is the kind of metadata being added: label or annotation
|
// kindOfAdd is the kind of metadata being added: label or annotation
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ package add
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/testutils/valtest"
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeKustomization(t *testing.T) *types.Kustomization {
|
func makeKustomization(t *testing.T) *types.Kustomization {
|
||||||
@@ -73,7 +73,7 @@ func TestAddAnnotationInvalidFormat(t *testing.T) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("expected an error")
|
t.Errorf("expected an error")
|
||||||
}
|
}
|
||||||
if err.Error() != validators.SAD {
|
if err.Error() != valtest_test.SAD {
|
||||||
t.Errorf("incorrect error: %v", err.Error())
|
t.Errorf("incorrect error: %v", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ func TestAddLabelInvalidFormat(t *testing.T) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("expected an error")
|
t.Errorf("expected an error")
|
||||||
}
|
}
|
||||||
if err.Error() != validators.SAD {
|
if err.Error() != valtest_test.SAD {
|
||||||
t.Errorf("incorrect error: %v", err.Error())
|
t.Errorf("incorrect error: %v", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/patch"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/patch"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type addPatchOptions struct {
|
type addPatchOptions struct {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type addResourceOptions struct {
|
type addResourceOptions struct {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ package add
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newCmdAddConfigMap returns a new command.
|
// newCmdAddConfigMap returns a new command.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/kv"
|
"sigs.k8s.io/kustomize/api/kv"
|
||||||
"sigs.k8s.io/kustomize/api/loader"
|
"sigs.k8s.io/kustomize/api/loader"
|
||||||
"sigs.k8s.io/kustomize/api/testutils/valtest"
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// flagsAndArgs encapsulates the options for add secret/configmap commands.
|
// flagsAndArgs encapsulates the options for add secret/configmap commands.
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ package add
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newCmdAddSecret returns a new command.
|
// newCmdAddSecret returns a new command.
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/kv"
|
"sigs.k8s.io/kustomize/api/kv"
|
||||||
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/loader"
|
"sigs.k8s.io/kustomize/api/loader"
|
||||||
"sigs.k8s.io/kustomize/api/testutils/valtest"
|
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/kv"
|
"sigs.k8s.io/kustomize/api/kv"
|
||||||
"sigs.k8s.io/kustomize/api/loader"
|
"sigs.k8s.io/kustomize/api/loader"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/add"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/add"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/fix"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/fix"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/remove"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/remove"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/set"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCmdEdit returns an instance of 'edit' subcommand.
|
// NewCmdEdit returns an instance of 'edit' subcommand.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package fix
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCmdFix returns an instance of 'fix' subcommand.
|
// NewCmdFix returns an instance of 'fix' subcommand.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFix(t *testing.T) {
|
func TestFix(t *testing.T) {
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
// kindOfAdd is the kind of metadata being added: label or annotation
|
// kindOfAdd is the kind of metadata being added: label or annotation
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/testutils/valtest"
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeKustomizationFS() filesys.FileSystem {
|
func makeKustomizationFS() filesys.FileSystem {
|
||||||
@@ -147,7 +147,7 @@ func TestRemoveAnnotationInvalidFormat(t *testing.T) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("expected an error")
|
t.Errorf("expected an error")
|
||||||
}
|
}
|
||||||
if err.Error() != validators.SAD {
|
if err.Error() != valtest_test.SAD {
|
||||||
t.Errorf("incorrect error: %v", err.Error())
|
t.Errorf("incorrect error: %v", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,7 +295,7 @@ func TestRemoveLabelInvalidFormat(t *testing.T) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("expected an error")
|
t.Errorf("expected an error")
|
||||||
}
|
}
|
||||||
if err.Error() != validators.SAD {
|
if err.Error() != valtest_test.SAD {
|
||||||
t.Errorf("incorrect error: %v", err.Error())
|
t.Errorf("incorrect error: %v", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/patch"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/patch"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type removePatchOptions struct {
|
type removePatchOptions struct {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/patch"
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/edit/patch"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type removeResourceOptions struct {
|
type removeResourceOptions struct {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRemoveResources(t *testing.T) {
|
func TestRemoveResources(t *testing.T) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setNamePrefixOptions struct {
|
type setNamePrefixOptions struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setNameSuffixOptions struct {
|
type setNameSuffixOptions struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setImageOptions struct {
|
type setImageOptions struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSetImage(t *testing.T) {
|
func TestSetImage(t *testing.T) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setNamespaceOptions struct {
|
type setNamespaceOptions struct {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/testutils/valtest"
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands/kustfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setReplicasOptions struct {
|
type setReplicasOptions struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSetReplicas(t *testing.T) {
|
func TestSetReplicas(t *testing.T) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
testutils_test "sigs.k8s.io/kustomize/kustomize/internal/commands/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFieldOrder(t *testing.T) {
|
func TestFieldOrder(t *testing.T) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands"
|
"sigs.k8s.io/kustomize/kustomize/internal/commands"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ module sigs.k8s.io/kustomize/pluginator
|
|||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
require sigs.k8s.io/kustomize/api v0.0.1
|
require sigs.k8s.io/kustomize/api v0.1.1
|
||||||
|
|
||||||
replace sigs.k8s.io/kustomize/api v0.0.1 => ../api
|
|
||||||
|
|||||||
@@ -152,6 +152,8 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUc
|
|||||||
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
||||||
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
||||||
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
|
||||||
|
sigs.k8s.io/kustomize/api v0.1.1 h1:W2dWXex2MhF4/EZNokZllvet2RejCHqdAFklufN7VTg=
|
||||||
|
sigs.k8s.io/kustomize/api v0.1.1/go.mod h1:FyfJD1q1QMjC/TvK78b6cCtZB+mbpnGIo9YOvbucJes=
|
||||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
|
|||||||
@@ -132,6 +132,18 @@ module=kustomize # The kustomize executable
|
|||||||
module=api # The API
|
module=api # The API
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### review tags to help determine new tag
|
||||||
|
|
||||||
|
Local:
|
||||||
|
```
|
||||||
|
git tag -l | grep $module
|
||||||
|
```
|
||||||
|
|
||||||
|
Remote:
|
||||||
|
```
|
||||||
|
git ls-remote --tags upstream | grep $module
|
||||||
|
```
|
||||||
|
|
||||||
### determine the version
|
### determine the version
|
||||||
|
|
||||||
Go's [semver]-compatible version tags take the form `v{major}.{minor}.{patch}`:
|
Go's [semver]-compatible version tags take the form `v{major}.{minor}.{patch}`:
|
||||||
@@ -172,10 +184,17 @@ Create it:
|
|||||||
git checkout -b $branch
|
git checkout -b $branch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### define the release tag
|
||||||
|
|
||||||
### remove API replacements from go.mod
|
```
|
||||||
|
tag="${module}/v${major}.${minor}.${patch}"
|
||||||
|
echo "tag=$tag"
|
||||||
|
```
|
||||||
|
|
||||||
Only do this if releasing one of the executables.
|
### pin the executable to a particular API version
|
||||||
|
|
||||||
|
Only do this if releasing one of the
|
||||||
|
executables (kustomize or pluginator).
|
||||||
|
|
||||||
In this repository, an executable in development
|
In this repository, an executable in development
|
||||||
on the master branch typically depends on the API
|
on the master branch typically depends on the API
|
||||||
@@ -193,22 +212,12 @@ requires.
|
|||||||
```
|
```
|
||||||
# Update the following as needed, obviously.
|
# Update the following as needed, obviously.
|
||||||
|
|
||||||
if [ "$module" != "api" ]; then
|
# git checkout -b pinTheRelease
|
||||||
# go mod edit -dropreplace=sigs.k8s.io/kustomize/api $module/go.mod
|
# go mod edit -dropreplace=sigs.k8s.io/kustomize/api $module/go.mod
|
||||||
# go mod edit -require=sigs.k8s.io/kustomize/api@v?.0.1 $module/go.mod
|
# go mod edit -require=sigs.k8s.io/kustomize/api@v0.1.1 $module/go.mod
|
||||||
# git commit -a -m "Drop API module replacement"
|
# git commit -a -m "Drop API module replacement"
|
||||||
fi
|
|
||||||
```
|
|
||||||
|
|
||||||
### optionally build a release locally
|
|
||||||
|
|
||||||
Install [`cloud-build-local`], then run
|
|
||||||
|
|
||||||
```
|
```
|
||||||
./releasing/localbuild.sh $module
|
|
||||||
```
|
|
||||||
|
|
||||||
This should create release artifacts in a local directory.
|
|
||||||
|
|
||||||
### push the release branch
|
### push the release branch
|
||||||
|
|
||||||
@@ -216,26 +225,6 @@ This should create release artifacts in a local directory.
|
|||||||
git push -f upstream $branch
|
git push -f upstream $branch
|
||||||
```
|
```
|
||||||
|
|
||||||
### optionally review tags
|
|
||||||
|
|
||||||
|
|
||||||
Local:
|
|
||||||
```
|
|
||||||
git tag -l
|
|
||||||
```
|
|
||||||
|
|
||||||
Remote:
|
|
||||||
```
|
|
||||||
git ls-remote --tags upstream
|
|
||||||
```
|
|
||||||
|
|
||||||
### define the release tag
|
|
||||||
|
|
||||||
```
|
|
||||||
tag="${module}/v${major}.${minor}.${patch}"
|
|
||||||
echo "tag=$tag"
|
|
||||||
```
|
|
||||||
|
|
||||||
### if replacing a release...
|
### if replacing a release...
|
||||||
|
|
||||||
Must delete the tag before re-pushing it.
|
Must delete the tag before re-pushing it.
|
||||||
@@ -268,6 +257,16 @@ version.
|
|||||||
git tag -a $tag -m "Release $tag on branch $branch"
|
git tag -a $tag -m "Release $tag on branch $branch"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### optionally build a release locally
|
||||||
|
|
||||||
|
Install [`cloud-build-local`], then run
|
||||||
|
|
||||||
|
```
|
||||||
|
./releasing/localbuild.sh $module
|
||||||
|
```
|
||||||
|
|
||||||
|
This should create release artifacts in a local directory.
|
||||||
|
|
||||||
### trigger the cloud build by pushing the tag
|
### trigger the cloud build by pushing the tag
|
||||||
|
|
||||||
Push the tag:
|
Push the tag:
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ if [ "$module" != "$tModule" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd $module
|
||||||
|
|
||||||
configFile=$(mktemp)
|
configFile=$(mktemp)
|
||||||
cat <<EOF >$configFile
|
cat <<EOF >$configFile
|
||||||
project_name: $module
|
project_name: $module
|
||||||
@@ -48,8 +50,7 @@ release:
|
|||||||
owner: kubernetes-sigs
|
owner: kubernetes-sigs
|
||||||
name: kustomize
|
name: kustomize
|
||||||
builds:
|
builds:
|
||||||
- main: ./$module/main.go
|
- ldflags: >
|
||||||
ldflags: >
|
|
||||||
-s
|
-s
|
||||||
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
|
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
|
||||||
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
|
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
steps:
|
steps:
|
||||||
- name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9"
|
- name: "gcr.io/cloud-builders/git"
|
||||||
args: [fetch, --tags, --depth=100]
|
args: [fetch, --tags, --depth=100]
|
||||||
- name: "goreleaser/goreleaser:v0.120.3"
|
- name: "goreleaser/goreleaser:v0.120.3"
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
steps:
|
steps:
|
||||||
- name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9"
|
- name: "gcr.io/cloud-builders/git"
|
||||||
args: [fetch, --tags, --depth=100]
|
args: [fetch, --tags, --depth=100]
|
||||||
- name: "goreleaser/goreleaser:v0.120.3"
|
- name: "goreleaser/goreleaser:v0.120.3"
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
|
|||||||
@@ -79,5 +79,5 @@ cloud-build-local \
|
|||||||
echo " "
|
echo " "
|
||||||
echo "Result of local build:"
|
echo "Result of local build:"
|
||||||
echo "##########################################"
|
echo "##########################################"
|
||||||
tree ./dist
|
tree ./$module/dist
|
||||||
echo "##########################################"
|
echo "##########################################"
|
||||||
|
|||||||
Reference in New Issue
Block a user