(probe *userconfig.Probe)
| 32 | } |
| 33 | |
| 34 | func GetProbeSpec(probe *userconfig.Probe) *kcore.Probe { |
| 35 | if probe == nil { |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | var httpGetAction *kcore.HTTPGetAction |
| 40 | var tcpSocketAction *kcore.TCPSocketAction |
| 41 | var execAction *kcore.ExecAction |
| 42 | |
| 43 | if probe.HTTPGet != nil { |
| 44 | httpGetAction = &kcore.HTTPGetAction{ |
| 45 | Path: probe.HTTPGet.Path, |
| 46 | Port: intstr.IntOrString{ |
| 47 | IntVal: probe.HTTPGet.Port, |
| 48 | }, |
| 49 | } |
| 50 | } |
| 51 | if probe.TCPSocket != nil { |
| 52 | tcpSocketAction = &kcore.TCPSocketAction{ |
| 53 | Port: intstr.IntOrString{ |
| 54 | IntVal: probe.TCPSocket.Port, |
| 55 | }, |
| 56 | } |
| 57 | } |
| 58 | if probe.Exec != nil { |
| 59 | execAction = &kcore.ExecAction{ |
| 60 | Command: probe.Exec.Command, |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | return &kcore.Probe{ |
| 65 | Handler: kcore.Handler{ |
| 66 | HTTPGet: httpGetAction, |
| 67 | TCPSocket: tcpSocketAction, |
| 68 | Exec: execAction, |
| 69 | }, |
| 70 | InitialDelaySeconds: probe.InitialDelaySeconds, |
| 71 | TimeoutSeconds: probe.TimeoutSeconds, |
| 72 | PeriodSeconds: probe.PeriodSeconds, |
| 73 | SuccessThreshold: probe.SuccessThreshold, |
| 74 | FailureThreshold: probe.FailureThreshold, |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | func GetLifecycleSpec(preStop *userconfig.PreStop) *kcore.Lifecycle { |
| 79 | if preStop == nil { |
no outgoing calls
no test coverage detected