While deploying CNF(deployment) using pod-affinity rules, a
parameter error happended because the topology_key is not
assigned when initializing k8s object.
This patch fixes this bug by adding the topology_key's default
value into `must_param` in translate_outputs._create_k8s_object().
At the same time, in order to deal with the recurrence of this
kind of bug, we checked the required parameters of all resources
in kubernetes again and added them to must_param.
* Kubernetes version: from v1.18.20 to v1.21.1
* Kubernetes-python-client version: v18.20.0
The major changes from the "must_param" used in the previous
Wallaby release of Tacker are probably as follows:
RuntimeRawExtension
The `data` parameter of `V1ControllerRevision`[1] in v11.0.0
was `RuntimeRawExtension`[2], but the `RuntimeRawExtension` was
not support for v12.0.0 or later. Therefore `V1ControllerRevision`
in v18.20.0[3] it has been changed to` object` type.
V1ServiceReference
The `service` parameter of `V1APIServiceSpec`[4] in v11.0.0 was
`V1ServiceReference`[5], but the `V1ServiceReference` was not
support for v12.0.0 or later.
Therefore `V1APIServiceSpec` in v18.20.0[6] it has been changed
to `ApiregistrationV1ServiceReference`[7].
V1LimitRangeItem
The `type` parameter of `V1LimitRangeItem`[8] in v11.0.0 was
optional type, but the parameter has changed to must param
in v18.20.0[9].
Therefore, the parameter should be added into `must_param`.
[1] https://github.com/kubernetes-client/python/blob/v11.0.0/kubernetes/docs/V1ControllerRevision.md
[2] https://github.com/kubernetes-client/python/blob/v11.0.0/kubernetes/docs/RuntimeRawExtension.md
[3] https://github.com/kubernetes-client/python/blob/v18.20.0/kubernetes/docs/V1ControllerRevision.md
[4] https://github.com/kubernetes-client/python/blob/v11.0.0/kubernetes/docs/V1APIServiceSpec.md
[5] https://github.com/kubernetes-client/python/blob/v11.0.0/kubernetes/docs/V1ServiceReference.md
[6] https://github.com/kubernetes-client/python/blob/v18.20.0/kubernetes/docs/V1APIServiceSpec.md
[7] https://github.com/kubernetes-client/python/blob/v18.20.0/kubernetes/docs/ApiregistrationV1ServiceReference.md
[8] https://github.com/kubernetes-client/python/blob/v11.0.0/kubernetes/docs/V1LimitRangeItem.md
[9] https://github.com/kubernetes-client/python/blob/v18.20.0/kubernetes/docs/V1LimitRangeItem.md
Closes-Bug: #1928153
Closes-Bug: #1940602
Change-Id: If77be98d0c4cec6f4c860ae84978f59772f9a6ee
22 lines
344 B
YAML
22 lines
344 B
YAML
apiVersion: apps/v1
|
|
kind: ReplicaSet
|
|
metadata:
|
|
name: curry-replicaset
|
|
spec:
|
|
replicas: 10
|
|
selector:
|
|
matchLabels:
|
|
app: nginx
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nginx
|
|
spec:
|
|
containers:
|
|
- image: nginx
|
|
name: nginx
|
|
status:
|
|
replicas: 1
|
|
conditions:
|
|
- status: True
|
|
type: ReplicaSet |