Skip to content

Commit ed81e90

Browse files
committed
sync chart
1 parent 671c1d2 commit ed81e90

File tree

6 files changed

+48
-81
lines changed

6 files changed

+48
-81
lines changed

api/coralogix/v1alpha1/alertscheduler_types.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ var (
204204
"hours": alertscheduler.DURATIONFREQUENCY_DURATION_FREQUENCY_HOUR,
205205
"days": alertscheduler.DURATIONFREQUENCY_DURATION_FREQUENCY_DAY,
206206
}
207-
daysToOpenAPIValue = map[Day]int32{
208-
"Sunday": 1,
209-
"Monday": 2,
210-
"Tuesday": 3,
211-
"Wednesday": 4,
212-
"Thursday": 5,
213-
"Friday": 6,
214-
"Saturday": 7,
215-
}
207+
//daysToOpenAPIValue = map[Day]int32{
208+
// "Sunday": 1,
209+
// "Monday": 2,
210+
// "Tuesday": 3,
211+
// "Wednesday": 4,
212+
// "Thursday": 5,
213+
// "Friday": 6,
214+
// "Saturday": 7,
215+
//}
216216
)
217217

218218
func (a *AlertScheduler) GetConditions() []metav1.Condition {

api/coralogix/v1alpha1/tcologspolicies_types.go

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -138,66 +138,46 @@ func (s *TCOLogsPoliciesSpec) ExtractOverwriteLogPoliciesRequest(
138138
func (p *TCOLogsPolicy) ExtractCreateLogPolicyRequest(
139139
ctx context.Context,
140140
coralogixClientSet *cxsdk.ClientSet) (*tcopolicies.CreateLogPolicyRequest, error) {
141-
var errs error
142-
applicationRule, err := expandTCOPolicyRule(p.Applications)
143-
if err != nil {
144-
errs = errors.Join(errs, err)
145-
}
146-
147-
subsystemRule, err := expandTCOPolicyRule(p.Subsystems)
148-
if err != nil {
149-
errs = errors.Join(errs, err)
150-
}
151-
152-
severities, err := expandTCOPolicySeverities(p.Severities)
153-
if err != nil {
154-
errs = errors.Join(errs, err)
155-
}
156-
157141
archiveRetention, err := expandArchiveRetention(ctx, coralogixClientSet, p.ArchiveRetention)
158142
if err != nil {
159-
errs = errors.Join(errs, err)
160-
}
161-
162-
if errs != nil {
163-
return nil, errs
143+
return nil, err
164144
}
165145

166146
req := &tcopolicies.CreateLogPolicyRequest{
167147
Policy: tcopolicies.CreateGenericPolicyRequest{
168148
Name: p.Name,
169149
Description: ptr.Deref(p.Description, ""),
170150
Priority: PrioritySchemaToOpenAPI[p.Priority],
171-
ApplicationRule: applicationRule,
172-
SubsystemRule: subsystemRule,
151+
ApplicationRule: expandTCOPolicyRule(p.Applications),
152+
SubsystemRule: expandTCOPolicyRule(p.Subsystems),
173153
ArchiveRetention: archiveRetention,
174154
},
175155
LogRules: tcopolicies.LogRules{
176-
Severities: severities,
156+
Severities: expandTCOPolicySeverities(p.Severities),
177157
},
178158
}
179159

180160
return req, nil
181161
}
182162

183-
func expandTCOPolicyRule(rule *TCOPolicyRule) (*tcopolicies.QuotaV1Rule, error) {
163+
func expandTCOPolicyRule(rule *TCOPolicyRule) *tcopolicies.QuotaV1Rule {
184164
if rule == nil {
185-
return nil, nil
165+
return nil
186166
}
187167

188168
return &tcopolicies.QuotaV1Rule{
189169
Name: tcopolicies.PtrString(strings.Join(rule.Names, ",")),
190170
RuleTypeId: RuleTypeIdSchemaToOpenAPI[rule.RuleType].Ptr(),
191-
}, nil
171+
}
192172
}
193173

194-
func expandTCOPolicySeverities(severities []TCOPolicySeverity) ([]tcopolicies.QuotaV1Severity, error) {
174+
func expandTCOPolicySeverities(severities []TCOPolicySeverity) []tcopolicies.QuotaV1Severity {
195175
var result []tcopolicies.QuotaV1Severity
196176
for _, severity := range severities {
197177
result = append(result, TCOPolicySeveritySchemaToOpenAPI[severity])
198178
}
199179

200-
return result, nil
180+
return result
201181
}
202182

203183
func expandArchiveRetention(

api/coralogix/v1alpha1/tcotracespolicies_types.go

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -109,48 +109,23 @@ func (s *TCOTracesPoliciesSpec) ExtractOverwriteTracesPoliciesRequest(
109109
func (p *TCOTracesPolicy) ExtractCreateSpanPolicyRequest(
110110
ctx context.Context,
111111
coralogixClientSet *cxsdk.ClientSet) (*tcopolicies.CreateSpanPolicyRequest, error) {
112-
var errs error
113-
applicationRule, err := expandTCOPolicyRule(p.Applications)
114-
if err != nil {
115-
errs = errors.Join(errs, err)
116-
}
117-
118-
subsystemRule, err := expandTCOPolicyRule(p.Subsystems)
119-
if err != nil {
120-
errs = errors.Join(errs, err)
121-
}
122-
123-
serviceRule, err := expandTCOPolicyRule(p.Services)
124-
if err != nil {
125-
errs = errors.Join(errs, err)
126-
}
127-
128-
actionRule, err := expandTCOPolicyRule(p.Actions)
129-
if err != nil {
130-
errs = errors.Join(errs, err)
131-
}
132-
133112
archiveRetention, err := expandArchiveRetention(ctx, coralogixClientSet, p.ArchiveRetention)
134113
if err != nil {
135-
errs = errors.Join(errs, err)
136-
}
137-
138-
if errs != nil {
139-
return nil, errs
114+
return nil, err
140115
}
141116

142117
req := &tcopolicies.CreateSpanPolicyRequest{
143118
Policy: tcopolicies.CreateGenericPolicyRequest{
144119
Name: p.Name,
145120
Description: ptr.Deref(p.Description, ""),
146121
Priority: PrioritySchemaToOpenAPI[p.Priority],
147-
ApplicationRule: applicationRule,
148-
SubsystemRule: subsystemRule,
122+
ApplicationRule: expandTCOPolicyRule(p.Applications),
123+
SubsystemRule: expandTCOPolicyRule(p.Subsystems),
149124
ArchiveRetention: archiveRetention,
150125
},
151126
SpanRules: tcopolicies.SpanRules{
152-
ServiceRule: serviceRule,
153-
ActionRule: actionRule,
127+
ServiceRule: expandTCOPolicyRule(p.Services),
128+
ActionRule: expandTCOPolicyRule(p.Actions),
154129
TagRules: expandTCOPolicyTagRules(p.Tags),
155130
},
156131
}

charts/coralogix-operator/templates/crds/coralogix.com_alerts.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,12 +1240,12 @@ spec:
12401240
type: string
12411241
forOverPct:
12421242
description: Percentage for the threshold
1243-
format: int32
1243+
format: int64
12441244
maximum: 100
12451245
type: integer
12461246
minNonNullValuesPct:
12471247
description: Replace with a number
1248-
format: int32
1248+
format: int64
12491249
maximum: 100
12501250
type: integer
12511251
ofTheLast:
@@ -1309,7 +1309,7 @@ spec:
13091309
properties:
13101310
minNonNullValuesPct:
13111311
description: Replace with a number
1312-
format: int32
1312+
format: int64
13131313
maximum: 100
13141314
type: integer
13151315
replaceWithZero:
@@ -1927,7 +1927,7 @@ spec:
19271927
properties:
19281928
minutes:
19291929
description: Delay between re-triggered alerts.
1930-
format: int32
1930+
format: int64
19311931
type: integer
19321932
type: object
19331933
type: object
@@ -2153,7 +2153,7 @@ spec:
21532153
properties:
21542154
id:
21552155
description: Webhook ID.
2156-
format: int32
2156+
format: int64
21572157
type: integer
21582158
name:
21592159
description: Name of the webhook.
@@ -2202,7 +2202,7 @@ spec:
22022202
properties:
22032203
minutes:
22042204
description: Delay between re-triggered alerts.
2205-
format: int32
2205+
format: int64
22062206
type: integer
22072207
type: object
22082208
required:
@@ -2437,7 +2437,7 @@ spec:
24372437
properties:
24382438
id:
24392439
description: Webhook ID.
2440-
format: int32
2440+
format: int64
24412441
type: integer
24422442
name:
24432443
description: Name of the webhook.
@@ -2486,7 +2486,7 @@ spec:
24862486
properties:
24872487
minutes:
24882488
description: Delay between re-triggered alerts.
2489-
format: int32
2489+
format: int64
24902490
type: integer
24912491
type: object
24922492
required:

charts/coralogix-operator/templates/crds/coralogix.com_slos.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@ spec:
1515
singular: slo
1616
scope: Namespaced
1717
versions:
18-
- name: v1alpha1
18+
- additionalPrinterColumns:
19+
- jsonPath: .status.printableStatus
20+
name: Status
21+
type: string
22+
- jsonPath: .metadata.creationTimestamp
23+
name: Age
24+
type: date
25+
name: v1alpha1
1926
schema:
2027
openAPIV3Schema:
21-
description: SLO is the Schema for the slos API.
28+
description: |-
29+
SLO is the Schema for the slos API.
30+
See also https://coralogix.com/platform/apm/slo-management/
2231
properties:
2332
apiVersion:
2433
description: |-
@@ -37,8 +46,6 @@ spec:
3746
type: string
3847
metadata:
3948
type: object
40-
printableStatus:
41-
type: string
4249
spec:
4350
description: 'SLOSpec defines the desired state of SLO. For more information,
4451
see: https://coralogix.com/platform/apm/slo-management/'
@@ -84,6 +91,9 @@ spec:
8491
required:
8592
- query
8693
type: object
94+
required:
95+
- goodEvents
96+
- totalEvents
8797
type: object
8898
windowBasedMetric:
8999
properties:
@@ -219,6 +229,8 @@ spec:
219229
type: array
220230
id:
221231
type: string
232+
printableStatus:
233+
type: string
222234
revision:
223235
format: int32
224236
type: integer

tests/e2e/outbound_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func getSampleWebhook(name, namespace string) *coralogixv1alpha1.OutboundWebhook
120120
return &coralogixv1alpha1.OutboundWebhook{
121121
ObjectMeta: metav1.ObjectMeta{
122122
Name: name,
123-
Namespace: testNamespace,
123+
Namespace: namespace,
124124
},
125125
Spec: coralogixv1alpha1.OutboundWebhookSpec{
126126
Name: name,

0 commit comments

Comments
 (0)