You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by kv...@apache.org on 2022/01/11 06:41:48 UTC
[apisix-ingress-controller] branch master updated: fix: add v2beta3 register resources (#833)
This is an automated email from the ASF dual-hosted git repository.
kvn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new 3040cf5 fix: add v2beta3 register resources (#833)
3040cf5 is described below
commit 3040cf54c5dc95a444b9c3132f5b911495ad5f80
Author: Jintao Zhang <zh...@gmail.com>
AuthorDate: Tue Jan 11 14:37:17 2022 +0800
fix: add v2beta3 register resources (#833)
---
pkg/kube/apisix/apis/config/v1/register.go | 58 -----------------
.../apisix/apis/config/v1/zz_generated.register.go | 70 ++++++++++++++++++++
pkg/kube/apisix/apis/config/v2beta1/register.go | 50 --------------
.../apis/config/v2beta1/zz_generated.register.go | 66 +++++++++++++++++++
pkg/kube/apisix/apis/config/v2beta2/register.go | 50 --------------
.../apis/config/v2beta2/zz_generated.register.go | 66 +++++++++++++++++++
pkg/kube/apisix/apis/config/v2beta3/register.go | 50 --------------
.../apis/config/v2beta3/zz_generated.register.go | 76 ++++++++++++++++++++++
tools.go | 1 +
utils/generate-groups.sh | 7 +-
utils/update-codegen.sh | 7 ++
utils/verify-codegen.sh | 10 +++
12 files changed, 302 insertions(+), 209 deletions(-)
diff --git a/pkg/kube/apisix/apis/config/v1/register.go b/pkg/kube/apisix/apis/config/v1/register.go
deleted file mode 100644
index 28e502e..0000000
--- a/pkg/kube/apisix/apis/config/v1/register.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-const (
- _groupName = "apisix.apache.org"
- _version = "v1"
-)
-
-var (
- SchemeGroupVersion = schema.GroupVersion{
- Group: _groupName,
- Version: _version,
- }
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-func Kind(kind string) schema.GroupKind {
- return SchemeGroupVersion.WithKind(kind).GroupKind()
-}
-
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ApisixRoute{},
- &ApisixRouteList{},
- &ApisixUpstream{},
- &ApisixUpstreamList{},
- &ApisixTls{},
- &ApisixTlsList{},
- )
-
- // register the type in the scheme
- metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
- return nil
-}
diff --git a/pkg/kube/apisix/apis/config/v1/zz_generated.register.go b/pkg/kube/apisix/apis/config/v1/zz_generated.register.go
new file mode 100644
index 0000000..38633cc
--- /dev/null
+++ b/pkg/kube/apisix/apis/config/v1/zz_generated.register.go
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by register-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName specifies the group name used to register the objects.
+const GroupName = "apisix.apache.org"
+
+// GroupVersion specifies the group and the version used to register the objects.
+var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1"}
+
+// SchemeGroupVersion is group version used to register these objects
+// Deprecated: use GroupVersion instead.
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
+ SchemeBuilder runtime.SchemeBuilder
+ localSchemeBuilder = &SchemeBuilder
+ // Depreciated: use Install instead
+ AddToScheme = localSchemeBuilder.AddToScheme
+ Install = localSchemeBuilder.AddToScheme
+)
+
+func init() {
+ // We only register manually written functions here. The registration of the
+ // generated functions takes place in the generated files. The separation
+ // makes the code compile even when the generated files are missing.
+ localSchemeBuilder.Register(addKnownTypes)
+}
+
+// Adds the list of known types to Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &ApisixRoute{},
+ &ApisixRouteList{},
+ &ApisixTls{},
+ &ApisixTlsList{},
+ &ApisixUpstream{},
+ &ApisixUpstreamList{},
+ )
+ // AddToGroupVersion allows the serialization of client types like ListOptions.
+ v1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/pkg/kube/apisix/apis/config/v2beta1/register.go b/pkg/kube/apisix/apis/config/v2beta1/register.go
deleted file mode 100644
index 9531d6b..0000000
--- a/pkg/kube/apisix/apis/config/v2beta1/register.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package v2beta1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-const (
- _groupName = "apisix.apache.org"
- _version = "v2beta1"
-)
-
-var (
- SchemeGroupVersion = schema.GroupVersion{
- Group: _groupName,
- Version: _version,
- }
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ApisixRoute{},
- &ApisixRouteList{},
- )
-
- // register the type in the scheme
- metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
- return nil
-}
diff --git a/pkg/kube/apisix/apis/config/v2beta1/zz_generated.register.go b/pkg/kube/apisix/apis/config/v2beta1/zz_generated.register.go
new file mode 100644
index 0000000..74618f9
--- /dev/null
+++ b/pkg/kube/apisix/apis/config/v2beta1/zz_generated.register.go
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by register-gen. DO NOT EDIT.
+
+package v2beta1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName specifies the group name used to register the objects.
+const GroupName = "apisix.apache.org"
+
+// GroupVersion specifies the group and the version used to register the objects.
+var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v2beta1"}
+
+// SchemeGroupVersion is group version used to register these objects
+// Deprecated: use GroupVersion instead.
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
+ SchemeBuilder runtime.SchemeBuilder
+ localSchemeBuilder = &SchemeBuilder
+ // Depreciated: use Install instead
+ AddToScheme = localSchemeBuilder.AddToScheme
+ Install = localSchemeBuilder.AddToScheme
+)
+
+func init() {
+ // We only register manually written functions here. The registration of the
+ // generated functions takes place in the generated files. The separation
+ // makes the code compile even when the generated files are missing.
+ localSchemeBuilder.Register(addKnownTypes)
+}
+
+// Adds the list of known types to Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &ApisixRoute{},
+ &ApisixRouteList{},
+ )
+ // AddToGroupVersion allows the serialization of client types like ListOptions.
+ v1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/pkg/kube/apisix/apis/config/v2beta2/register.go b/pkg/kube/apisix/apis/config/v2beta2/register.go
deleted file mode 100644
index c0871ad..0000000
--- a/pkg/kube/apisix/apis/config/v2beta2/register.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package v2beta2
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-const (
- _groupName = "apisix.apache.org"
- _version = "v2beta2"
-)
-
-var (
- SchemeGroupVersion = schema.GroupVersion{
- Group: _groupName,
- Version: _version,
- }
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ApisixRoute{},
- &ApisixRouteList{},
- )
-
- // register the type in the scheme
- metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
- return nil
-}
diff --git a/pkg/kube/apisix/apis/config/v2beta2/zz_generated.register.go b/pkg/kube/apisix/apis/config/v2beta2/zz_generated.register.go
new file mode 100644
index 0000000..ebe82de
--- /dev/null
+++ b/pkg/kube/apisix/apis/config/v2beta2/zz_generated.register.go
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by register-gen. DO NOT EDIT.
+
+package v2beta2
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName specifies the group name used to register the objects.
+const GroupName = "apisix.apache.org"
+
+// GroupVersion specifies the group and the version used to register the objects.
+var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v2beta2"}
+
+// SchemeGroupVersion is group version used to register these objects
+// Deprecated: use GroupVersion instead.
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta2"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
+ SchemeBuilder runtime.SchemeBuilder
+ localSchemeBuilder = &SchemeBuilder
+ // Depreciated: use Install instead
+ AddToScheme = localSchemeBuilder.AddToScheme
+ Install = localSchemeBuilder.AddToScheme
+)
+
+func init() {
+ // We only register manually written functions here. The registration of the
+ // generated functions takes place in the generated files. The separation
+ // makes the code compile even when the generated files are missing.
+ localSchemeBuilder.Register(addKnownTypes)
+}
+
+// Adds the list of known types to Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &ApisixRoute{},
+ &ApisixRouteList{},
+ )
+ // AddToGroupVersion allows the serialization of client types like ListOptions.
+ v1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/pkg/kube/apisix/apis/config/v2beta3/register.go b/pkg/kube/apisix/apis/config/v2beta3/register.go
deleted file mode 100644
index 00b1c18..0000000
--- a/pkg/kube/apisix/apis/config/v2beta3/register.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package v2beta3
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-const (
- _groupName = "apisix.apache.org"
- _version = "v2beta3"
-)
-
-var (
- SchemeGroupVersion = schema.GroupVersion{
- Group: _groupName,
- Version: _version,
- }
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ApisixRoute{},
- &ApisixRouteList{},
- )
-
- // register the type in the scheme
- metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
- return nil
-}
diff --git a/pkg/kube/apisix/apis/config/v2beta3/zz_generated.register.go b/pkg/kube/apisix/apis/config/v2beta3/zz_generated.register.go
new file mode 100644
index 0000000..71440e7
--- /dev/null
+++ b/pkg/kube/apisix/apis/config/v2beta3/zz_generated.register.go
@@ -0,0 +1,76 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by register-gen. DO NOT EDIT.
+
+package v2beta3
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName specifies the group name used to register the objects.
+const GroupName = "apisix.apache.org"
+
+// GroupVersion specifies the group and the version used to register the objects.
+var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v2beta3"}
+
+// SchemeGroupVersion is group version used to register these objects
+// Deprecated: use GroupVersion instead.
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta3"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
+ SchemeBuilder runtime.SchemeBuilder
+ localSchemeBuilder = &SchemeBuilder
+ // Depreciated: use Install instead
+ AddToScheme = localSchemeBuilder.AddToScheme
+ Install = localSchemeBuilder.AddToScheme
+)
+
+func init() {
+ // We only register manually written functions here. The registration of the
+ // generated functions takes place in the generated files. The separation
+ // makes the code compile even when the generated files are missing.
+ localSchemeBuilder.Register(addKnownTypes)
+}
+
+// Adds the list of known types to Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &ApisixClusterConfig{},
+ &ApisixClusterConfigList{},
+ &ApisixConsumer{},
+ &ApisixConsumerList{},
+ &ApisixPluginConfig{},
+ &ApisixPluginConfigList{},
+ &ApisixRoute{},
+ &ApisixRouteList{},
+ &ApisixTls{},
+ &ApisixTlsList{},
+ &ApisixUpstream{},
+ &ApisixUpstreamList{},
+ )
+ // AddToGroupVersion allows the serialization of client types like ListOptions.
+ v1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/tools.go b/tools.go
index f9e2de6..3fd0664 100644
--- a/tools.go
+++ b/tools.go
@@ -24,4 +24,5 @@ import (
_ "k8s.io/code-generator/cmd/deepcopy-gen"
_ "k8s.io/code-generator/cmd/informer-gen"
_ "k8s.io/code-generator/cmd/lister-gen"
+ _ "k8s.io/code-generator/cmd/register-gen"
)
diff --git a/utils/generate-groups.sh b/utils/generate-groups.sh
index b5d66e3..0736719 100755
--- a/utils/generate-groups.sh
+++ b/utils/generate-groups.sh
@@ -49,7 +49,7 @@ shift 4
# To support running this script from anywhere, we have to first cd into this directory
# so we can install the tools.
cd "$(dirname "${0}")"
- go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
+ go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,register-gen}
)
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)"
@@ -92,3 +92,8 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
--output-package "${OUTPUT_PKG}/informers" \
"$@"
fi
+
+if [ "${GENS}" = "all" ] || grep -qw "register" <<<"${GENS}"; then
+ echo "Generating register for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}"
+ "${gobin}/register-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}" "$@"
+fi
diff --git a/utils/update-codegen.sh b/utils/update-codegen.sh
index c265f3b..1a5137d 100755
--- a/utils/update-codegen.sh
+++ b/utils/update-codegen.sh
@@ -43,5 +43,12 @@ bash "${SCRIPT_ROOT}"/generate-groups.sh "deepcopy" \
--go-header-file "${SCRIPT_ROOT}"/boilerplate.go.txt \
"$@"
+bash "${SCRIPT_ROOT}"/generate-groups.sh "register" \
+ ${PKG_NAME}/pkg/kube/apisix/apis ${PKG_NAME}/pkg/kube/apisix/apis \
+ config:v2beta3,v2beta2,v2beta1,v1 ${PKG_NAME} \
+ --output-base "$GENERATED_ROOT" \
+ --go-header-file "${SCRIPT_ROOT}"/boilerplate.go.txt \
+ "$@"
+
cp -r "$GENERATED_ROOT/${PKG_NAME}/"** "$PROJECT_ROOT"
rm -rf "$GENERATED_ROOT"
diff --git a/utils/verify-codegen.sh b/utils/verify-codegen.sh
index e8a4538..8c36dac 100755
--- a/utils/verify-codegen.sh
+++ b/utils/verify-codegen.sh
@@ -33,6 +33,7 @@ trap 'rm -rf "$GENERATED_ROOT"' EXIT
# Prepare existed codes
mkdir -p "${GENERATED_ROOT}/${PKG_NAME}/pkg/kube/apisix"
cp -r "${PROJECT_ROOT}/pkg/kube/apisix/client" "${GENERATED_ROOT}/${PKG_NAME}/pkg/kube/apisix"
+cp -r "${PROJECT_ROOT}/pkg/kube/apisix/apis" "${GENERATED_ROOT}/${PKG_NAME}/pkg/kube/apisix"
cp_deepcopy() {
local SRC_PATH="$1"
@@ -65,6 +66,15 @@ bash "${SCRIPT_ROOT}"/generate-groups.sh "deepcopy" \
fi
if [[ $ret -eq 0 ]]; then
+bash "${SCRIPT_ROOT}"/generate-groups.sh "register" \
+ ${PKG_NAME}/pkg/kube/apisix/apis ${PKG_NAME}/pkg/kube/apisix/apis \
+ config:v2beta3,v2beta2,v2beta1,v1 ${PKG_NAME} \
+ --output-base "$GENERATED_ROOT" \
+ --go-header-file "${SCRIPT_ROOT}"/boilerplate.go.txt \
+ --verify-only|| ret=$?
+fi
+
+if [[ $ret -eq 0 ]]; then
echo "Generated codes up to date."
else
echo "Generated codes out of date. Please run \`make codegen\`"