tacker/tacker/tests/unit/vnfm/infra_drivers/kubernetes
LiangLu 26a2b5fce2 Fix missing required parameter when k8s_obj init
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
2021-08-25 13:35:55 +09:00
..
kubernetes_api_resource Fix missing required parameter when k8s_obj init 2021-08-25 13:35:55 +09:00
__init__.py Implementation CNF with VNFM and CISM in Tacker 2020-09-25 05:15:59 -04:00
fakes.py Fix some bugs related legacy cnf operations 2021-03-29 10:16:59 +00:00
test_kubernetes_driver.py Fix some bugs related legacy cnf operations 2021-03-29 10:16:59 +00:00
test_tosca_kube_object.py improve UT coverage of kubernetes-driver related files 2021-02-22 08:16:34 +00:00
test_translate_inputs.py improve UT coverage of kubernetes-driver related files 2021-02-22 08:16:34 +00:00
test_translate_outputs.py Fix missing required parameter when k8s_obj init 2021-08-25 13:35:55 +09:00
test_translate_template.py improve UT coverage of kubernetes-driver related files 2021-02-22 08:16:34 +00:00