Skip to content

Commit 0b8fb2f

Browse files
committed
address comments
1 parent 238ca1d commit 0b8fb2f

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Add annotations with the prefix `metadata.github.com/<key>` (e.g. `metadata.git
101101

102102
If a key is seen at multiple levels of the ownership hierarchy, the value from the lowest level (closest to the pod) will take precedence. For example, if a tag key is present on both the pod and its owning deployment, the value from the pod will be used.
103103

104-
Currently, a maximum of 5 custom tags are allowed per deployment record. Custom tags will be ignored after the limit is reached, meaning tags lower in the ownership hierarchy will be prioritized. Tag keys and values must be less than 100 characters in length. Invalid tags will be ignored.
104+
Currently, a maximum of 5 custom tags are allowed per deployment record. Custom tags will be ignored after the limit is reached, meaning tags lower in the ownership hierarchy will be prioritized. Tag keys and values must be 100 characters or less in length. Invalid tags will be ignored.
105105

106106
## Kubernetes Deployment
107107

internal/controller/controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,15 @@ func extractMetadataFromObject(obj *metav1.PartialObjectMetadata, aggPodMetadata
772772
)
773773
continue
774774
}
775+
if tagKey == "" || tagValue == "" {
776+
slog.Warn("Tag key or value is empty, skipping",
777+
"object_name", obj.GetName(),
778+
"kind", obj.Kind,
779+
"tag_key", tagKey,
780+
"tag_value", tagValue,
781+
)
782+
continue
783+
}
775784
if _, exists := aggPodMetadata.Tags[tagKey]; exists {
776785
slog.Debug("Duplicate tag key found, skipping",
777786
"object_name", obj.GetName(),

0 commit comments

Comments
 (0)