sigs.k8s.io/cluster-api-provider-azure@v1.17.0/api/v1alpha1/azureasomanagedcontrolplane_types.go (about) 1 /* 2 Copyright 2024 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package v1alpha1 18 19 import ( 20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" 22 ) 23 24 // AzureASOManagedControlPlaneKind is the kind for AzureASOManagedControlPlane. 25 const AzureASOManagedControlPlaneKind = "AzureASOManagedControlPlane" 26 27 // AzureASOManagedControlPlaneSpec defines the desired state of AzureASOManagedControlPlane. 28 type AzureASOManagedControlPlaneSpec struct { 29 AzureASOManagedControlPlaneTemplateResourceSpec `json:",inline"` 30 } 31 32 // AzureASOManagedControlPlaneStatus defines the observed state of AzureASOManagedControlPlane. 33 type AzureASOManagedControlPlaneStatus struct { 34 // Initialized represents whether or not the API server has been provisioned. It fulfills Cluster API's 35 // control plane provider contract. For AKS, this is equivalent to `ready`. 36 //+optional 37 Initialized bool `json:"initialized"` 38 39 // Ready represents whether or not the API server is ready to receive requests. It fulfills Cluster API's 40 // control plane provider contract. For AKS, this is equivalent to `initialized`. 41 //+optional 42 Ready bool `json:"ready"` 43 44 // Version is the observed Kubernetes version of the control plane. It fulfills Cluster API's control 45 // plane provider contract. 46 //+optional 47 Version string `json:"version,omitempty"` 48 49 //+optional 50 Resources []ResourceStatus `json:"resources,omitempty"` 51 52 // ControlPlaneEndpoint represents the endpoint for the cluster's API server. 53 //+optional 54 ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` 55 } 56 57 //+kubebuilder:object:root=true 58 //+kubebuilder:subresource:status 59 60 // AzureASOManagedControlPlane is the Schema for the azureasomanagedcontrolplanes API. 61 type AzureASOManagedControlPlane struct { 62 metav1.TypeMeta `json:",inline"` 63 metav1.ObjectMeta `json:"metadata,omitempty"` 64 65 Spec AzureASOManagedControlPlaneSpec `json:"spec,omitempty"` 66 Status AzureASOManagedControlPlaneStatus `json:"status,omitempty"` 67 } 68 69 // GetResourceStatuses returns the status of resources. 70 func (a *AzureASOManagedControlPlane) GetResourceStatuses() []ResourceStatus { 71 return a.Status.Resources 72 } 73 74 // SetResourceStatuses sets the status of resources. 75 func (a *AzureASOManagedControlPlane) SetResourceStatuses(r []ResourceStatus) { 76 a.Status.Resources = r 77 } 78 79 //+kubebuilder:object:root=true 80 81 // AzureASOManagedControlPlaneList contains a list of AzureASOManagedControlPlane. 82 type AzureASOManagedControlPlaneList struct { 83 metav1.TypeMeta `json:",inline"` 84 metav1.ListMeta `json:"metadata,omitempty"` 85 Items []AzureASOManagedControlPlane `json:"items"` 86 } 87 88 func init() { 89 SchemeBuilder.Register(&AzureASOManagedControlPlane{}, &AzureASOManagedControlPlaneList{}) 90 }