Skip to content

Commit 1a7b90f

Browse files
Merge pull request #2122 from jan--f/alert-relabel-no-ptr-list
alert-relabel list should not be a pointer
2 parents 36a1719 + fdd0236 commit 1a7b90f

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

monitoring/v1/types.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ type AlertingRuleList struct {
6767
metav1.ListMeta `json:"metadata,omitempty"`
6868

6969
// items is a list of AlertingRule objects.
70-
// +required
71-
Items []AlertingRule `json:"items"`
70+
// +optional
71+
Items []AlertingRule `json:"items,omitempty"`
7272
}
7373

7474
// AlertingRuleSpec is the desired state of an AlertingRule resource.
@@ -285,9 +285,8 @@ type AlertRelabelConfigList struct {
285285
metav1.ListMeta `json:"metadata,omitempty"`
286286

287287
// items is a list of AlertRelabelConfigs.
288-
// +kubebuilder:validation:MinItems:=1
289-
// +required
290-
Items []*AlertRelabelConfig `json:"items"`
288+
// +optional
289+
Items []AlertRelabelConfig `json:"items,omitempty"`
291290
}
292291

293292
// LabelName is a valid Prometheus label name which may only contain ASCII

monitoring/v1/zz_generated.deepcopy.go

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23432,9 +23432,6 @@
2343223432
"com.github.openshift.api.monitoring.v1.AlertRelabelConfigList": {
2343323433
"description": "AlertRelabelConfigList is a list of AlertRelabelConfigs.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
2343423434
"type": "object",
23435-
"required": [
23436-
"items"
23437-
],
2343823435
"properties": {
2343923436
"apiVersion": {
2344023437
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
@@ -23444,6 +23441,7 @@
2344423441
"description": "items is a list of AlertRelabelConfigs.",
2344523442
"type": "array",
2344623443
"items": {
23444+
"default": {},
2344723445
"$ref": "#/definitions/com.github.openshift.api.monitoring.v1.AlertRelabelConfig"
2344823446
}
2344923447
},
@@ -23524,9 +23522,6 @@
2352423522
"com.github.openshift.api.monitoring.v1.AlertingRuleList": {
2352523523
"description": "AlertingRuleList is a list of AlertingRule objects.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
2352623524
"type": "object",
23527-
"required": [
23528-
"items"
23529-
],
2353023525
"properties": {
2353123526
"apiVersion": {
2353223527
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",

0 commit comments

Comments
 (0)