kubernetes-sigs / apiserver-builder-alpha

apiserver-builder-alpha implements libraries and tools to quickly and easily build Kubernetes apiservers/controllers to support custom resource types based on APIServer Aggregation
Apache License 2.0
787 stars 235 forks source link

apiserver-boot does not call code generator automatically? #601

Closed BenjaminHuang closed 3 years ago

BenjaminHuang commented 3 years ago

The version I'm using:

Version: version.Version{ApiserverBuilderVersion:"v2.0.0-beta.0", KubernetesVendor:"kubernetes-1.19.2", GitCommit:"v2.0.0-beta.0", BuildDate:"2021-04-19-15:07:43", GoOs:"linux", GoArch:"amd64"}

After I ran create sub command and scaffolded the project, I tried to run apiserver-boot build generated, but this sub command no longer exists. So, I ran apiserver-boot build executables. Unfortunately, I got below issue. Should I place the code generator in PATH before hand?

pkg/apis/shardedservice/v1alpha1/register.go:37:5: cannot use &ShardedDeployment{} (type *ShardedDeployment) as type runtime.Object in argument to scheme.AddKnownTypes:
        *ShardedDeployment does not implement runtime.Object (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/register.go:37:27: cannot use &ShardedDeploymentList{} (type *ShardedDeploymentList) as type runtime.Object in argument to scheme.AddKnownTypes:
        *ShardedDeploymentList does not implement runtime.Object (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:57:5: cannot use &ShardedDeployment{} (type *ShardedDeployment) as type "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".Object in assignment:
        *ShardedDeployment does not implement "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".Object (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:69:9: cannot use &ShardedDeployment{} (type *ShardedDeployment) as type runtime.Object in return argument:
        *ShardedDeployment does not implement runtime.Object (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:73:9: cannot use &ShardedDeploymentList{} (type *ShardedDeploymentList) as type runtime.Object in return argument:
        *ShardedDeploymentList does not implement runtime.Object (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:93:5: cannot use &ShardedDeploymentList{} (type *ShardedDeploymentList) as type "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".ObjectList in assignment:
        *ShardedDeploymentList does not implement "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".ObjectList (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:107:5: cannot use &ShardedDeployment{} (type *ShardedDeployment) as type "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".ObjectWithStatusSubResource in assignment:
        *ShardedDeployment does not implement "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".ObjectWithStatusSubResource (missing DeepCopyObject method)
pkg/apis/shardedservice/v1alpha1/shardeddeployment_types.go:117:8: impossible type assertion:
        *ShardedDeployment does not implement "sigs.k8s.io/apiserver-runtime/pkg/builder/resource".ObjectWithStatusSubResource (missing DeepCopyObject method)
F0823 21:15:01.781709   30428 build_executables.go:195] exit status 2
BenjaminHuang commented 3 years ago

same as #594