- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
server: fix panic when default annotations are specified #8867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: fix panic when default annotations are specified #8867
Conversation
| /kind bug | 
129a42b    to
    0fe2188      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a unit test to replicate the panic and make sure it is fixed?
0fe2188    to
    4093c1b      
    Compare
  
    | I have yet to reproduce the panic in integration tests unfortunately. I feel like it's worth getting a change out as saving the map in the sandbox and then editing it later would cause this, but I suspect it'll be tricky to hit the exact race we do in prod locally | 
| 
 I still think a unit test would be sufficient to catch this. We have mocks for a reason. | 
| Codecov ReportAttention: Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #8867      +/-   ##
==========================================
- Coverage   47.09%   47.08%   -0.02%     
==========================================
  Files         154      154              
  Lines       22136    22138       +2     
==========================================
- Hits        10426    10424       -2     
- Misses      10642    10645       +3     
- Partials     1068     1069       +1      | 
| 
 the mocks don't get to this point--we're not fully unit testing the sandbox creation process. That's part of the motivation of #8289 That said, I did reproduce with an integration test, and verify my fix seems to fix. I am trying to find a reasonable number of containers to create. It always seems to reproduce at 1000 and I think I caught it once at 100, but even that feels like a bit much so I'm inclined to not include a test | 
| Given the revert it would be nice to have some kind of test (unit / integration / e2e) that would cover this. I guess a e2e test with that many containers may be out of the realm for origin? | 
    git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
        git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
    | /retest | 
    
      
        1 similar comment
      
    
  
    | /retest | 
| /retest | 
4093c1b    to
    7eaad95      
    Compare
  
    | okay I figured out a test. it doesn't catch the panic, but does catch the context for the panic (that we didn't deep copy a map). @cri-o/cri-o-maintainers this should be ready PTAL | 
7eaad95    to
    ce08447      
    Compare
  
    Signed-off-by: Peter Hunt <[email protected]>
ce08447    to
    997e4fb      
    Compare
  
        git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
        git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
    | /retest | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
| [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, sohankunkerkar The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
 Approvers can indicate their approval by writing  | 
| In fact,  | 
| /cherry-pick release-1.31 | 
| @sohankunkerkar: new pull request created: #8885 In response to this: 
 Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. | 
| /cherry-pick release-1.32 | 
| @sohankunkerkar: new pull request created: #8886 In response to this: 
 Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. | 
    git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
See cri-o#8902
See cri-o#8903
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
    …a191585accdedc6e382 See cri-o/cri-o#8867 See cri-o/cri-o#8868 See cri-o/cri-o#8902 See cri-o/cri-o#8903 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
    git clean -xdf
    go mod download
    go mod vendor
    tar zcvf ../cri-o_1.32.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp cri-o.spec ../cri-o_1.32.0-1.spec
    cp ../cri-o*1.32.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/cri-o-cri-o-1.32.0/
    rm -rf ../cri-o*1.32.0*.*
See cri-o#8867
See cri-o#8868
See cri-o#8902
See cri-o#8903
Signed-off-by: Wong Hoi Sing Edison <[email protected]>
    
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?