Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add probe source part to kubernetes cmd properties of ChaosEngine manifest #4881

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions chaoscenter/graphql/server/pkg/probe/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ func GenerateProbeManifest(probe *model.Probe, mode model.Mode) (string, error)
_probe.RunProperties.StopOnFailure = *probe.KubernetesCMDProperties.StopOnFailure
}

if probe.KubernetesCMDProperties.Source != nil {
var source v1alpha1.SourceDetails
err := json.Unmarshal([]byte(*probe.KubernetesCMDProperties.Source), &source)
if err != nil {
log.Warnf("error unmarshalling soruce: %s - the source part of the probe is being ignored", err.Error())
}
_probe.CmdProbeInputs.Source = &source
}

y, err := json.Marshal(_probe)
if err != nil {
return "", err
Expand Down Expand Up @@ -788,6 +797,7 @@ func GenerateExperimentManifestWithProbes(manifest string, projectID string) (ar
CmdProbeInputs: &v1alpha1.CmdProbeInputs{
Command: cmdProbe.CmdProbeInputs.Command,
Comparator: cmdProbe.CmdProbeInputs.Comparator,
Source: cmdProbe.CmdProbeInputs.Source,
},
RunProperties: cmdProbe.RunProperties,
Mode: cmdProbe.Mode,
Expand Down Expand Up @@ -940,6 +950,7 @@ func GenerateCronExperimentManifestWithProbes(manifest string, projectID string)
CmdProbeInputs: &v1alpha1.CmdProbeInputs{
Command: cmdProbe.CmdProbeInputs.Command,
Comparator: cmdProbe.CmdProbeInputs.Comparator,
Source: cmdProbe.CmdProbeInputs.Source,
},
RunProperties: cmdProbe.RunProperties,
Mode: cmdProbe.Mode,
Expand Down