sigs.k8s.io/cluster-api-provider-aws@v1.5.5/bootstrap/eks/api/v1alpha4/eksconfig_types.go (about)

     1  /*
     2  Copyright 2021 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 v1alpha4
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  
    22  	clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
    23  )
    24  
    25  // EKSConfigSpec defines the desired state of EKSConfig
    26  type EKSConfigSpec struct {
    27  	// Passes the kubelet args into the EKS bootstrap script
    28  	// +optional
    29  	KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"`
    30  }
    31  
    32  // EKSConfigStatus defines the observed state of EKSConfig
    33  type EKSConfigStatus struct {
    34  	// Ready indicates the BootstrapData secret is ready to be consumed
    35  	Ready bool `json:"ready,omitempty"`
    36  
    37  	// DataSecretName is the name of the secret that stores the bootstrap data script.
    38  	// +optional
    39  	DataSecretName *string `json:"dataSecretName,omitempty"`
    40  
    41  	// FailureReason will be set on non-retryable errors
    42  	// +optional
    43  	FailureReason string `json:"failureReason,omitempty"`
    44  
    45  	// FailureMessage will be set on non-retryable errors
    46  	// +optional
    47  	FailureMessage string `json:"failureMessage,omitempty"`
    48  
    49  	// ObservedGeneration is the latest generation observed by the controller.
    50  	// +optional
    51  	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
    52  
    53  	// Conditions defines current service state of the EKSConfig.
    54  	// +optional
    55  	Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"`
    56  }
    57  
    58  // +kubebuilder:object:root=true
    59  // +kubebuilder:resource:path=eksconfigs,scope=Namespaced,categories=cluster-api,shortName=eksc
    60  // +kubebuilder:subresource:status
    61  // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Bootstrap configuration is ready"
    62  // +kubebuilder:printcolumn:name="DataSecretName",type="string",JSONPath=".status.dataSecretName",description="Name of Secret containing bootstrap data"
    63  
    64  // EKSConfig is the Schema for the eksconfigs API
    65  type EKSConfig struct {
    66  	metav1.TypeMeta   `json:",inline"`
    67  	metav1.ObjectMeta `json:"metadata,omitempty"`
    68  
    69  	Spec   EKSConfigSpec   `json:"spec,omitempty"`
    70  	Status EKSConfigStatus `json:"status,omitempty"`
    71  }
    72  
    73  // GetConditions returns the observations of the operational state of the EKSConfig resource.
    74  func (r *EKSConfig) GetConditions() clusterv1alpha4.Conditions {
    75  	return r.Status.Conditions
    76  }
    77  
    78  // SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1alpha4.Conditions.
    79  func (r *EKSConfig) SetConditions(conditions clusterv1alpha4.Conditions) {
    80  	r.Status.Conditions = conditions
    81  }
    82  
    83  // +kubebuilder:object:root=true
    84  
    85  // EKSConfigList contains a list of EKSConfig.
    86  type EKSConfigList struct {
    87  	metav1.TypeMeta `json:",inline"`
    88  	metav1.ListMeta `json:"metadata,omitempty"`
    89  	Items           []EKSConfig `json:"items"`
    90  }
    91  
    92  func init() {
    93  	SchemeBuilder.Register(&EKSConfig{}, &EKSConfigList{})
    94  }