@@ -58,6 +58,7 @@ type HostedControlPlane struct {
5858 ClusterID string
5959 ControllerAvailabilityPolicy AvailabilityPolicy
6060 NodeSelector map [string ]string
61+ Labels map [string ]string
6162 Tolerations []string
6263 AdvertiseAddress string
6364 AdvertisePort int
@@ -155,6 +156,11 @@ func ParseHostedControlPlane(hcp *unstructured.Unstructured) (*HostedControlPlan
155156 return nil , fmt .Errorf ("failed extract nodeSelector: %v" , err )
156157 }
157158
159+ labels , _ , err := unstructured .NestedStringMap (hcp .UnstructuredContent (), "spec" , "labels" )
160+ if err != nil {
161+ return nil , fmt .Errorf ("failed to extract labels: %v" , err )
162+ }
163+
158164 var tolerations []corev1.Toleration
159165 var tolerationsYaml []string
160166 tolerationsArray , tolerationsArrayFound , err := unstructured .NestedFieldCopy (hcp .UnstructuredContent (), "spec" , "tolerations" )
@@ -253,6 +259,7 @@ func ParseHostedControlPlane(hcp *unstructured.Unstructured) (*HostedControlPlan
253259 ControllerAvailabilityPolicy : AvailabilityPolicy (controllerAvailabilityPolicy ),
254260 ClusterID : clusterID ,
255261 NodeSelector : nodeSelector ,
262+ Labels : labels ,
256263 Tolerations : tolerationsYaml ,
257264 AdvertiseAddress : advertiseAddress ,
258265 AdvertisePort : int (advertisePort ),
0 commit comments