mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(k8s): namespace core logic (#12142)
Co-authored-by: testA113 <aliharriss1995@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: James Carppe <85850129+jamescarppe@users.noreply.github.com> Co-authored-by: Ali <83188384+testA113@users.noreply.github.com>
This commit is contained in:
parent
da010f3d08
commit
ea228c3d6d
276 changed files with 9241 additions and 3361 deletions
49
api/http/models/kubernetes/volumes.go
Normal file
49
api/http/models/kubernetes/volumes.go
Normal file
|
@ -0,0 +1,49 @@
|
|||
package kubernetes
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
type (
|
||||
K8sVolumeInfo struct {
|
||||
PersistentVolume K8sPersistentVolume `json:"persistentVolume"`
|
||||
PersistentVolumeClaim K8sPersistentVolumeClaim `json:"persistentVolumeClaim"`
|
||||
StorageClass K8sStorageClass `json:"storageClass"`
|
||||
}
|
||||
|
||||
K8sPersistentVolume struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
|
||||
Capacity corev1.ResourceList `json:"capacity"`
|
||||
ClaimRef *corev1.ObjectReference `json:"claimRef"`
|
||||
StorageClassName string `json:"storageClassName,omitempty"`
|
||||
PersistentVolumeReclaimPolicy corev1.PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy"`
|
||||
VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode"`
|
||||
CSI *corev1.CSIPersistentVolumeSource `json:"csi,omitempty"`
|
||||
}
|
||||
|
||||
K8sPersistentVolumeClaim struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace"`
|
||||
Storage int64 `json:"storage"`
|
||||
CreationDate time.Time `json:"creationDate"`
|
||||
AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
|
||||
VolumeName string `json:"volumeName"`
|
||||
ResourcesRequests *corev1.ResourceList `json:"resourcesRequests"`
|
||||
StorageClass *string `json:"storageClass"`
|
||||
VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode"`
|
||||
OwningApplications []K8sApplication `json:"owningApplications,omitempty"`
|
||||
Phase corev1.PersistentVolumeClaimPhase `json:"phase"`
|
||||
}
|
||||
|
||||
K8sStorageClass struct {
|
||||
Name string `json:"name"`
|
||||
Provisioner string `json:"provisioner"`
|
||||
ReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy"`
|
||||
AllowVolumeExpansion *bool `json:"allowVolumeExpansion"`
|
||||
}
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue