kubernetes / ingress-gce

Ingress controller for Google Cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use the script /hack/update-codegen.sh

julienMichaud opened this issue · comments

Hi,

Im working on a PR which allow users to disable QUIC support throught the FrontendConfig CR.

Im executing the script /hack/update-codegen.sh to generate the new files but I get the error :

./hack/update-codegen.sh: line 32: ../code-generator/generate-groups.sh: No such file or directory

Can you please tell me what im doing wrong ?

Here is the attribute I added

type FrontendConfigSpec struct {
	SslPolicy       *string              `json:"sslPolicy,omitempty"`
    + QuicOverride    *string              `json:"quicOverride,omitempty"`
	RedirectToHttps *HttpsRedirectConfig `json:"redirectToHttps,omitempty"`
}

Thanks

It seems the scripts tries to find an script on the vendor folder for package k8s.io/code-generator

CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

However, it is not present there ... @swetharepakula does this ring a bell? how code-generator dependency works in this repo?

So this is a fun one, since code-generator is not in vendor anymore the script only works with the || echo ../code-generator part, i.e. you need to git clone or go install it into your gopath next to ingress-gce.

For example, if you have this repo cloned into go/src/k8s.io/ingress-gce, you need to clone k8s.io/code-generator into go/src/k8s.io/code-generator.

Additionally, you will have to install openapi-gen with go install k8s.io/kube-openapi/cmd/openapi-gen@latest if you haven't already.

thanks guys, @spencerhance I did what you said, here are the logs

Generating composite types
WARNING: No description for type: BackendService.circuitBreakers
WARNING: No description for type: BackendService.connectionDraining
WARNING: No description for type: BackendService.connectionTrackingPolicy
WARNING: No description for type: BackendService.subsetting
WARNING: No description for type: HealthCheck.http2HealthCheck
WARNING: No description for type: HealthCheck.udpHealthCheck
WARNING: No description for type: HealthCheck.httpsHealthCheck
WARNING: No description for type: HealthCheck.grpcHealthCheck
WARNING: No description for type: HealthCheck.sslHealthCheck
WARNING: No description for type: HealthCheck.tcpHealthCheck
WARNING: No description for type: HealthCheck.httpHealthCheck
WARNING: No description for type: ForwardingRule.pscConnectionStatus
WARNING: No description for type: ForwardingRule.target
WARNING: No description for type: Subsetting.policy
WARNING: No description for type: BackendServiceReference.backendService
WARNING: No description for type: ForwardingRuleReference.forwardingRule
WARNING: No description for type: HealthCheckReference.healthCheck
WARNING: No description for type: HealthCheckServiceReference.healthCheckService
WARNING: No description for type: NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter.networkEndpoint
WARNING: No description for type: OriginAuthenticationMethod.jwt
Performing code generation for BackendConfig CRD
Generating deepcopy funcs
Generating clientset for backendconfig:v1beta1 backendconfig:v1 at k8s.io/ingress-gce/pkg/backendconfig/client/clientset
Generating listers for backendconfig:v1beta1 backendconfig:v1 at k8s.io/ingress-gce/pkg/backendconfig/client/listers
Generating informers for backendconfig:v1beta1 backendconfig:v1 at k8s.io/ingress-gce/pkg/backendconfig/client/informers
Generating openapi for BackendConfig v1beta1
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1beta1,CacheKeyPolicy,QueryStringBlacklist
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1beta1,CacheKeyPolicy,QueryStringWhitelist
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1beta1,CustomRequestHeadersConfig,Headers
API rule violation: names_match,k8s.io/ingress-gce/pkg/apis/backendconfig/v1beta1,IAPConfig,OAuthClientCredentials
Generating openapi for BackendConfig v1
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CDNConfig,BypassCacheOnRequestHeaders
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CDNConfig,NegativeCachingPolicy
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CDNConfig,SignedUrlKeys
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CacheKeyPolicy,QueryStringBlacklist
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CacheKeyPolicy,QueryStringWhitelist
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CustomRequestHeadersConfig,Headers
API rule violation: list_type_missing,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,CustomResponseHeadersConfig,Headers
API rule violation: names_match,k8s.io/ingress-gce/pkg/apis/backendconfig/v1,IAPConfig,OAuthClientCredentials
Performing code generation for FrontendConfig CRD
Generating deepcopy funcs
Generating clientset for frontendconfig:v1beta1 at k8s.io/ingress-gce/pkg/frontendconfig/client/clientset
Generating listers for frontendconfig:v1beta1 at k8s.io/ingress-gce/pkg/frontendconfig/client/listers
Generating informers for frontendconfig:v1beta1 at k8s.io/ingress-gce/pkg/frontendconfig/client/informers
Generating openapi for FrontendConfig v1beta1
Performing code generation for ServiceNetworkEndpointGroup CRD
Generating deepcopy funcs
Generating clientset for svcneg:v1beta1 at k8s.io/ingress-gce/pkg/svcneg/client/clientset
Generating listers for svcneg:v1beta1 at k8s.io/ingress-gce/pkg/svcneg/client/listers
Generating informers for svcneg:v1beta1 at k8s.io/ingress-gce/pkg/svcneg/client/informers
Generating openapi for ServiceNetworkEndpointGroup v1beta1
Performing code generation for ServiceAttachment CRD
Generating deepcopy funcs
Generating clientset for serviceattachment:v1beta1,v1 at k8s.io/ingress-gce/pkg/serviceattachment/client/clientset
Generating listers for serviceattachment:v1beta1,v1 at k8s.io/ingress-gce/pkg/serviceattachment/client/listers
Generating informers for serviceattachment:v1beta1,v1 at k8s.io/ingress-gce/pkg/serviceattachment/client/informers
Generating openapi for ServiceAttachment v1beta1
Generating openapi for ServiceAttachment v1
Performing code generation for GCPIngressParams CRD
Generating deepcopy funcs
Generating listers for ingparams:v1beta1 at k8s.io/ingress-gce/pkg/ingparams/client/listers
Generating informers for ingparams:v1beta1 at k8s.io/ingress-gce/pkg/ingparams/client/informers
Generating clientset for ingparams:v1beta1 at k8s.io/ingress-gce/pkg/ingparams/client/clientset
Generating listers for ingparams:v1beta1 at k8s.io/ingress-gce/pkg/ingparams/client/listers
Generating informers for ingparams:v1beta1 at k8s.io/ingress-gce/pkg/ingparams/client/informers
Generating openapi for GCPIngressParams v1beta1

