This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new 75575086 [YUNIKORN-2538] Shim cache context pre-allocate slice (#817)
75575086 is described below

commit 755750861230df8488c2532e89503a76142ffd41
Author: YUN SUN <yunsun@YUNs-MacBook-Air.local>
AuthorDate: Sat Apr 13 14:21:56 2024 +0800

    [YUNIKORN-2538] Shim cache context pre-allocate slice (#817)
    
    Closes: #817
    
    Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com>, Kuan-Po (Cooper) Tseng 
<brandb...@gmail.com>
---
 pkg/cache/context.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/cache/context.go b/pkg/cache/context.go
index c6caea06..c805f0ba 100644
--- a/pkg/cache/context.go
+++ b/pkg/cache/context.go
@@ -802,9 +802,9 @@ func (ctx *Context) AssumePod(name, node string) error {
                                return err
                        }
                        if len(reasons) > 0 {
-                               sReasons := make([]string, 0)
-                               for _, reason := range reasons {
-                                       sReasons = append(sReasons, 
string(reason))
+                               sReasons := make([]string, len(reasons))
+                               for i, reason := range reasons {
+                                       sReasons[i] = string(reason)
                                }
                                sReason := strings.Join(sReasons, ", ")
                                err = fmt.Errorf("pod %s has conflicting volume 
claims: %s", pod.Name, sReason)


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to