Skip to content

Commit 6c21727

Browse files
carlydfjlegrone
authored andcommitted
Fix log spam (#135)
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> Stop these two warnings from happening on every reconcile loop ``` metadata.name: this is used in Pod names and hostnames, which can result in surprising behavior; a DNS label is recommended: [must not contain dots] {"controller": "temporalworkerdeployment", "controllerGroup": "temporal.io", "controllerKind": "TemporalWorkerDeployment", "TemporalWorkerDeployment": {"name":"all-at-once-rollout-2-replicas","namespace":"test-integration-20250903200429"}, "namespace": "test-integration-20250903200429", "name": "all-at-once-rollout-2-replicas", "reconcileID": "5cdf5048-693b-4f77-90ca-30d42444748e"} ``` ``` {"level":"info","ts":1755712330.9777546,"msg":"unknown field \"spec.template.metadata.creationTimestamp\"","controller":"temporalworkerdeployment","controllerGroup":"temporal.io","controllerKind":"TemporalWorkerDeployment","TemporalWorkerDeployment":{"name":"helloworld","namespace":"staging"},"namespace":"staging","name":"helloworld","reconcileID":"0fe93d52-0049-437a-8e6e-1ebec7732999"} ``` We should not cut a release with known log spam. I kept the build ids in Temporal as having any characters at all, but when converted to a Deployment or Pod name, clean them to DNS only. <!--- add/delete as needed ---> 1. Closes #134 2. How was this tested: Unit tests for the build id change Checking logs on integration tests for the other changes. I'd like to make the tests error if there are too many warnings, but the log level is `info` on these, so I'm not sure how to make that work 3. Any docs updates needed? <!--- update README if applicable or point out where to update docs.temporal.io -->
1 parent 7bd313d commit 6c21727

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/k8s/deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func TruncateString(s string, n int) string {
160160
}
161161

162162
func CleanStringForDNS(s string) string {
163-
// Keep only letters, numbers, and dashes (no dots to avoid pod name warnings)
163+
// Keep only letters, numbers, and dashes.
164164
re := regexp.MustCompile(`[^a-zA-Z0-9-]+`)
165165
return re.ReplaceAllString(s, ResourceNameSeparator)
166166
}

0 commit comments

Comments
 (0)