Skip to content

Commit

Permalink
chore(generators): make file naming uniform zz_generated.*
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Nov 25, 2024
1 parent 21ee92b commit 6139831
Show file tree
Hide file tree
Showing 21 changed files with 11 additions and 757 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ generate.gateway-api-urls:
CRDS_EXPERIMENTAL_URL="$(GATEWAY_API_CRDS_EXPERIMENTAL_URL)" \
RAW_REPO_URL="$(GATEWAY_API_RAW_REPO_URL)" \
INPUT=$(shell pwd)/internal/utils/cmd/generate-gateway-api-urls/gateway_consts.tmpl \
OUTPUT=$(shell pwd)/pkg/utils/test/zz_generated_gateway_api.go \
OUTPUT=$(shell pwd)/pkg/utils/test/zz_generated.gateway_api.go \
go generate -tags=generate_gateway_api_urls ./internal/utils/cmd/generate-gateway-api-urls

.PHONY: go-mod-download-gateway-api
Expand Down
6 changes: 3 additions & 3 deletions hack/generators/kic/role-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ var clusterRoleRelativePaths = []string{

const (
controllerRBACPath = "./pkg/utils/kubernetes/resources/clusterroles/"
controllerRBACFilePrefix = "zz_generated_kong_ingress_controller_rbac"
controllerRBACFilePrefix = "zz_generated.kong_ingress_controller_rbac"

kicRBACPath = "./pkg/utils/kubernetes/resources/clusterroles"
kicRBACFIlePrefix = "zz_generated_controlplane_clusterrole"
kicRBACFIlePrefix = "zz_generated.controlplane_clusterrole"

kicRBACHelperFileName = "./pkg/utils/kubernetes/resources/zz_generated_clusterrole_helpers.go"
kicRBACHelperFileName = "./pkg/utils/kubernetes/resources/zz_generated.clusterrole_helpers.go"

docFileName = controllerRBACPath + "doc.go"
)
Expand Down
4 changes: 2 additions & 2 deletions hack/generators/kic/role-generator/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const (
// Controller) ClusterRoles.
//
// It contains 2 types of files:
// - zz_generated_kong_ingress_controller_rbac_*.go: contains kubebuilder code
// - zz_generated.kong_ingress_controller_rbac_*.go: contains kubebuilder code
// markers for Kong Ingress Controller's ClusterRoles. Those are retrieved from
// Kong Ingress Controller's repository for each supported version.
// - zz_generated_controlplane_clusterrole_*.go: contains the generated Go code with
// - zz_generated.controlplane_clusterrole_*.go: contains the generated Go code with
// ClusterRoles for each supported version of Kong Ingress Controller.
//
package clusterroles
Expand Down
4 changes: 2 additions & 2 deletions hack/generators/kic/webhook-config-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
const (
validatingWebhookConfigurationPath = "config/webhook/manifests.yaml"
validatingWebhookConfigurationKustomizeURL = "https://github.com/kong/kubernetes-ingress-controller/config/webhook"
validatingWebhookConfigurationGeneratorForVersionOutputPath = "pkg/utils/kubernetes/resources/validatingwebhookconfig/zz_generated_kic_%s.go"
validatingWebhookConfigurationGeneratorMasterOutputPath = "pkg/utils/kubernetes/resources/zz_generated_kic_validatingwebhookconfig.go"
validatingWebhookConfigurationGeneratorForVersionOutputPath = "pkg/utils/kubernetes/resources/validatingwebhookconfig/zz_generated.kic_%s.go"
validatingWebhookConfigurationGeneratorMasterOutputPath = "pkg/utils/kubernetes/resources/zz_generated.kic_validatingwebhookconfig.go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion hack/generators/testcases-registration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

const (
integrationTestsPackage = "test/integration"
generatedRegistrationFile = "test/integration/zz_generated_registered_testcases.go"
generatedRegistrationFile = "test/integration/zz_generated.registered_testcases.go"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/kubernetes/resources/clusterroles/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// Controller) ClusterRoles.
//
// It contains 2 types of files:
// - zz_generated_kong_ingress_controller_rbac_*.go: contains kubebuilder code
// - zz_generated.kong_ingress_controller_rbac_*.go: contains kubebuilder code
// markers for Kong Ingress Controller's ClusterRoles. Those are retrieved from
// Kong Ingress Controller's repository for each supported version.
// - zz_generated_controlplane_clusterrole_*.go: contains the generated Go code with
// - zz_generated.controlplane_clusterrole_*.go: contains the generated Go code with
// ClusterRoles for each supported version of Kong Ingress Controller.
//
package clusterroles
Loading

0 comments on commit 6139831

Please sign in to comment.