Skip to content

Commit

Permalink
change import path to use vanity URL sigs.k8s.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed Oct 10, 2018
1 parent 0dee064 commit 8227962
Show file tree
Hide file tree
Showing 34 changed files with 70 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build/build_kubebuilder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/codegen/parse/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion cmd/internal/codegen/parse/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cmd/internal/codegen/parse/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cmd/internal/codegen/parse/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubebuilder-gen/codegen/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubebuilder-gen/codegen/run/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubebuilder-gen/internal/controllergen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
21 changes: 11 additions & 10 deletions cmd/kubebuilder-gen/internal/controllergen/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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",
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubebuilder-gen/internal/resourcegen/apis_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubebuilder-gen/internal/resourcegen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubebuilder-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubebuilder/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubebuilder/init_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubebuilder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docs/book/basics/simple_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
4 changes: 2 additions & 2 deletions docs/book/basics/simple_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion docs/book/beyond_basics/controller_watches.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions docs/book/go_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading

0 comments on commit 8227962

Please sign in to comment.