github.com/codeready-toolchain/api@v0.0.0-20240507023248-73662d6db2c5/api/v1alpha1/banneduser_types.go (about)

     1  package v1alpha1
     2  
     3  import (
     4  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     5  )
     6  
     7  const (
     8  	// BannedUserEmailHashLabelKey is used for the banneduser email hash label key
     9  	BannedUserEmailHashLabelKey = LabelKeyPrefix + "email-hash"
    10  
    11  	// BannedUserPhoneNumberHashLabelKey is used a label key for the hash of a phone of the banned user
    12  	BannedUserPhoneNumberHashLabelKey = LabelKeyPrefix + "phone-hash"
    13  )
    14  
    15  // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
    16  
    17  // BannedUserSpec defines the desired state of BannedUser
    18  // +k8s:openapi-gen=true
    19  type BannedUserSpec struct {
    20  	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
    21  	// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
    22  
    23  	// The e-mail address of the account that has been banned
    24  	Email string `json:"email"`
    25  }
    26  
    27  //+kubebuilder:object:root=true
    28  //+kubebuilder:subresource:status
    29  
    30  // BannedUser is used to maintain a list of banned e-mail addresses
    31  // +k8s:openapi-gen=true
    32  // +kubebuilder:resource:scope=Namespaced
    33  // +kubebuilder:printcolumn:name="Email",type="string",JSONPath=`.spec.email`
    34  // +kubebuilder:validation:XPreserveUnknownFields
    35  // +operator-sdk:gen-csv:customresourcedefinitions.displayName="Banned User"
    36  type BannedUser struct {
    37  	metav1.TypeMeta   `json:",inline"`
    38  	metav1.ObjectMeta `json:"metadata,omitempty"`
    39  
    40  	Spec BannedUserSpec `json:"spec,omitempty"`
    41  }
    42  
    43  //+kubebuilder:object:root=true
    44  
    45  // BannedUserList contains a list of BannedUser
    46  type BannedUserList struct {
    47  	metav1.TypeMeta `json:",inline"`
    48  	metav1.ListMeta `json:"metadata,omitempty"`
    49  	Items           []BannedUser `json:"items"`
    50  }
    51  
    52  func init() {
    53  	SchemeBuilder.Register(&BannedUser{}, &BannedUserList{})
    54  }