Automatic merge from submit-queue (batch tested with PRs 55900, 55995, 55913, 55467, 55376). 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>.
Improve unit test coverage of scale
**What this PR does / why we need it**:
1. Add unit test of ReplicaSet and StatefulSet to improve coverage of scale
2. Fix variable "fake" collideds with imported package name
3. Use Error with no value format and fix typo error messages
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
Automatic merge from submit-queue (batch tested with PRs 54460, 55258, 54858, 55506, 55510). 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>.
add create subcommand for priorityclass
**What this PR does / why we need it**:
add `create priorityclass` sub command
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:Fixes #54857
**Special notes for your reviewer**:
**Release note**:
```release-note
add create priorityclass sub command
```
Automatic merge from submit-queue. 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>.
fed: Move cluster generator & constants from kubectl to kubefed pkg
This will ensure the history of the federation-only files can be cheaply retained during the branch filtering that will occur for #52992.
cc: @kubernetes/sig-multicluster-pr-reviews
/sig multicluster
/area federation
/assign irfanurrehman shashidharatd
/release-note-none
Automatic merge from submit-queue. 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>.
kubectl: Move utility functions to util package
**What this PR does / why we need it**:
`parseFileSource()` and `parseLiteralSource()` are utility functions.
We have a package already for utility functions, `kubectl/util/`.
Move utility functions to `kubectl/util`, capitalize function names to
export from package.
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
/sig cli
/kind cleanup
Automatic merge from submit-queue (batch tested with PRs 53228, 53232, 53353). 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>.
Openapi explain
**What this PR does / why we need it**:
This rewrites `kubectl explain` but using openapi rather than swagger 1.2. Also removes the former code.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes#49465, fixes partially #44589, fixes partially #38637
**Special notes for your reviewer**:
FYI @mbohlool
**Release note**:
```release-note
`kubectl explain` now uses openapi rather than swagger 1.2.
```
Major changes:
- Don't generate a patch, instead generate the merged object so it can be used with PUT
- Separate tree parsing logic to collate items in a list from the delete / merge / replace / add logic when merging
- Use openapi for merge strategy metadata so it works with extensions and version skew
- Support multi-field mergekeys when merging lists
- Support replace strategy for maps
- Reduce complexity of generating order when merging lists - keep the locally defined order and append remote only-items
Continue to support:
- Explicitly setting fields to null
- Merging lists of primitives
- Don't randomize ordering when merging lists
TODO:
- Retain keys
- Conflict detection
Automatic merge from submit-queue. 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>..
Add UT for pkg/kubectl/autoscale_test.go
**What this PR does / why we need it**:
I find there is no UT for testing pkg/kubectl `HorizontalPodAutoscalerV1.generate(params)`. This PR add some UTs in pkg/kubectl/autoscale_test.go
**Which issue this PR fixes** : fixes#50810
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
/sig cli
Automatic merge from submit-queue (batch tested with PRs 52109, 52235, 51809, 52161, 50080). 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>..
Add UT for pkg/kubectl/clusterrolebinding_test.go
**What this PR does / why we need it**:
I find there is no UT case for pkg/kubectl/clusterrolebinding.go. This PR Adds some UTs for pkg/kubectl/clusterrolebinding_test.go
**Which issue this PR fixes**:
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
/sig cli
Automatic merge from submit-queue (batch tested with PRs 47806, 49539, 48763, 47049, 50600). 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>..
Add UT for pkg/kubectl/deployment.go
**What this PR does / why we need it**:
I find there is no UT for pkg/kubectl/deployment.go. This PR Adds some UTs for it.
related issue: #50829
/sig cli
`parseFileSource()` and `parseLiteralSource()` are utility functions.
We have a package already for utility functions, `kubectl/util/`.
Move utility functions to `kubectl/util`, capitalize function names to
export from package.