for kdu_delta in delta.get("kdu-resource-delta", {}):
kdu_profile = get_kdu_resource_profile(db_vnfd, kdu_delta["id"])
kdu_name = kdu_profile["kdu-name"]
- resource_name = kdu_profile["resource-name"]
+ resource_name = kdu_profile.get("resource-name", "")
# Might have different kdus in the same delta
# Should have list for each kdu
and kdur.get("helm-version") == "v2"
):
k8s_cluster_type = "helm-chart"
- raise NotImplementedError
elif kdur.get("juju-bundle"):
k8s_cluster_type = "juju-bundle"
else:
kdu_instance = deployed_kdu.get("kdu-instance")
instance_num = await self.k8scluster_map[
k8s_cluster_type
- ].get_scale_count(resource_name, kdu_instance, vca_id=vca_id)
+ ].get_scale_count(
+ resource_name,
+ kdu_instance,
+ vca_id=vca_id,
+ cluster_uuid=deployed_kdu.get("k8scluster-uuid"),
+ kdu_model=deployed_kdu.get("kdu-model"),
+ )
kdu_replica_count = instance_num + kdu_delta.get(
"number-of-instances", 1
)
for kdu_delta in delta.get("kdu-resource-delta", {}):
kdu_profile = get_kdu_resource_profile(db_vnfd, kdu_delta["id"])
kdu_name = kdu_profile["kdu-name"]
- resource_name = kdu_profile["resource-name"]
+ resource_name = kdu_profile.get("resource-name", "")
if not scaling_info["kdu-delete"].get(kdu_name, None):
scaling_info["kdu-delete"][kdu_name] = []
and kdur.get("helm-version") == "v2"
):
k8s_cluster_type = "helm-chart"
- raise NotImplementedError
elif kdur.get("juju-bundle"):
k8s_cluster_type = "juju-bundle"
else:
kdu_instance = deployed_kdu.get("kdu-instance")
instance_num = await self.k8scluster_map[
k8s_cluster_type
- ].get_scale_count(resource_name, kdu_instance, vca_id=vca_id)
+ ].get_scale_count(
+ resource_name,
+ kdu_instance,
+ vca_id=vca_id,
+ cluster_uuid=deployed_kdu.get("k8scluster-uuid"),
+ kdu_model=deployed_kdu.get("kdu-model"),
+ )
kdu_replica_count = instance_num - kdu_delta.get(
"number-of-instances", 1
)
)
cluster_uuid = deployed_kdu["k8scluster-uuid"]
kdu_instance = deployed_kdu["kdu-instance"]
+ kdu_model = deployed_kdu.get("kdu-model")
scale = int(kdu_scaling_info["scale"])
k8s_cluster_type = kdu_scaling_info["k8s-cluster-type"]
scale,
kdu_scaling_info["resource-name"],
vca_id=vca_id,
+ cluster_uuid=cluster_uuid,
+ kdu_model=kdu_model,
+ atomic=True,
+ db_dict=db_dict,
),
timeout=self.timeout_vca_on_error,
)