k3s/pkg/apis
Kubernetes Submit Queue b0eb7d884d Merge pull request #53443 from liggitt/psp-allow-escalation
Automatic merge from submit-queue (batch tested with PRs 53454, 53446, 52935, 53443, 52917). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use pointer for PSP allow escalation

Fixes #53437 

The `AllowPrivilegeEscalation` field was added to PodSpec and PodSecurityPolicySpec in 1.8.0.

In order to remain compatible with pre-1.8.0 behavior, PodSecurityPolicy objects created against a previous release must not restrict this field, which means the field must default to true in PodSecurityPolicySpec. However, the field was added as a `bool`, not a `*bool`, which means that no defaulting is possible.

We have two options:
1. Require all pre-existing PodSecurityPolicy objects that intend to allow privileged permissions to update to set this new field to true
2. Change the field to a `*bool` and default it to true.

This PR does the latter. With this change, we have the following behavior:

A 1.8.1+ client/server now has three ways to serialize:
* `nil` values are dropped from serialization (because `omitempty`), which is interpreted correctly by other 1.8.1+ clients/servers, and is interpreted as false by 1.8.0
* `false` values are serialized and interpreted correctly by all clients/servers
* `true` values are serialized and interpreted correctly by all clients/servers

A 1.8.0 client/server has two ways to serialize:
* `false` values are dropped from serialization (because `omitempty`), which is interpreted as `false` by other 1.8.0 clients/servers, but as `nil` (and therefore defaulting to true) by 1.8.1+ clients/servers
* `true` values are serialized and interpreted correctly by all clients/servers

The primary concern is the 1.8.0 server dropping the `false` value from serialization, but I consider the compatibility break with pre-1.8 behavior to be more severe, especially if we can resolve the regression in an immediate point release.

```release-note
PodSecurityPolicy: Fixes a compatibility issue that caused policies that previously allowed privileged pods to start forbidding them, due to an incorrect default value for `allowPrivilegeEscalation`. PodSecurityPolicy objects defined using a 1.8.0 client or server that intended to set `allowPrivilegeEscalation` to `false` must be reapplied after upgrading to 1.8.1.
```
2017-10-05 05:06:30 -07:00
..
abac
admission moves admission.v1alpha1.NewAdmissionReview to webhook plugin 2017-10-04 19:50:27 +02:00
admissionregistration Merge pull request #51283 from caesarxuchao/fix-initializer-validate 2017-09-02 20:35:22 -07:00
apps fix error of func TestValidateStatefulSet that updateStrategy 2017-09-22 16:33:30 +08:00
authentication Add enj as reviewer to OWNERS 2017-08-17 20:42:46 -04:00
authorization generated 2017-09-01 19:11:19 +08:00
autoscaling fix some typos in api types 2017-09-26 10:56:44 +08:00
batch Limit 52-character cronjob name validation to create 2017-09-24 23:56:27 -04:00
certificates Generated files 2017-08-25 15:01:08 -04:00
componentconfig Merge pull request #52644 from surajnarwade/remove_unused_var_const 2017-10-02 09:28:10 -07:00
extensions Use pointer for PSP allow escalation 2017-10-04 13:55:06 -04:00
imagepolicy
meta/v1
networking Merge pull request #51959 from cmluciano/cml/updatenpowners 2017-09-22 18:25:28 -07:00
policy Generated files 2017-08-25 15:01:08 -04:00
rbac Merge pull request #52950 from liggitt/persist-rbac-v1 2017-10-03 00:24:31 -07:00
scheduling Generated files 2017-08-25 15:01:08 -04:00
settings Add API for mount propagation. 2017-09-01 21:36:32 +02:00
storage Update generated files - api, bazel, json 2017-09-04 09:02:35 +02:00
OWNERS Add liggitt as an API approver. Note that bgrant0607 is an approver, but 2017-08-23 11:32:05 -07:00