Repository: zbrookle/avionix (language: python)

Issue:
CrossVersionObjectReference missing `kind` field
I am trying to deploy an HPA which uses `CrossVersionObjectReference`. I do not see the `kind` field in the api docs [here](https://avionix.readthedocs.io/en/latest/reference/kubernetes/modules/avionix.kube.autoscaling.html#avionix.kube.autoscaling.CrossVersionObjectReference). Let me know if I am missing something.  


Discussion / hints:
@shalseban You're right, that is missing, I can add it

Fix patch:
diff --git a/avionix/kube/autoscaling.py b/avionix/kube/autoscaling.py
index f4b6505..7dc5c11 100644
--- a/avionix/kube/autoscaling.py
+++ b/avionix/kube/autoscaling.py
@@ -16,9 +16,10 @@ class CrossVersionObjectReference(Autoscaling):
     :param api_version: API version of the referent
     """
 
-    def __init__(self, name: str, api_version: Optional[str] = None):
+    def __init__(self, name: str, kind: str, api_version: Optional[str] = None):
         super().__init__(api_version)
         self.name = name
+        self.kind = kind
 
 
 class HorizontalPodAutoscalerSpec(HelmYaml):


Test patch:
diff --git a/avionix/tests/test_autoscaling.py b/avionix/tests/test_autoscaling.py
index c9d35f9..9ef60d4 100644
--- a/avionix/tests/test_autoscaling.py
+++ b/avionix/tests/test_autoscaling.py
@@ -9,17 +9,16 @@
 
 
 def test_horizontal_pod_autoscaler(chart_info):
-    builder = ChartBuilder(
-        chart_info,
-        kubernetes_objects=[
-            HorizontalPodAutoscaler(
-                ObjectMeta(name="test-autoscaler"),
-                HorizontalPodAutoscalerSpec(1, CrossVersionObjectReference("test")),
-            )
-        ],
+    autoscaler = HorizontalPodAutoscaler(
+        ObjectMeta(name="test-autoscaler"),
+        HorizontalPodAutoscalerSpec(1, CrossVersionObjectReference("test", "Pod")),
     )
+    builder = ChartBuilder(chart_info, kubernetes_objects=[autoscaler],)
     with ChartInstallationContext(builder):
         autoscaling_info = kubectl_get("horizontalpodautoscaler")
         assert autoscaling_info["NAME"][0] == "test-autoscaler"
-        assert autoscaling_info["REFERENCE"][0] == "CrossVersionObjectReference/test"
+        assert (
+            autoscaling_info["REFERENCE"][0]
+            == f"{autoscaler.spec.scaleTargetRef.kind}/test"
+        )
         assert autoscaling_info["MAXPODS"][0] == "1"