Uses namespace labels for default options#2626
Conversation
bbf8134 to
a6c0be1
Compare
|
i think , the meaning of issue #2285 maybe not only get specific label from cc @stevvooe @crosbymichael PTAL |
|
Thanks @kadisi for taking a look. During client instantiation, we don't have a context and only namespace we can consider, is the one which is passed with |
a6c0be1 to
76163bd
Compare
Codecov Report
@@ Coverage Diff @@
## master #2626 +/- ##
=======================================
Coverage 43.98% 43.98%
=======================================
Files 102 102
Lines 10873 10873
=======================================
Hits 4782 4782
Misses 5358 5358
Partials 733 733
Continue to review full report at Codecov.
|
| } | ||
| namespaces := c.NamespaceService() | ||
| ctx := context.Background() | ||
| if labels, err := namespaces.Labels(ctx, defaultns); err == nil { |
There was a problem hiding this comment.
This should probably only be looked up when a defaultns is provided and no defaultruntime is. The given option should always be preferred and I don't think we should default the ns here.
Also I think NewWithConn should probably have matching logic
377595b to
3ac507a
Compare
|
Hi @dmcgowan, thanks for reviewing. I've made these changes, can you please again have a look? |
|
Hi @dmcgowan, just wanted to ping you again. Can you please have another look on this? /cc @crosbymichael |
|
Ya, sorry about the delay. We are in the middle of two releases right now that we are trying to get out the door so review times are a little long right now. |
|
One problem here is that the labels need to be namespaced. This has |
3ac507a to
d6af8d6
Compare
|
Hey @stevvooe, I have changed the labels to namespaced version. Didn't realize that's why your example labels in issue are namespaced. Can you please take another look? |
b6faa62 to
2e858a9
Compare
|
Hi @stevvooe @crosbymichael, just a ping. Please let me know if this requires any more changes. |
|
@krsoninikhil sorry for the delay! can you rebase this please? thanks! |
ffecdab to
d9f9d68
Compare
Signed-off-by: Nikhil Soni <[email protected]>
options. Implements same approach of setting defaults for `NewWithConn`. Signed-off-by: Nikhil Soni <[email protected]>
d9f9d68 to
3432398
Compare
|
Hi @ehazlett, I've rebased it with master, please let me know if any other changes are required. |
Signed-off-by: Nikhil Soni <[email protected]>
|
@AkihiroSuda @ehazlett I've added the documentation also, please have a look if it can be improved. |
|
@AkihiroSuda @ehazlett, just wanted to follow up on this, if any changes are required. |
| namespaceService := client.NamespaceService() | ||
| if ns, err := namespaces.NamespaceRequired(ctx); err == nil { | ||
| if labels, err := namespaceService.Labels(ctx, ns); err == nil { | ||
| if snapshotLabel, ok := labels["containerd.io/defaults/snapshotter"]; ok { |
There was a problem hiding this comment.
how about the const for the label here?
There was a problem hiding this comment.
You mean to use defaults package for the label names? That sounds better, should I move both label names to https://github.com/containerd/containerd/blob/master/defaults/defaults.go?
Labels that are used for configuring defaults are moved to defaults package Signed-off-by: Nikhil Soni <[email protected]>
7e42f0f to
6a21728
Compare
|
Hi @ehazlett, not sure why is this not getting merged. Are there any more changes required? |
|
LGTM |
1 similar comment
|
LGTM |
This is in reference to #2285. I tried to configure default runtime and snapshotter using namespace labels. Please suggest me the right approach if this is not the best way to do it.
Signed-off-by: Nikhil Soni [email protected]