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 cc81eef commit ebe7d77
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/zz_generated*.go linguist-generated=true
**/zz_generated.*.go linguist-generated=true
pkg/clientset/** linguist-generated=true
deploy/single/** linguist-generated=true
test/e2e/manifests/** linguist-generated=true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ generate.gateway-api-consts:
CRDS_EXPERIMENTAL_URL=$(shell GATEWAY_API_RELEASE_CHANNEL="experimental" $(MAKE) print-gateway-api-crds-url) \
RAW_REPO_URL=$(shell $(MAKE) print-gateway-api-raw-repo-url) \
INPUT=$(shell pwd)/test/internal/cmd/generate-gateway-api-consts/gateway_consts.tmpl \
OUTPUT=$(shell pwd)/test/consts/zz_generated_gateway.go \
OUTPUT=$(shell pwd)/test/consts/zz_generated.gateway.go \
go generate -tags=generate_gateway_api_consts ./test/internal/cmd/generate-gateway-api-consts

.PHONY: go-mod-download-gateway-api
Expand Down
12 changes: 6 additions & 6 deletions hack/generators/cache-stores/templates.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package main

const (
cacheStoresOutputFile = "zz_generated_cache_stores.go"
cacheStoresOutputFile = "zz_generated.cache_stores.go"
cacheStoresTemplate = `// Code generated by hack/generators/cache-stores/main.go; DO NOT EDIT.
// If you want to add a new type to the cache store, you need to add a new entry to the supportedTypes list in spec.go.
package store
import (
import (
"fmt"
"sync"
corev1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
netv1 "k8s.io/api/networking/v1"
Expand All @@ -22,7 +22,7 @@ import (
kongv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1"
kongv1beta1 "github.com/kong/kubernetes-configuration/api/configuration/v1beta1"
incubatorv1alpha1 "github.com/kong/kubernetes-configuration/api/incubator/v1alpha1"
)
// CacheStores stores cache.Store for all Kinds of k8s objects that
Expand Down Expand Up @@ -70,7 +70,7 @@ func (c CacheStores) Add(obj runtime.Object) error {
{{- range . }}
case *{{ .Package }}.{{ .Type }}:
return c.{{ .StoreField | default .Type }}.Add(obj)
{{- end }}
{{- end }}
}
return fmt.Errorf("cannot add unsupported kind %q to the store", obj.GetObjectKind().GroupVersionKind())
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func (c CacheStores) SupportedTypes() []client.Object {
}
`

cacheStoresTestOutputFile = "zz_generated_cache_stores_test.go"
cacheStoresTestOutputFile = "zz_generated.cache_stores_test.go"
cacheStoresTestTemplate = `// Code generated by hack/generators/cache-stores/main.go; DO NOT EDIT.
// If you want to add a new type to the cache store, you need to add a new entry to the supportedTypes list in spec.go.
package store_test
Expand Down
6 changes: 3 additions & 3 deletions hack/generators/controllers/networking/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// -----------------------------------------------------------------------------

const (
outputFile = "../../internal/controllers/configuration/zz_generated_controllers.go"
outputFile = "../../internal/controllers/configuration/zz_generated.controllers.go"

corev1 = "k8s.io/api/core/v1"
discoveryv1 = "k8s.io/api/discovery/v1"
Expand Down Expand Up @@ -749,8 +749,8 @@ func (r *{{.PackageAlias}}{{.Kind}}Reconciler) Reconcile(ctx context.Context, re
configurationStatus := r.DataplaneClient.KubernetesObjectConfigurationStatus(obj)
log.V(logging.DebugLevel).Info("Updating programmed condition status", "namespace", req.Namespace, "name", req.Name, "configuration_status",configurationStatus)
conditions, updateNeeded := ctrlutils.EnsureProgrammedCondition(
configurationStatus,
obj.Generation,
configurationStatus,
obj.Generation,
obj.Status.Conditions,
{{- if .ProgrammedCondition.CustomUnknownMessage }}
ctrlutils.WithUnknownMessage("{{ .ProgrammedCondition.CustomUnknownMessage }}"),
Expand Down
File renamed without changes.
File renamed without changes.

1 comment on commit ebe7d77

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: ebe7d77 Previous: cc81eef Ratio
BenchmarkGetPluginRelations 24200 ns/op 7296 B/op 66 allocs/op 6883 ns/op 7296 B/op 66 allocs/op 3.52
BenchmarkGetPluginRelations - ns/op 24200 ns/op 6883 ns/op 3.52

This comment was automatically generated by workflow using github-action-benchmark.

CC: @Kong/k8s-maintainers

Please sign in to comment.