- 
                Notifications
    
You must be signed in to change notification settings  - Fork 54
 
pkg/storage: handle more possible release label k/v pairs #399
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
pkg/storage: handle more possible release label k/v pairs #399
Conversation
Release labels are stored only in Kubernetes object metadata. In order to support a wider variety of release labels, check release label validity. If a release label is invalid for a kubernetes metadata.label store it as an annotation instead. Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
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
          Codecov ReportAttention: Patch coverage is  
 
 
 Additional details and impacted files@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
- Coverage   85.06%   78.48%   -6.59%     
==========================================
  Files          19       31      +12     
  Lines        1346     2477    +1131     
==========================================
+ Hits         1145     1944     +799     
- Misses        125      444     +319     
- Partials       76       89      +13     ☔ View full report in Codecov by Sentry.  | 
    
| 
           New changes are detected. LGTM label has been removed.  | 
    
| // The only labels that get stored on the index secret are system labels, so we'll do a two-pass | ||
| // query. First, we'll request index secrets from the API server that match the query labels that | ||
| // are system labels. From there, we decode the releases that match, and then further filter those | ||
| // based on the rest of the query labels that are not system labels. | 
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.
This was necessary to get existing tests to pass. We have a test that uses a custom label in a query.
69971bb    to
    787247e      
    Compare
  
    Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
787247e    to
    cceec2e      
    Compare
  
    
Release labels are currently stored only in Kubernetes object metadata, which limits what can actually be stored there.
In order to support a wider variety of release labels, we will only store system labels in the index secret. All custom release labels will be serialized in the release blob itself.