but i dont see any changes to my files, I should see a property quicOverride in the file pkg/apis/frontendconfig/v1beta1/zz_generated.openapi.go I think ?

Hm yeah you should be seeing a diff, I also tried locally and got the same result...will have to keep investigating.

Alright, I made the changes manually to the files pkg/apis/frontendconfig/v1beta1/zz_generated.deepcopy.go & pkg/apis/frontendconfig/v1beta1/zz_generated.openapi.go to be able to create a FrontendConfig with the new attribute.

The thing is that I build the container and run it with GLBC=bin/amd64/glbc hack/run-local-glbc.sh but the CRD is not being updated in my gke cluster, I dont see my attribute when doing a kubectl describe crd frontendconfigs.networking.gke.io.

Do you know why ?

/kind support

Still working on a fix for this but it appears it's an issue with how the script handles the GOPATH. If you're using gvm you can symlink the repo in your GOPATH to your source tree by running gvm linkthis k8s.io/ingress-gce from the top level of the repo.

julien@DESKTOP-KAORR54:~/ingress-gce$ gvm linkthis k8s.io/ingress-gce
'/home/julien/Go/src/k8s.io/ingress-gce' -> '/home/julien/ingress-gce'

If I run hack/update-codegen.sh after, I get

Generating composite types
WARNING: No description for type: BackendService.circuitBreakers
WARNING: No description for type: BackendService.connectionTrackingPolicy
WARNING: No description for type: BackendService.subsetting
WARNING: No description for type: BackendService.connectionDraining
WARNING: No description for type: HealthCheck.http2HealthCheck
WARNING: No description for type: HealthCheck.httpHealthCheck
WARNING: No description for type: HealthCheck.httpsHealthCheck
WARNING: No description for type: HealthCheck.sslHealthCheck
WARNING: No description for type: HealthCheck.grpcHealthCheck
WARNING: No description for type: HealthCheck.tcpHealthCheck
WARNING: No description for type: HealthCheck.udpHealthCheck
WARNING: No description for type: ForwardingRule.target
WARNING: No description for type: ForwardingRule.pscConnectionStatus
WARNING: No description for type: Subsetting.policy
WARNING: No description for type: BackendServiceReference.backendService
WARNING: No description for type: ForwardingRuleReference.forwardingRule
WARNING: No description for type: HealthCheckServiceReference.healthCheckService
WARNING: No description for type: NetworkEndpointGroupsListEndpointsRequestNetworkEndpointFilter.networkEndpoint
WARNING: No description for type: OriginAuthenticationMethod.jwt
Performing code generation for BackendConfig CRD
hack/update-codegen.sh: line 32: ../code-generator/generate-groups.sh: No such file or directory