Skip to content
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

feat: add convenience shard field on warehouse spec #1637

Merged
merged 5 commits into from
Mar 16, 2024

Conversation

krancour
Copy link
Member

Fixes #1631

This is similar to #1582, but for Warehouses.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 70d776e
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/65f4de01cdb270000852c2ef
😎 Deploy Preview https://deploy-preview-1637.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 43.98%. Comparing base (f2149ef) to head (4b8da51).
Report is 4 commits behind head on main.

❗ Current head 4b8da51 differs from pull request most recent head 70d776e. Consider uploading reports for the commit 70d776e to get more accurate results

Files Patch % Lines
internal/webhook/warehouse/webhook.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1637      +/-   ##
==========================================
+ Coverage   43.96%   43.98%   +0.02%     
==========================================
  Files         199      199              
  Lines       12673    12683      +10     
==========================================
+ Hits         5572     5579       +7     
- Misses       6864     6866       +2     
- Partials      237      238       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

warehouse.Labels = make(map[string]string, 1)
}
warehouse.Labels[kargoapi.ShardLabelKey] = warehouse.Spec.Shard
} else if warehouse.Labels != nil && warehouse.Labels[kargoapi.ShardLabelKey] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think the != nil check is redundant. As checking the value of a nil map is actually safe (xref: https://go.dev/play/p/XiztcCXuNdt), only assignments cause panics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

Fixed in 70d776e

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour enabled auto-merge March 15, 2024 23:47
@krancour krancour added this pull request to the merge queue Mar 15, 2024
Merged via the queue into akuity:main with commit e76593c Mar 16, 2024
14 checks passed
@krancour krancour deleted the krancour/warehouse-shard-field branch March 16, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ux: Add shard field to Warehouse
2 participants