-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Introduce PodSecurityPolicy in the policy/v1beta1 API group #54933
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ approvers: | |
- sig-apps-api-approvers | ||
reviewers: | ||
- sig-apps-reviewers | ||
- pweil- | ||
- liggitt | ||
- tallclair | ||
- php-coder |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ package policy | |
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"k8s.io/kubernetes/pkg/apis/extensions" | ||
) | ||
|
||
// GroupName is the group name use in this package | ||
|
@@ -48,6 +49,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { | |
scheme.AddKnownTypes(SchemeGroupVersion, | ||
&PodDisruptionBudget{}, | ||
&PodDisruptionBudgetList{}, | ||
&extensions.PodSecurityPolicy{}, | ||
&extensions.PodSecurityPolicyList{}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean to register the extensions one here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is internal, which hubs to the types located in extensions (same as other types that are moving between API groups) |
||
&Eviction{}, | ||
) | ||
return nil | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
Copyright 2018 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
policyv1beta1 "k8s.io/api/policy/v1beta1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
func addDefaultingFuncs(scheme *runtime.Scheme) error { | ||
return RegisterDefaults(scheme) | ||
} | ||
|
||
func SetDefaults_PodSecurityPolicySpec(obj *policyv1beta1.PodSecurityPolicySpec) { | ||
// This field was added after PodSecurityPolicy was released. | ||
// Policies that do not include this field must remain as permissive as they were prior to the introduction of this field. | ||
if obj.AllowPrivilegeEscalation == nil { | ||
t := true | ||
obj.AllowPrivilegeEscalation = &t | ||
} | ||
} |
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.
I was going to suggest updating the addons too, but then I realized that could result in duplication of all of the policies after an upgrade...
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.
it shouldn't... the old and new API group are colocated... existing extensions/v1beta1 objects would also surface under policy/v1beta1
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.
oh, great. In that case, @php-coder can you update the addons too?