Skip to content

Commit

Permalink
Size as Quantity in LogRotationPolicy (#309)
Browse files Browse the repository at this point in the history
The change is backwards compatible and allows to use suffixes (Ki, Mi, Gi).
  • Loading branch information
sgburtsev authored Jul 12, 2024
1 parent a7ea217 commit 122eb68
Show file tree
Hide file tree
Showing 11 changed files with 753 additions and 302 deletions.
8 changes: 4 additions & 4 deletions api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ type CategoriesFilter struct {
}

type LogRotationPolicy struct {
RotationPeriodMilliseconds *int64 `json:"rotationPeriodMilliseconds,omitempty" yson:"rotation_period,omitempty"`
MaxSegmentSize *int64 `json:"maxSegmentSize,omitempty" yson:"max_segment_size,omitempty"`
MaxTotalSizeToKeep *int64 `json:"maxTotalSizeToKeep,omitempty" yson:"max_total_size_to_keep,omitempty"`
MaxSegmentCountToKeep *int64 `json:"maxSegmentCountToKeep,omitempty" yson:"max_segment_count_to_keep,omitempty"`
RotationPeriodMilliseconds *int64 `json:"rotationPeriodMilliseconds,omitempty"`
MaxSegmentSize *resource.Quantity `json:"maxSegmentSize,omitempty"`
MaxTotalSizeToKeep *resource.Quantity `json:"maxTotalSizeToKeep,omitempty"`
MaxSegmentCountToKeep *int64 `json:"maxSegmentCountToKeep,omitempty"`
}

type BaseLoggerSpec struct {
Expand Down
8 changes: 4 additions & 4 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 30 additions & 12 deletions config/crd/bases/cluster.ytsaurus.tech_remoteexecnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,17 @@ spec:
format: int64
type: integer
maxSegmentSize:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
maxTotalSizeToKeep:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
rotationPeriodMilliseconds:
format: int64
type: integer
Expand Down Expand Up @@ -979,11 +985,17 @@ spec:
format: int64
type: integer
maxSegmentSize:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
maxTotalSizeToKeep:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
rotationPeriodMilliseconds:
format: int64
type: integer
Expand Down Expand Up @@ -1171,11 +1183,17 @@ spec:
format: int64
type: integer
maxSegmentSize:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
maxTotalSizeToKeep:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
rotationPeriodMilliseconds:
format: int64
type: integer
Expand Down
28 changes: 20 additions & 8 deletions config/crd/bases/cluster.ytsaurus.tech_remoteytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,17 @@ spec:
format: int64
type: integer
maxSegmentSize:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
maxTotalSizeToKeep:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
rotationPeriodMilliseconds:
format: int64
type: integer
Expand Down Expand Up @@ -925,11 +931,17 @@ spec:
format: int64
type: integer
maxSegmentSize:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
maxTotalSizeToKeep:
format: int64
type: integer
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
rotationPeriodMilliseconds:
format: int64
type: integer
Expand Down
Loading

0 comments on commit 122eb68

Please sign in to comment.