mirror of https://github.com/k3s-io/k3s
pkg/apis/core: fix code generation
parent
33b20f22ee
commit
7e62297b68
|
@ -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 = \
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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("")}},
|
||||
|
|
|
@ -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"}
|
||||
|
@ -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"}
|
||||
|
|
Loading…
Reference in New Issue