Skip to content

Commit

Permalink
feat(crd): add SnapshotMaxCount and SnapshotMaxSize
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <poan.yang@suse.com>
  • Loading branch information
FrankYang0529 authored and David Ko committed Jan 3, 2024
1 parent 80cf13f commit 0ca90e3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions k8s/crds.yaml
Expand Up @@ -1358,6 +1358,11 @@ spec:
type: boolean
salvageRequested:
type: boolean
snapshotMaxCount:
type: integer
snapshotMaxSize:
format: int64
type: string
unmapMarkSnapChainRemovedEnabled:
type: boolean
upgradedReplicaAddressMap:
Expand Down Expand Up @@ -1524,6 +1529,11 @@ spec:
type: object
salvageExecuted:
type: boolean
snapshotMaxCount:
type: integer
snapshotMaxSize:
format: int64
type: string
snapshots:
additionalProperties:
properties:
Expand Down Expand Up @@ -2499,6 +2509,11 @@ spec:
type: boolean
salvageRequested:
type: boolean
snapshotMaxCount:
type: integer
snapshotMaxSize:
format: int64
type: string
unmapMarkDiskChainRemovedEnabled:
type: boolean
volumeName:
Expand Down Expand Up @@ -3605,6 +3620,11 @@ spec:
- enabled
- fast-check
type: string
snapshotMaxCount:
type: integer
snapshotMaxSize:
format: int64
type: string
staleReplicaTimeout:
type: integer
unmapMarkSnapChainRemoved:
Expand Down
10 changes: 10 additions & 0 deletions k8s/pkg/apis/longhorn/v1beta2/engine.go
Expand Up @@ -138,6 +138,11 @@ type EngineSpec struct {
UnmapMarkSnapChainRemovedEnabled bool `json:"unmapMarkSnapChainRemovedEnabled"`
// +optional
Active bool `json:"active"`
// +optional
SnapshotMaxCount int `json:"snapshotMaxCount"`
// +kubebuilder:validation:Type=string
// +optional
SnapshotMaxSize int64 `json:"snapshotMaxSize,string"`
}

// EngineStatus defines the observed state of the Longhorn engine
Expand Down Expand Up @@ -184,6 +189,11 @@ type EngineStatus struct {
LastExpansionFailedAt string `json:"lastExpansionFailedAt"`
// +optional
UnmapMarkSnapChainRemovedEnabled bool `json:"unmapMarkSnapChainRemovedEnabled"`
// +optional
SnapshotMaxCount int `json:"snapshotMaxCount"`
// +kubebuilder:validation:Type=string
// +optional
SnapshotMaxSize int64 `json:"snapshotMaxSize,string"`
}

// +genclient
Expand Down
5 changes: 5 additions & 0 deletions k8s/pkg/apis/longhorn/v1beta2/replica.go
Expand Up @@ -48,6 +48,11 @@ type ReplicaSpec struct {
RebuildRetryCount int `json:"rebuildRetryCount"`
// +optional
EvictionRequested bool `json:"evictionRequested"`
// +optional
SnapshotMaxCount int `json:"snapshotMaxCount"`
// +kubebuilder:validation:Type=string
// +optional
SnapshotMaxSize int64 `json:"snapshotMaxSize,string"`
}

// ReplicaStatus defines the observed state of the Longhorn replica
Expand Down
5 changes: 5 additions & 0 deletions k8s/pkg/apis/longhorn/v1beta2/volume.go
Expand Up @@ -293,6 +293,11 @@ type VolumeSpec struct {
// +kubebuilder:validation:Enum=ignored;disabled;enabled
// +optional
OfflineReplicaRebuilding OfflineReplicaRebuilding `json:"offlineReplicaRebuilding"`
// +optional
SnapshotMaxCount int `json:"snapshotMaxCount"`
// +kubebuilder:validation:Type=string
// +optional
SnapshotMaxSize int64 `json:"snapshotMaxSize,string"`
}

// VolumeStatus defines the observed state of the Longhorn volume
Expand Down

0 comments on commit 0ca90e3

Please sign in to comment.