Skip to content

Commit

Permalink
Merge pull request #2007 from camilamacedo86/v2intorelease-2
Browse files Browse the repository at this point in the history
:seeding: rebase v2 into release-2
  • Loading branch information
k8s-ci-robot authored Feb 16, 2021
2 parents 8b53abe + 1c598b4 commit 5da27b8
Show file tree
Hide file tree
Showing 249 changed files with 308 additions and 305 deletions.
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
builds:
- main: ./cmd
binary: kubebuilder
ldflags: -s -X sigs.k8s.io/kubebuilder/cmd/version.kubeBuilderVersion={{.Version}} -X sigs.k8s.io/kubebuilder/cmd/version.gitCommit={{.Commit}} -X sigs.k8s.io/kubebuilder/cmd/version.buildDate={{.Date}} -X sigs.k8s.io/kubebuilder/cmd/version.kubernetesVendorVersion={{.Env.KUBERNETES_VERSION}}
ldflags: -s -X sigs.k8s.io/kubebuilder/v2/cmd/version.kubeBuilderVersion={{.Version}} -X sigs.k8s.io/kubebuilder/v2/cmd/version.gitCommit={{.Commit}} -X sigs.k8s.io/kubebuilder/v2/cmd/version.buildDate={{.Date}} -X sigs.k8s.io/kubebuilder/v2/cmd/version.kubernetesVendorVersion={{.Env.KUBERNETES_VERSION}}
goos:
- darwin
- linux
Expand Down
12 changes: 6 additions & 6 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import (
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

"sigs.k8s.io/kubebuilder/cmd/internal"
"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/plugins/addon"
"sigs.k8s.io/kubebuilder/v2/cmd/internal"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/plugins/addon"
)

type apiError struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/spf13/cobra"

"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
)

type editError struct {
Expand Down
6 changes: 3 additions & 3 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

"sigs.k8s.io/kubebuilder/cmd/internal"
"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/cmd/internal"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
)

type initError struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"log"
"os"

"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/v2/internal/config"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

"github.com/spf13/cobra"

"sigs.k8s.io/kubebuilder/cmd/internal"
"sigs.k8s.io/kubebuilder/cmd/version"
"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/cmd/internal"
"sigs.k8s.io/kubebuilder/v2/cmd/version"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
)

// commandOptions represent the types used to implement the different commands
Expand Down
4 changes: 2 additions & 2 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/spf13/cobra"

"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
)

type updateError struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (

"github.com/spf13/cobra"

"sigs.k8s.io/kubebuilder/cmd/internal"
"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/pkg/scaffold"
"sigs.k8s.io/kubebuilder/v2/cmd/internal"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold"
)

