Permalink
Browse files

change import path to use vanity URL sigs.k8s.io

  • Loading branch information...
mengqiy committed Oct 10, 2018
1 parent 0dee064 commit 82279628bf0d12c8b3bed032e555e6b79ef955d1
@@ -10,7 +10,7 @@ go:
git:
depth: 3
go_import_path: github.com/kubernetes-sigs/kubebuilder
go_import_path: sigs.k8s.io/kubebuilder
before_install:
- go get -u github.com/golang/dep/cmd/dep
@@ -18,7 +18,7 @@ load("@io_bazel_rules_go//go:def.bzl", "gazelle")
gazelle(
name = "gazelle",
command = "fix",
prefix = "github.com/kubernetes-sigs/kubebuilder",
prefix = "sigs.k8s.io/kubebuilder",
external = "vendored",
args = [
"-build_file_name",
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/kubernetes-sigs/kubebuilder.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/kubebuilder "Travis")
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes-sigs/kubebuilder)](https://goreportcard.com/report/github.com/kubernetes-sigs/kubebuilder)
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/kubebuilder)](https://goreportcard.com/report/sigs.k8s.io/kubebuilder)
## Kubebuilder
@@ -3,7 +3,7 @@
builds:
- main: ./cmd/kubebuilder
binary: kubebuilder
ldflags: -s -X github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version.kubeBuilderVersion={{.Version}} -X github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version.gitCommit={{.Commit}} -X github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version.buildDate={{.Date}} -X github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version.kubernetesVendorVersion={{.Env.KUBERNETES_VERSION}}
ldflags: -s -X sigs.k8s.io/kubebuilder/cmd/kubebuilder/version.kubeBuilderVersion={{.Version}} -X sigs.k8s.io/kubebuilder/cmd/kubebuilder/version.gitCommit={{.Commit}} -X sigs.k8s.io/kubebuilder/cmd/kubebuilder/version.buildDate={{.Date}} -X sigs.k8s.io/kubebuilder/cmd/kubebuilder/version.kubernetesVendorVersion={{.Env.KUBERNETES_VERSION}}
goos:
- darwin
- linux
@@ -22,10 +22,10 @@ set -x
# - Use /go as the default GOPATH because this is what the image uses
# - Link our current directory (containing the source code) to the package location in the GOPATH
OWNER="kubernetes-sigs"
OWNER="sigs.k8s.io"
REPO="kubebuilder"
GO_PKG_OWNER=$GOPATH/src/github.com/$OWNER
GO_PKG_OWNER=$GOPATH/src/$OWNER
GO_PKG_PATH=$GO_PKG_OWNER/$REPO
mkdir -p $GO_PKG_OWNER
@@ -19,8 +19,8 @@ cp -r /workspace/_output/kubebuilder /tmp/kubebuilder/
if [ $GOOS = "linux" ]; then
export GOPATH=/go
mkdir -p $GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test/
cd $GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test/
mkdir -p $GOPATH/src/sigs.k8s.io/kubebuilder-test/
cd $GOPATH/src/sigs.k8s.io/kubebuilder-test/
# Setup env vars
export PATH=$PATH:/tmp/kubebuilder/bin/
@@ -22,9 +22,9 @@ import (
"path/filepath"
"strings"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/gengo/types"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type genUnversionedType struct {
@@ -20,10 +20,11 @@ import (
"log"
"strings"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/gengo/types"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
// resourceTags contains the tags present in a "+resource=" comment
@@ -21,9 +21,10 @@ import (
"log"
"strings"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"github.com/pkg/errors"
"k8s.io/gengo/types"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
// parseIndex indexes all types with the comment "// +resource=RESOURCE" by GroupVersionKind and
@@ -26,15 +26,16 @@ import (
"strings"
"github.com/golang/glog"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"github.com/markbates/inflect"
"github.com/pkg/errors"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/gengo/args"
"k8s.io/gengo/generator"
"k8s.io/gengo/types"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type APIs struct {
@@ -17,8 +17,8 @@ limitations under the License.
package codegen
import (
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
// ResourceGenerator provides a code generator that takes a package of an API GroupVersion
@@ -18,11 +18,12 @@ package run
import (
"github.com/golang/glog"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen/parse"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder-gen/codegen"
"github.com/spf13/pflag"
"k8s.io/gengo/args"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen/parse"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder-gen/codegen"
)
// CodeGenerator generates code for Kubernetes resources and controllers
@@ -17,8 +17,8 @@ limitations under the License.
package controllergen
import (
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type Generator struct{}
@@ -17,15 +17,16 @@ limitations under the License.
package controllergen
import (
"fmt"
"io"
"path"
"strings"
"text/template"
"fmt"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"github.com/markbates/inflect"
"k8s.io/gengo/generator"
"path"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type injectGenerator struct {
@@ -43,7 +44,7 @@ func (d *injectGenerator) Imports(c *generator.Context) []string {
repo := d.Controllers[0].Repo
im := []string{
"github.com/kubernetes-sigs/kubebuilder/pkg/controller",
"sigs.k8s.io/kubebuilder/pkg/controller",
"k8s.io/client-go/rest",
repo + "/pkg/controller/sharedinformers",
repo + "/pkg/client/informers/externalversions",
@@ -52,12 +53,12 @@ func (d *injectGenerator) Imports(c *generator.Context) []string {
}
if len(d.APIS.Groups) > 0 {
im = append(im, []string{
"time",
"k8s.io/client-go/kubernetes/scheme",
"rscheme " + "\"" + repo + "/pkg/client/clientset/versioned/scheme\""}...
)
}
im = append(im, []string{
"time",
"k8s.io/client-go/kubernetes/scheme",
"rscheme " + "\"" + repo + "/pkg/client/clientset/versioned/scheme\""}...,
)
}
// Import package for each controller
repos := map[string]string{}
for _, c := range d.Controllers {
@@ -22,8 +22,8 @@ import (
"fmt"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type apiGenerator struct {
@@ -37,7 +37,7 @@ func (d *apiGenerator) Imports(c *generator.Context) []string {
imports := []string{
"k8s.io/apimachinery/pkg/runtime/schema",
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1",
"github.com/kubernetes-sigs/kubebuilder/pkg/builders",
"sigs.k8s.io/kubebuilder/pkg/builders",
"rbacv1 \"k8s.io/api/rbac/v1\"",
}
for _, group := range d.apis.Groups {
@@ -17,8 +17,8 @@ limitations under the License.
package resourcegen
import (
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type Generator struct{}
@@ -21,8 +21,8 @@ import (
"path"
"text/template"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type installGenerator struct {
@@ -20,9 +20,9 @@ import (
"io"
"text/template"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type unversionedGenerator struct {
@@ -20,8 +20,8 @@ import (
"io"
"text/template"
"github.com/kubernetes-sigs/kubebuilder/cmd/internal/codegen"
"k8s.io/gengo/generator"
"sigs.k8s.io/kubebuilder/cmd/internal/codegen"
)
type versionedGenerator struct {
@@ -18,10 +18,10 @@ package main
import (
"github.com/golang/glog"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder-gen/codegen/run"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder-gen/internal/controllergen"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder-gen/internal/resourcegen"
"k8s.io/apiserver/pkg/util/logs"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder-gen/codegen/run"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder-gen/internal/controllergen"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder-gen/internal/resourcegen"
)
func main() {
@@ -25,13 +25,14 @@ import (
"path/filepath"
"strings"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/util"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"sigs.k8s.io/controller-tools/pkg/scaffold"
"sigs.k8s.io/controller-tools/pkg/scaffold/controller"
"sigs.k8s.io/controller-tools/pkg/scaffold/input"
"sigs.k8s.io/controller-tools/pkg/scaffold/resource"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder/util"
)
type apiOptions struct {
@@ -26,13 +26,14 @@ import (
"strings"
"github.com/Masterminds/semver"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/util"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"sigs.k8s.io/controller-tools/pkg/scaffold"
"sigs.k8s.io/controller-tools/pkg/scaffold/input"
"sigs.k8s.io/controller-tools/pkg/scaffold/manager"
"sigs.k8s.io/controller-tools/pkg/scaffold/project"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder/util"
)
func newInitProjectCmd() *cobra.Command {
@@ -23,9 +23,10 @@ import (
"path/filepath"
"strings"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/util"
"github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version"
"github.com/spf13/cobra"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder/util"
"sigs.k8s.io/kubebuilder/cmd/kubebuilder/version"
)
func main() {
@@ -124,15 +124,15 @@ function build_kb {
opts=""
else
# TODO: what does this thing do.
opts=-ldflags "-X github.com/kubernetes-sigs/kubebuilder/cmd/kubebuilder/version.kubeBuilderVersion=$INJECT_KB_VERSION"
opts=-ldflags "-X sigs.k8s.io/kubebuilder/cmd/kubebuilder/version.kubeBuilderVersion=$INJECT_KB_VERSION"
fi
go build $opts -o $tmp_root/kubebuilder/bin/kubebuilder ./cmd/kubebuilder
go build $opts -o $tmp_root/kubebuilder/bin/kubebuilder-gen ./cmd/kubebuilder-gen
}
function prepare_testdir_under_gopath {
kb_test_dir=$GOPATH/src/github.com/kubernetes-sigs/kubebuilder-test
kb_test_dir=$GOPATH/src/sigs.k8s.io/kubebuilder-test
header_text "preparing test directory $kb_test_dir"
rm -rf "$kb_test_dir" && mkdir -p "$kb_test_dir" && cd "$kb_test_dir"
header_text "running kubebuilder commands in test directory $kb_test_dir"
@@ -61,7 +61,7 @@ Example:
- See the [controller libraries](https://godoc.org/sigs.k8s.io/controller-runtime/pkg) godocs for reference
documentation on the controller libraries.
- See the [controller code generation tags](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/controller)
- See the [controller code generation tags](https://godoc.org/sigs.k8s.io/kubebuilder/pkg/gen/controller)
godocs for reference documentation on controller annotations.
@@ -27,7 +27,7 @@ ContainerSet has 4 fields:
#### Reference
- See the [resource code generation tags](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/apis)
- See the [resource code generation tags](https://godoc.org/sigs.k8s.io/kubebuilder/pkg/gen/apis)
godocs for reference documentation on resource annotations.
{% sample lang="go" %}
@@ -107,7 +107,7 @@ While users don't directly modify generated code, the code must be regenerated a
modified by adding or removing fields. This is automatically done when running `make`.
Code generation may be configured for resources using annotations of the form `// +something`.
See the [pkg/gen](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/) reference documentation.
See the [pkg/gen](https://godoc.org/sigs.k8s.io/kubebuilder/pkg/gen/) reference documentation.
{% endpanel %}
{% method %}
@@ -3,7 +3,7 @@
This chapter describes how to use the controller package functions to configure Controllers to watch
Resources.
[Link to reference documentation](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/controller)
[Link to reference documentation](https://godoc.org/sigs.k8s.io/controller-runtime)
{% method %}
## Watching Controller Resource
@@ -3,11 +3,9 @@
## Controller libraries
- [controller libraries](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/controller)
- [config libraries](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/config)
- [signals libraries](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/signals)
- [controller libraries](https://godoc.org/sigs.k8s.io/controller-runtime/pkg)
## Code generation tags
- [resource code generation tags](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/apis)
- [controller code generation tags](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/controller)
- [resource code generation tags](https://godoc.org/sigs.k8s.io/kubebuilder/pkg/gen/apis)
- [controller code generation tags](https://godoc.org/sigs.k8s.io/kubebuilder/pkg/gen/controller)
Oops, something went wrong.

0 comments on commit 8227962

Please sign in to comment.