Skip to content

Commit 894e20a

Browse files
committed
fix: Return deep copy of Application object in Get()
Signed-off-by: yeonsoo <[email protected]>
1 parent 29659aa commit 894e20a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/backend/kubernetes/application/kubernetes.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ func (be *KubernetesBackend) Get(ctx context.Context, name string, namespace str
9797
if !ok {
9898
return nil, fmt.Errorf("object is not an Application: %T", obj)
9999
}
100-
return app, nil
100+
// Return a deep copy to prevent mutations
101+
return app.DeepCopy(), nil
101102
}
102103

103104
func (be *KubernetesBackend) Delete(ctx context.Context, name string, namespace string, deletionPropagation *backend.DeletionPropagation) error {

0 commit comments

Comments
 (0)