Skip to content

Commit

Permalink
pkg/apis/core: fix code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Nov 9, 2017
1 parent 33b20f2 commit 7e62297
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/root/Makefile.generated_files
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ CONVERSION_DIRS := $(shell \
)

CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS))
CONVERSION_EXTRA_PEER_DIRS := k8s.io/kubernetes/pkg/api,k8s.io/kubernetes/pkg/api/v1,k8s.io/api/core/v1
CONVERSION_EXTRA_PEER_DIRS := k8s.io/kubernetes/pkg/apis/core,k8s.io/kubernetes/pkg/apis/core/v1,k8s.io/api/core/v1

# Shell function for reuse in rules.
RUN_GEN_CONVERSION = \
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ kube::util::group-version-to-pkg-path() {
case "${group_version}" in
# both group and version are "", this occurs when we generate deep copies for internal objects of the legacy v1 API.
__internal)
echo "pkg/api"
echo "pkg/apis/core"
;;
meta/v1)
echo "vendor/k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 0 additions & 2 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ ${clientgen} "$@"
${clientgen} --output-base "${KUBE_ROOT}/vendor" --clientset-path="k8s.io/client-go" --clientset-name="kubernetes" --input-base="k8s.io/kubernetes/vendor/k8s.io/api" --input="${GV_DIRS_CSV}" "$@"

listergen_internal_apis=(
pkg/api
$(
cd ${KUBE_ROOT}
find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort
Expand All @@ -84,7 +83,6 @@ listergen_external_apis_csv=$(IFS=,; echo "${listergen_external_apis[*]}")
${listergen} --output-base "${KUBE_ROOT}/vendor" --output-package "k8s.io/client-go/listers" --input-dirs "${listergen_external_apis_csv}" "$@"

informergen_internal_apis=(
pkg/api
$(
cd ${KUBE_ROOT}
find pkg/apis -maxdepth 2 -name types.go | xargs -n1 dirname | sort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func parsePathGroupVersion(pgvString string) (gvPath string, gvString string) {
func groupVersionPath(gvPath string, group string, version string) (path string) {
// special case for the core group
if group == "api" {
path = filepath.Join("../api", version)
path = filepath.Join("core", version)
} else {
path = filepath.Join(gvPath, group, version)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func TestGVPackageFlag(t *testing.T) {
{
args: []string{"api/v1", "api"},
expected: map[types.GroupVersion]string{
{Group: "api", Version: "v1"}: "../api/v1",
{Group: "api", Version: ""}: "../api",
{Group: "api", Version: "v1"}: "core/v1",
{Group: "api", Version: ""}: "core",
},
expectedGroups: []types.GroupVersions{
{PackageName: "core", Group: types.Group("api"), Versions: []types.Version{types.Version("v1"), types.Version("")}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package generators
import "k8s.io/gengo/types"

var (
apiScheme = types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "Scheme"}
apiScheme = types.Name{Package: "k8s.io/kubernetes/pkg/api/legacyscheme", Name: "Scheme"}
cacheGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "GenericLister"}
cacheIndexers = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "Indexers"}
cacheListWatch = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "ListWatch"}
Expand All @@ -28,7 +28,7 @@ var (
cacheNewGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewGenericLister"}
cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"}
cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"}
listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ListOptions"}
listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"}
reflectType = types.Name{Package: "reflect", Name: "Type"}
runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"}
schemaGroupResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupResource"}
Expand Down

0 comments on commit 7e62297

Please sign in to comment.