type webhookError struct {
Expand Down
2 changes: 1 addition & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function build_kb {
opts=""
else
# TODO: what does this thing do.
opts=-ldflags "-X sigs.k8s.io/kubebuilder/cmd/version.kubeBuilderVersion=$INJECT_KB_VERSION"
opts=-ldflags "-X sigs.k8s.io/kubebuilder/v2/cmd/version.kubeBuilderVersion=$INJECT_KB_VERSION"
fi

GO111MODULE=on go build $opts -o $tmp_root/kubebuilder/bin/kubebuilder ./cmd
Expand Down
5 changes: 4 additions & 1 deletion generate_testdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -e
source common.sh

build_kb() {
go build -o ./bin/kubebuilder sigs.k8s.io/kubebuilder/cmd
go build -o ./bin/kubebuilder sigs.k8s.io/kubebuilder/v2/cmd
}


Expand Down Expand Up @@ -103,6 +103,9 @@ scaffold_test_project() {
header_text 'initializing project-v2-addon ...'
$kb init --project-version $version --domain testproject.org --license apache2 --owner "The Kubernetes authors"

# pin the version of the declarative pattern to make tests pass
go get sigs.k8s.io/kubebuilder-declarative-pattern@v0.0.0-20200317144824-bbf1fb2a4a9a

header_text 'enableling --pattern flag ...'
export KUBEBUILDER_ENABLE_PLUGINS=1
header_text 'Creating APIs ...'
Expand Down
2 changes: 1 addition & 1 deletion generate_vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi

build_kb() {
rm -f /tmp/kb && \
GO111MODULE=on go build -o /tmp/kb sigs.k8s.io/kubebuilder/cmd
GO111MODULE=on go build -o /tmp/kb sigs.k8s.io/kubebuilder/v2/cmd
}


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module sigs.k8s.io/kubebuilder
module sigs.k8s.io/kubebuilder/v2

go 1.13

Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"io/ioutil"
"os"

"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model/config"
"sigs.k8s.io/yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/model/file/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package file
import (
"text/template"

"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
)

// Builder defines the basic methods that any file builder must implement
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/file/mixins.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package file

import (
"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
)

// PathMixin provides file builders with a path field
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/resource/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/gobuffalo/flect"

"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/resource/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"

. "sigs.k8s.io/kubebuilder/pkg/model/resource"
. "sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
)

var _ = Describe("Resource Options", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"strings"

"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model/config"
)

// Resource contains the information required to scaffold files for a resource.
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/resource/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/pkg/model/config"
. "sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/model/config"
. "sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
)

var _ = Describe("Resource", func() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/model/universe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package model

import (
"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/model/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
)

// Universe describes the entire state of file generation
Expand Down
18 changes: 9 additions & 9 deletions pkg/scaffold/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ package scaffold
import (
"fmt"

"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/model/resource"
"sigs.k8s.io/kubebuilder/pkg/scaffold/internal/machinery"
controllerv1 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v1/controller"
crdv1 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v1/crd"
templatesv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2"
controllerv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/controller"
crdv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/crd"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model"
"sigs.k8s.io/kubebuilder/v2/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/machinery"
controllerv1 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v1/controller"
crdv1 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v1/crd"
templatesv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2"
controllerv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/controller"
crdv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/crd"
)

var _ Scaffolder = &apiScaffolder{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package scaffold

import (
"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/v2/internal/config"
)

var _ Scaffolder = &editScaffolder{}
Expand Down
24 changes: 12 additions & 12 deletions pkg/scaffold/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import (
"io/ioutil"
"path/filepath"

"sigs.k8s.io/kubebuilder/internal/config"
"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/scaffold/internal/machinery"
templatesv1 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v1"
managerv1 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v1/manager"
metricsauthv1 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v1/metricsauth"
templatesv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2"
certmanagerv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/certmanager"
managerv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/manager"
metricsauthv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/metricsauth"
prometheusv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/prometheus"
webhookv2 "sigs.k8s.io/kubebuilder/pkg/scaffold/internal/templates/v2/webhook"
"sigs.k8s.io/kubebuilder/v2/internal/config"
"sigs.k8s.io/kubebuilder/v2/pkg/model"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/machinery"
templatesv1 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v1"
managerv1 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v1/manager"
metricsauthv1 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v1/metricsauth"
templatesv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2"
certmanagerv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/certmanager"
managerv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/manager"
metricsauthv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/metricsauth"
prometheusv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/prometheus"
webhookv2 "sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/templates/v2/webhook"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/scaffold/internal/machinery/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (

"golang.org/x/tools/imports"

"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/pkg/scaffold/internal/filesystem"
"sigs.k8s.io/kubebuilder/v2/pkg/model"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/filesystem"
)

var options = imports.Options{
Expand Down
6 changes: 3 additions & 3 deletions pkg/scaffold/internal/machinery/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"

"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/pkg/scaffold/internal/filesystem"
"sigs.k8s.io/kubebuilder/v2/pkg/model"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/scaffold/internal/filesystem"
)

func TestScaffold(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/authproxyrole.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &AuthProxyRole{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/authproxyrolebinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &AuthProxyRoleBinding{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/authproxyservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &AuthProxyService{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/boilerplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"path/filepath"
"time"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &Boilerplate{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/controller/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &AddController{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &Controller{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &SuiteTest{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &Test{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/internal/templates/v1/crd/addtoscheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package crd
import (
"path/filepath"

"sigs.k8s.io/kubebuilder/pkg/model/file"
"sigs.k8s.io/kubebuilder/v2/pkg/model/file"
)

var _ file.Template = &AddToScheme{}
Expand Down
Loading

0 comments on commit 5da27b8

Please sign in to comment.