Documentation ¶
Index ¶
- Constants
- func GetCnsVolumeMetadataName(guestClusterID string, entityUID string) string
- func GetCnsVolumeMetadataOwnerReference(apiVersion string, kind string, clusterName string, clusterUID string) metav1.OwnerReference
- type CnsOperatorEntityReference
- type CnsOperatorEntityType
- type CnsVolumeMetadata
- type CnsVolumeMetadataList
- type CnsVolumeMetadataSpec
- type CnsVolumeMetadataStatus
- type CnsVolumeMetadataVolumeStatus
Constants ¶
const ( CnsOperatorEntityTypePV = CnsOperatorEntityType(cnstypes.CnsKubernetesEntityTypePV) CnsOperatorEntityTypePVC = CnsOperatorEntityType(cnstypes.CnsKubernetesEntityTypePVC) CnsOperatorEntityTypePOD = CnsOperatorEntityType(cnstypes.CnsKubernetesEntityTypePOD) )
Allowed CnsOperatorEntityTypes for cnsvolumemetadata API.
Variables ¶
This section is empty.
Functions ¶
func GetCnsVolumeMetadataName ¶
GetCnsVolumeMetadataName returns the concatenated string of guestclusterid and entity id.
func GetCnsVolumeMetadataOwnerReference ¶
func GetCnsVolumeMetadataOwnerReference(apiVersion string, kind string, clusterName string, clusterUID string) metav1.OwnerReference
GetCnsVolumeMetadataOwnerReference returns the owner reference object from the input parameters.
Types ¶
type CnsOperatorEntityReference ¶
type CnsOperatorEntityReference cnstypes.CnsKubernetesEntityReference
func GetCnsOperatorEntityReference ¶
func GetCnsOperatorEntityReference(name string, namespace string, entitytype CnsOperatorEntityType, clusterid string) CnsOperatorEntityReference
GetCnsOperatorEntityReference returns the entityReference object from the input parameters.
type CnsOperatorEntityType ¶
type CnsOperatorEntityType cnstypes.CnsKubernetesEntityType
CnsOperatorEntityType defines the type for entitytype parameter in cnsvolumemetadata API.
type CnsVolumeMetadata ¶
type CnsVolumeMetadata struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CnsVolumeMetadataSpec `json:"spec,omitempty"` Status CnsVolumeMetadataStatus `json:"status,omitempty"` }
CnsVolumeMetadata is the Schema for the cnsvolumemetadata API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:resource:path=cnsvolumemetadata,scope=Namespaced
func CreateCnsVolumeMetadataSpec ¶
func CreateCnsVolumeMetadataSpec(volumeHandle []string, gcConfig config.GCConfig, uid string, name string, entityType CnsOperatorEntityType, labels map[string]string, namespace string, reference []CnsOperatorEntityReference) *CnsVolumeMetadata
CreateCnsVolumeMetadataSpec returns a cnsvolumemetadata object from the input parameters.
func (*CnsVolumeMetadata) DeepCopy ¶
func (in *CnsVolumeMetadata) DeepCopy() *CnsVolumeMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CnsVolumeMetadata.
func (*CnsVolumeMetadata) DeepCopyInto ¶
func (in *CnsVolumeMetadata) DeepCopyInto(out *CnsVolumeMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CnsVolumeMetadata) DeepCopyObject ¶
func (in *CnsVolumeMetadata) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CnsVolumeMetadataList ¶
type CnsVolumeMetadataList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []CnsVolumeMetadata `json:"items"` }
CnsVolumeMetadataList contains a list of CnsVolumeMetadata.
func (*CnsVolumeMetadataList) DeepCopy ¶
func (in *CnsVolumeMetadataList) DeepCopy() *CnsVolumeMetadataList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CnsVolumeMetadataList.
func (*CnsVolumeMetadataList) DeepCopyInto ¶
func (in *CnsVolumeMetadataList) DeepCopyInto(out *CnsVolumeMetadataList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CnsVolumeMetadataList) DeepCopyObject ¶
func (in *CnsVolumeMetadataList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CnsVolumeMetadataSpec ¶
type CnsVolumeMetadataSpec struct { // VolumeNames indicates the unique ID of the volume. // For volumes created in a guest cluster, this will be // “<guestcluster-ID>-<UID>” where UID is the pvc.UUID in supervisor cluster. // Instances of POD entity type can have multiple volume names. // Instances of PV and PVC entity types will have only one volume name. VolumeNames []string `json:"volumenames"` // GuestClusterID indicates the guest cluster ID in which this volume // is referenced. GuestClusterID string `json:"guestclusterid"` // EntityType indicates type of entity whose metadata // this instance represents. EntityType CnsOperatorEntityType `json:"entitytype"` // EntityName indicates name of the entity in the guest cluster. EntityName string `json:"entityname"` // EntityReferences indicate the other entities that this entity refers to. // A Pod in the guest cluster can refers to one or more PVCs in the guest cluster. // A PVC in the guest cluster refers to a PV in the guest cluster. // A PV in the guest cluster refers to a PVC in the supervisor cluster. // A Pod/PVC in the guest cluster referring to a PVC/PV respectively in the // guest cluster must set the ClusterID field. // A PV in the guest cluster referring to a PVC in the supervisor cluster // must leave the ClusterID field unset. // This field is mandatory. EntityReferences []CnsOperatorEntityReference `json:"entityreferences"` // Labels indicates user labels assigned to the entity in the guest cluster. // Should only be populated if EntityType is PERSISTENT_VOLUME OR // PERSISTENT_VOLUME_CLAIM. CNS Operator will return a failure to the client // if labels are set for objects whose EntityType is POD. //+optional Labels map[string]string `json:"labels,omitempty"` // Namespace indicates namespace of entity in guest cluster. // Should only be populated if EntityType is PERSISTENT_VOLUME_CLAIM or POD. // CNS Operator will return a failure to the client if namespace is set for // objects whose EntityType is PERSISTENT_VOLUME. //+optional Namespace string `json:"namespace,omitempty"` // ClusterDistribution indicates the cluster distribution where the // PVCSI driver is deployed //+optional ClusterDistribution string `json:"clusterdistribution,omitempty"` }
CnsVolumeMetadataSpec defines the desired state of CnsVolumeMetadata +k8s:openapi-gen=true
func (*CnsVolumeMetadataSpec) DeepCopy ¶
func (in *CnsVolumeMetadataSpec) DeepCopy() *CnsVolumeMetadataSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CnsVolumeMetadataSpec.
func (*CnsVolumeMetadataSpec) DeepCopyInto ¶
func (in *CnsVolumeMetadataSpec) DeepCopyInto(out *CnsVolumeMetadataSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CnsVolumeMetadataStatus ¶
type CnsVolumeMetadataStatus struct { // The last error encountered, per volume, during update operation. // This field must only be set by the entity completing the update // operation, i.e. the CNS Operator. // This string may be logged, so it should not contain sensitive // information. // +optional VolumeStatus []CnsVolumeMetadataVolumeStatus `json:"volumestatus,omitempty"` }
CnsVolumeMetadataStatus defines the observed state of CnsVolumeMetadata +k8s:openapi-gen=true
func (*CnsVolumeMetadataStatus) DeepCopy ¶
func (in *CnsVolumeMetadataStatus) DeepCopy() *CnsVolumeMetadataStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CnsVolumeMetadataStatus.
func (*CnsVolumeMetadataStatus) DeepCopyInto ¶
func (in *CnsVolumeMetadataStatus) DeepCopyInto(out *CnsVolumeMetadataStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CnsVolumeMetadataVolumeStatus ¶
type CnsVolumeMetadataVolumeStatus struct { VolumeName string `json:"volumename"` Updated bool `json:"updated"` ErrorMessage string `json:"errormessage,omitempty"` }
CnsVolumeMetadataVolumeStatus defines the status of the last update operation on CNS for the given volume. Error message will be empty if no error was encountered.
func GetCnsOperatorVolumeStatus ¶
func GetCnsOperatorVolumeStatus(volumeName string, errorMessage string) CnsVolumeMetadataVolumeStatus
GetCnsOperatorVolumeStatus returns a CnsVolumeMetadataVolumeStatus object from input parameters.