Skip to content

Commit

Permalink
enforce KeyResource values to be of type string (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshnm authored Aug 31, 2023
1 parent 8733126 commit 0094c88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/deployer/container/garbage_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (gc *GarbageCollector) cleanupRBACResources(obj client.Object) reconcile.Re

// cleanupSecret deletes secrets that do not have a parent deploy item anymore.
func (gc *GarbageCollector) cleanupSecret(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
logger := gc.log.WithValues(lc.KeyResourceKind, "Secret", lc.KeyResource, req.NamespacedName)
logger := gc.log.WithValues(lc.KeyResourceKind, "Secret", lc.KeyResource, req.NamespacedName.String())
obj := &corev1.Secret{}
if err := gc.hostClient.Get(ctx, req.NamespacedName, obj); err != nil {
if apierrors.IsNotFound(err) {
Expand All @@ -179,7 +179,7 @@ func (gc *GarbageCollector) cleanupSecret(ctx context.Context, req reconcile.Req

// cleanupPod deletes pods that do not have a parent deploy item anymore.
func (gc *GarbageCollector) cleanupPod(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
logger := gc.log.WithValues(lc.KeyResourceKind, "Pod", lc.KeyResource, req.NamespacedName)
logger := gc.log.WithValues(lc.KeyResourceKind, "Pod", lc.KeyResource, req.NamespacedName.String())
obj := &corev1.Pod{}
if err := gc.hostClient.Get(ctx, req.NamespacedName, obj); err != nil {
if apierrors.IsNotFound(err) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/monitoring/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (m *Monitor) monitorHpas(ctx context.Context) {
shouldLog := false

keyValueList := []interface{}{
lc.KeyResource, client.ObjectKey{Namespace: m.namespace, Name: hpa.Spec.ScaleTargetRef.Name},
lc.KeyResource, client.ObjectKey{Namespace: m.namespace, Name: hpa.Spec.ScaleTargetRef.Name}.String(),
keyCurrentReplicas, hpa.Status.CurrentReplicas,
keyDesiredReplicas, hpa.Status.DesiredReplicas,
}
Expand Down

0 comments on commit 0094c88

Please sign in to comment.