Skip to content

Commit 155d6cd

Browse files
authored
fix(crd): fix the crd validation for required field (#450)
Signed-off-by: Shubham Chaudhary <[email protected]>
1 parent feb7100 commit 155d6cd

File tree

2 files changed

+44
-16
lines changed

2 files changed

+44
-16
lines changed

api/litmuschaos/v1alpha1/chaosengine_types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ type ProbeAttributes struct {
225225
// Type of probe
226226
Type string `json:"type"`
227227
// inputs needed for the k8s probe
228-
K8sProbeInputs K8sProbeInputs `json:"k8sProbe/inputs,omitempty"`
228+
K8sProbeInputs *K8sProbeInputs `json:"k8sProbe/inputs,omitempty"`
229229
// inputs needed for the http probe
230-
HTTPProbeInputs HTTPProbeInputs `json:"httpProbe/inputs,omitempty"`
230+
HTTPProbeInputs *HTTPProbeInputs `json:"httpProbe/inputs,omitempty"`
231231
// inputs needed for the cmd probe
232-
CmdProbeInputs CmdProbeInputs `json:"cmdProbe/inputs,omitempty"`
232+
CmdProbeInputs *CmdProbeInputs `json:"cmdProbe/inputs,omitempty"`
233233
// inputs needed for the prometheus probe
234-
PromProbeInputs PromProbeInputs `json:"promProbe/inputs,omitempty"`
234+
PromProbeInputs *PromProbeInputs `json:"promProbe/inputs,omitempty"`
235235
// RunProperty contains timeout, retry and interval for the probe
236236
RunProperties RunProperty `json:"runProperties"`
237237
// mode for k8s probe
@@ -271,7 +271,7 @@ type CmdProbeInputs struct {
271271
Comparator ComparatorInfo `json:"comparator"`
272272
// The source where we have to run the command
273273
// It will run in inline(inside experiment itself) mode if source is nil
274-
Source SourceDetails `json:"source,omitempty"`
274+
Source *SourceDetails `json:"source,omitempty"`
275275
}
276276

277277
// SourceDetails contains source details of the cmdProbe
@@ -312,7 +312,7 @@ type SourceDetails struct {
312312
type PromProbeInputs struct {
313313
// Endpoint for the prometheus probe
314314
Endpoint string `json:"endpoint"`
315-
// Query to get promethus metrics
315+
// Query to get prometheus metrics
316316
Query string `json:"query,omitempty"`
317317
// QueryPath contains filePath, which contains prometheus query
318318
QueryPath string `json:"queryPath,omitempty"`
@@ -345,8 +345,8 @@ type HTTPProbeInputs struct {
345345

346346
// HTTPMethod define the http method details
347347
type HTTPMethod struct {
348-
Get GetMethod `json:"get,omitempty"`
349-
Post PostMethod `json:"post,omitempty"`
348+
Get *GetMethod `json:"get,omitempty"`
349+
Post *PostMethod `json:"post,omitempty"`
350350
}
351351

352352
// GetMethod define the http Get method

api/litmuschaos/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)