Skip to content

Commit f36a821

Browse files
authored
Merge pull request kubernetes#126034 from sohankunkerkar/add-usernamespaces
api: add user namespaces field to NodeRuntimeHandlerFeatures
2 parents 5427708 + 86240aa commit f36a821

File tree

18 files changed

+1088
-995
lines changed

18 files changed

+1088
-995
lines changed

api/openapi-spec/swagger.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/api__v1_openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3811,6 +3811,10 @@
38113811
"recursiveReadOnlyMounts": {
38123812
"description": "RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.",
38133813
"type": "boolean"
3814+
},
3815+
"userNamespaces": {
3816+
"description": "UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.",
3817+
"type": "boolean"
38143818
}
38153819
},
38163820
"type": "object"

pkg/apis/core/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4898,7 +4898,10 @@ type NodeRuntimeHandlerFeatures struct {
48984898
// +featureGate=RecursiveReadOnlyMounts
48994899
// +optional
49004900
RecursiveReadOnlyMounts *bool
4901-
// Reserved: UserNamespaces *bool
4901+
// UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.
4902+
// +featureGate=UserNamespacesSupport
4903+
// +optional
4904+
UserNamespaces *bool
49024905
}
49034906

49044907
// NodeRuntimeHandler is a set of runtime handler information.
@@ -5024,6 +5027,7 @@ type NodeStatus struct {
50245027
Config *NodeConfigStatus
50255028
// The available runtime handlers.
50265029
// +featureGate=RecursiveReadOnlyMounts
5030+
// +featureGate=UserNamespacesSupport
50275031
// +optional
50285032
RuntimeHandlers []NodeRuntimeHandler
50295033
}

pkg/apis/core/v1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/core/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/generated/openapi/zz_generated.openapi.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/kubelet/nodestatus/setters.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func GoRuntime() Setter {
485485
// RuntimeHandlers returns a Setter that sets RuntimeHandlers on the node.
486486
func RuntimeHandlers(fn func() []kubecontainer.RuntimeHandler) Setter {
487487
return func(ctx context.Context, node *v1.Node) error {
488-
if !utilfeature.DefaultFeatureGate.Enabled(features.RecursiveReadOnlyMounts) {
488+
if !utilfeature.DefaultFeatureGate.Enabled(features.RecursiveReadOnlyMounts) && !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
489489
return nil
490490
}
491491
handlers := fn()
@@ -495,6 +495,7 @@ func RuntimeHandlers(fn func() []kubecontainer.RuntimeHandler) Setter {
495495
Name: h.Name,
496496
Features: &v1.NodeRuntimeHandlerFeatures{
497497
RecursiveReadOnlyMounts: &h.SupportsRecursiveReadOnlyMounts,
498+
UserNamespaces: &h.SupportsUserNamespaces,
498499
},
499500
}
500501
}

pkg/registry/core/node/strategy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func dropDisabledFields(node *api.Node, oldNode *api.Node) {
103103
node.Spec.ConfigSource = nil
104104
}
105105

106-
if !utilfeature.DefaultFeatureGate.Enabled(features.RecursiveReadOnlyMounts) {
106+
if !utilfeature.DefaultFeatureGate.Enabled(features.RecursiveReadOnlyMounts) && !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
107107
node.Status.RuntimeHandlers = nil
108108
}
109109
}

staging/src/k8s.io/api/core/v1/generated.pb.go

Lines changed: 1026 additions & 990 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/core/v1/generated.proto

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)