|
| 1 | +/* |
| 2 | +Copyright 2026 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 | +) |
| 22 | + |
| 23 | +// ClusterStoragePolicyInfoSpec defines the desired state of ClusterStoragePolicyInfo. |
| 24 | +// +k8s:openapi-gen=true |
| 25 | +type ClusterStoragePolicyInfoSpec struct { |
| 26 | + |
| 27 | + // K8sCompliantName is the Kubernetes-compliant name for the storage policy exposed to DevOps. |
| 28 | + // +required |
| 29 | + K8sCompliantName string `json:"k8sCompliantName"` |
| 30 | + |
| 31 | + // StoragePolicyID is the vSphere storage policy identifier. |
| 32 | + // +required |
| 33 | + StoragePolicyID string `json:"storagePolicyID"` |
| 34 | +} |
| 35 | + |
| 36 | +// TopologyInfo describes topology accessibility for the storage policy within the cluster. |
| 37 | +type TopologyInfo struct { |
| 38 | + // Zones lists zones where the policy is accessible for this cluster. |
| 39 | + // +optional |
| 40 | + Zones []string `json:"zones,omitempty"` |
| 41 | + |
| 42 | + // Error describes a failure condition when resolving topology for this storage policy. |
| 43 | + // +optional |
| 44 | + Error string `json:"error,omitempty"` |
| 45 | +} |
| 46 | + |
| 47 | +// ClusterStoragePolicyInfoStatus defines the observed state of ClusterStoragePolicyInfo. |
| 48 | +// +k8s:openapi-gen=true |
| 49 | +type ClusterStoragePolicyInfoStatus struct { |
| 50 | + // TopologyInfo contains observed topology for this storage policy in the cluster. |
| 51 | + // +optional |
| 52 | + TopologyInfo *TopologyInfo `json:"topologyInfo,omitempty"` |
| 53 | + |
| 54 | + // Error describes a failure condition when observing or reconciling this resource. |
| 55 | + // +optional |
| 56 | + Error string `json:"error,omitempty"` |
| 57 | +} |
| 58 | + |
| 59 | +// +genclient:nonNamespaced |
| 60 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 61 | + |
| 62 | +// +k8s:openapi-gen=true |
| 63 | +// +kubebuilder:subresource:status |
| 64 | +// +kubebuilder:object:root=true |
| 65 | +// +kubebuilder:resource:shortName=cspi,scope=Cluster,path=clusterstoragepolicyinfoes |
| 66 | + |
| 67 | +// ClusterStoragePolicyInfo is the Schema for the clusterstoragepolicyinfoes API. |
| 68 | +type ClusterStoragePolicyInfo struct { |
| 69 | + metav1.TypeMeta `json:",inline"` |
| 70 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 71 | + |
| 72 | + Spec ClusterStoragePolicyInfoSpec `json:"spec,omitempty"` |
| 73 | + Status ClusterStoragePolicyInfoStatus `json:"status,omitempty"` |
| 74 | +} |
| 75 | + |
| 76 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 77 | + |
| 78 | +// ClusterStoragePolicyInfoList contains a list of ClusterStoragePolicyInfo. |
| 79 | +type ClusterStoragePolicyInfoList struct { |
| 80 | + metav1.TypeMeta `json:",inline"` |
| 81 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 82 | + Items []ClusterStoragePolicyInfo `json:"items"` |
| 83 | +} |
0 commit comments