Documentation ¶
Index ¶
- Constants
- Variables
- func GetRandomErrorPercentage() int
- func LogBuildDetails()
- func StartInjectionServer()
- type CRUDErrorInjection
- type CSPCErrorInjection
- type CSPIErrorInjection
- type CVRErrorInjection
- type Client
- type DeploymentErrorInjection
- type ErrorInjection
- func (ei *ErrorInjection) IsCSPCCreateErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCDeleteCollectionErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCDeleteErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCGetErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCListErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCPatchErrorInjected() bool
- func (ei *ErrorInjection) IsCSPCUpdateErrorInjected() bool
- func (ei *ErrorInjection) IsCSPICreateErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIDeleteCollectionErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIDeleteErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIGetErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIListErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIPatchErrorInjected() bool
- func (ei *ErrorInjection) IsCSPIUpdateErrorInjected() bool
- func (ei *ErrorInjection) IsCVRCreateErrorInjected() bool
- func (ei *ErrorInjection) IsCVRDeleteErrorInjected() bool
- func (ei *ErrorInjection) IsCVRGetErrorInjected() bool
- func (ei *ErrorInjection) IsCVRUpdateErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentCreateErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentDeleteCollectionErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentDeleteErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentGetErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentListErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentPatchErrorInjected() bool
- func (ei *ErrorInjection) IsDeploymentUpdateErrorInjected() bool
- func (ei *ErrorInjection) IsZFSCreateErrorInjected() bool
- func (ei *ErrorInjection) IsZFSDeleteErrorInjected() bool
- func (ei *ErrorInjection) IsZFSGetErrorInjected() bool
- func (ei *ErrorInjection) WithCSPCCreateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCDeleteCollectionError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCDeleteError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCGetError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCListError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCPatchError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCThreshold(threshold int) *ErrorInjection
- func (ei *ErrorInjection) WithCSPCUpdateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPICreateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIDeleteCollectionError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIDeleteError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIGetError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIListError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIPatchError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIThreshold(threshold int) *ErrorInjection
- func (ei *ErrorInjection) WithCSPIUpdateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCVRCreateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCVRDeleteError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCVRGetError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithCVRThreshold(threshold int) *ErrorInjection
- func (ei *ErrorInjection) WithCVRUpdateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentCreateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentDeleteCollectionError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentDeleteError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentGetError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentListError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentPatchError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentThreshold(threshold int) *ErrorInjection
- func (ei *ErrorInjection) WithDeploymentUpdateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithZFSCreateError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithZFSDeleteError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithZFSGetError(ejectOrInject string) *ErrorInjection
- func (ei *ErrorInjection) WithZFSThreshold(threshold int) *ErrorInjection
- type ErrorPercentageThreshold
- type ZFSErrorInjection
Constants ¶
const ( // Inject is used to inject errors. Inject = "true" // Eject is used to eject errors. Eject = "false" )
Variables ¶
var EI = &ErrorInjection{}
EI is a global object which is used to decide whether the error is injected or not.
Functions ¶
func GetRandomErrorPercentage ¶
func GetRandomErrorPercentage() int
GetRandomErrorPercentage returns an error percentage value. If the returned error percentage is greater then the error percentage threshold then error will not be injected.
func LogBuildDetails ¶
func LogBuildDetails()
LogBuildDetails is no-op production alternative for the same function in present in debug build.
func StartInjectionServer ¶
func StartInjectionServer()
StartInjectionServer is no-op production alternative for the same function in present in debug build.
Types ¶
type CRUDErrorInjection ¶
type CRUDErrorInjection struct { InjectDeleteCollectionError string `json:"injectDeleteCollectionError"` InjectDeleteError string `json:"injectDeleteError"` InjectListError string `json:"injectListError"` InjectGetError string `json:"injectGetError"` InjectCreateError string `json:"injectCreateError"` InjectUpdateError string `json:"injectUpdateError"` InjectPatchError string `json:"injectPatchError"` }
CRUDErrorInjection is used to inject CRUD errors.
type CSPCErrorInjection ¶
type CSPCErrorInjection struct { CRUDErrorInjection CRUDErrorInjection `json:"crudErrorInjection"` ErrorPercentage ErrorPercentageThreshold `json:"errorPercentage"` }
CSPCErrorInjection is used to inject errors for CSPC related operations.
type CSPIErrorInjection ¶
type CSPIErrorInjection struct { CRUDErrorInjection CRUDErrorInjection `json:"crudErrorInjection"` ErrorPercentage ErrorPercentageThreshold `json:"errorPercentage"` }
CSPIErrorInjection is used to inject errors for CSPI related operations.
type CVRErrorInjection ¶
type CVRErrorInjection struct { CRUDErrorInjection CRUDErrorInjection `json:"crudErrorInjection"` ErrorPercentage ErrorPercentageThreshold `json:"errorPercentage"` }
CVRErrorInjection is used to inject errors in API calls for Volume Replica related operations
type Client ¶
Client to connect to injection API server.
func (*Client) GetInject ¶
func (c *Client) GetInject() (*ErrorInjection, error)
GetInject gives the error injection object.
func (*Client) PostInject ¶
func (c *Client) PostInject(EI *ErrorInjection) error
PostInject will post the error injection object.
type DeploymentErrorInjection ¶
type DeploymentErrorInjection struct { CRUDErrorInjection CRUDErrorInjection `json:"crudErrorInjection"` ErrorPercentage ErrorPercentageThreshold `json:"errorPercentage"` }
DeploymentErrorInjection is used to inject errors for CSPC related operations.
type ErrorInjection ¶
type ErrorInjection struct { CSPIError CSPIErrorInjection `json:"cspiError"` CSPCError CSPCErrorInjection `json:"cspcError"` DeploymentError DeploymentErrorInjection `json:"deploymentError"` ZFSError ZFSErrorInjection `json:"zfsError"` CVRError CVRErrorInjection `json:"cvrError"` }
ErrorInjection schema to inject errors.
func NewErrorInjection ¶
func NewErrorInjection() *ErrorInjection
NewErrorInjection returns a new ErrorInjection object.
func (*ErrorInjection) IsCSPCCreateErrorInjected ¶
func (ei *ErrorInjection) IsCSPCCreateErrorInjected() bool
IsCSPCCreateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCDeleteCollectionErrorInjected ¶
func (ei *ErrorInjection) IsCSPCDeleteCollectionErrorInjected() bool
IsCSPCDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCDeleteErrorInjected ¶
func (ei *ErrorInjection) IsCSPCDeleteErrorInjected() bool
IsCSPCDeleteErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCGetErrorInjected ¶
func (ei *ErrorInjection) IsCSPCGetErrorInjected() bool
IsCSPCGetErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCListErrorInjected ¶
func (ei *ErrorInjection) IsCSPCListErrorInjected() bool
IsCSPCListErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCPatchErrorInjected ¶
func (ei *ErrorInjection) IsCSPCPatchErrorInjected() bool
IsCSPCPatchErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPCUpdateErrorInjected ¶
func (ei *ErrorInjection) IsCSPCUpdateErrorInjected() bool
IsCSPCUpdateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPICreateErrorInjected ¶
func (ei *ErrorInjection) IsCSPICreateErrorInjected() bool
IsCSPICreateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIDeleteCollectionErrorInjected ¶
func (ei *ErrorInjection) IsCSPIDeleteCollectionErrorInjected() bool
IsCSPIDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIDeleteErrorInjected ¶
func (ei *ErrorInjection) IsCSPIDeleteErrorInjected() bool
IsCSPIDeleteErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIGetErrorInjected ¶
func (ei *ErrorInjection) IsCSPIGetErrorInjected() bool
IsCSPIGetErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIListErrorInjected ¶
func (ei *ErrorInjection) IsCSPIListErrorInjected() bool
IsCSPIListErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIPatchErrorInjected ¶
func (ei *ErrorInjection) IsCSPIPatchErrorInjected() bool
IsCSPIPatchErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCSPIUpdateErrorInjected ¶
func (ei *ErrorInjection) IsCSPIUpdateErrorInjected() bool
IsCSPIUpdateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsCVRCreateErrorInjected ¶
func (ei *ErrorInjection) IsCVRCreateErrorInjected() bool
IsCVRCreateErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsCVRDeleteErrorInjected ¶
func (ei *ErrorInjection) IsCVRDeleteErrorInjected() bool
IsCVRDeleteErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsCVRGetErrorInjected ¶
func (ei *ErrorInjection) IsCVRGetErrorInjected() bool
IsCVRGetErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsCVRUpdateErrorInjected ¶
func (ei *ErrorInjection) IsCVRUpdateErrorInjected() bool
IsCVRUpdateErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsDeploymentCreateErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentCreateErrorInjected() bool
IsDeploymentCreateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentDeleteCollectionErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentDeleteCollectionErrorInjected() bool
IsDeploymentDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentDeleteErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentDeleteErrorInjected() bool
IsDeploymentDeleteErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentGetErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentGetErrorInjected() bool
IsDeploymentGetErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentListErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentListErrorInjected() bool
IsDeploymentListErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentPatchErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentPatchErrorInjected() bool
IsDeploymentPatchErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsDeploymentUpdateErrorInjected ¶
func (ei *ErrorInjection) IsDeploymentUpdateErrorInjected() bool
IsDeploymentUpdateErrorInjected is production alternative for the same function in present in debug build.
func (*ErrorInjection) IsZFSCreateErrorInjected ¶
func (ei *ErrorInjection) IsZFSCreateErrorInjected() bool
IsZFSCreateErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsZFSDeleteErrorInjected ¶
func (ei *ErrorInjection) IsZFSDeleteErrorInjected() bool
IsZFSDeleteErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) IsZFSGetErrorInjected ¶
func (ei *ErrorInjection) IsZFSGetErrorInjected() bool
IsZFSGetErrorInjected is production alternative for the same function that exists in debug build
func (*ErrorInjection) WithCSPCCreateError ¶
func (ei *ErrorInjection) WithCSPCCreateError(ejectOrInject string) *ErrorInjection
WithCSPCCreateError injects/ejects CSPC create error.
func (*ErrorInjection) WithCSPCDeleteCollectionError ¶
func (ei *ErrorInjection) WithCSPCDeleteCollectionError(ejectOrInject string) *ErrorInjection
WithCSPCDeleteCollectionError injects/ejects CSPC delete collection error.
func (*ErrorInjection) WithCSPCDeleteError ¶
func (ei *ErrorInjection) WithCSPCDeleteError(ejectOrInject string) *ErrorInjection
WithCSPCDeleteError injects/ejects CSPC delete error.
func (*ErrorInjection) WithCSPCGetError ¶
func (ei *ErrorInjection) WithCSPCGetError(ejectOrInject string) *ErrorInjection
WithCSPCGetError injects/ejects CSPC get error.
func (*ErrorInjection) WithCSPCListError ¶
func (ei *ErrorInjection) WithCSPCListError(ejectOrInject string) *ErrorInjection
WithCSPCListError injects/ejects CSPC list error.
func (*ErrorInjection) WithCSPCPatchError ¶
func (ei *ErrorInjection) WithCSPCPatchError(ejectOrInject string) *ErrorInjection
WithCSPCPatchError injects/ejects CSPC patch error.
func (*ErrorInjection) WithCSPCThreshold ¶
func (ei *ErrorInjection) WithCSPCThreshold(threshold int) *ErrorInjection
WithCSPCThreshold injects CSPC error depending on passed error threshold value.
func (*ErrorInjection) WithCSPCUpdateError ¶
func (ei *ErrorInjection) WithCSPCUpdateError(ejectOrInject string) *ErrorInjection
WithCSPCUpdateError injects/ejects CSPC update error.
func (*ErrorInjection) WithCSPICreateError ¶
func (ei *ErrorInjection) WithCSPICreateError(ejectOrInject string) *ErrorInjection
WithCSPICreateError injects/ejects CSPI create error.
func (*ErrorInjection) WithCSPIDeleteCollectionError ¶
func (ei *ErrorInjection) WithCSPIDeleteCollectionError(ejectOrInject string) *ErrorInjection
WithCSPIDeleteCollectionError injects/ejects CSPI delete collection error.
func (*ErrorInjection) WithCSPIDeleteError ¶
func (ei *ErrorInjection) WithCSPIDeleteError(ejectOrInject string) *ErrorInjection
WithCSPIDeleteError injects/ejects CSPI delete error.
func (*ErrorInjection) WithCSPIGetError ¶
func (ei *ErrorInjection) WithCSPIGetError(ejectOrInject string) *ErrorInjection
WithCSPIGetError injects/ejects CSPI get error.
func (*ErrorInjection) WithCSPIListError ¶
func (ei *ErrorInjection) WithCSPIListError(ejectOrInject string) *ErrorInjection
WithCSPIListError injects/ejects CSPI list error.
func (*ErrorInjection) WithCSPIPatchError ¶
func (ei *ErrorInjection) WithCSPIPatchError(ejectOrInject string) *ErrorInjection
WithCSPIPatchError injects/ejects CSPI patch error.
func (*ErrorInjection) WithCSPIThreshold ¶
func (ei *ErrorInjection) WithCSPIThreshold(threshold int) *ErrorInjection
WithCSPIThreshold injects CSPI error depending on passed error threshold value.
func (*ErrorInjection) WithCSPIUpdateError ¶
func (ei *ErrorInjection) WithCSPIUpdateError(ejectOrInject string) *ErrorInjection
WithCSPIUpdateError injects/ejects CSPI update error.
func (*ErrorInjection) WithCVRCreateError ¶
func (ei *ErrorInjection) WithCVRCreateError(ejectOrInject string) *ErrorInjection
WithCVRCreateError injects/ejects CVR create error.
func (*ErrorInjection) WithCVRDeleteError ¶
func (ei *ErrorInjection) WithCVRDeleteError(ejectOrInject string) *ErrorInjection
WithCVRDeleteError injects/ejects CVR delete error.
func (*ErrorInjection) WithCVRGetError ¶
func (ei *ErrorInjection) WithCVRGetError(ejectOrInject string) *ErrorInjection
WithCVRGetError injects/ejects CVR get error.
func (*ErrorInjection) WithCVRThreshold ¶
func (ei *ErrorInjection) WithCVRThreshold(threshold int) *ErrorInjection
WithCVRThreshold injects CVR error depending on passed error threshold value
func (*ErrorInjection) WithCVRUpdateError ¶
func (ei *ErrorInjection) WithCVRUpdateError(ejectOrInject string) *ErrorInjection
WithCVRUpdateError injects/ejects CVR update error.
func (*ErrorInjection) WithDeploymentCreateError ¶
func (ei *ErrorInjection) WithDeploymentCreateError(ejectOrInject string) *ErrorInjection
WithDeploymentCreateError injects/ejects Deployment create error.
func (*ErrorInjection) WithDeploymentDeleteCollectionError ¶
func (ei *ErrorInjection) WithDeploymentDeleteCollectionError(ejectOrInject string) *ErrorInjection
WithDeploymentDeleteCollectionError injects/ejects Deployment delete collection error.
func (*ErrorInjection) WithDeploymentDeleteError ¶
func (ei *ErrorInjection) WithDeploymentDeleteError(ejectOrInject string) *ErrorInjection
WithDeploymentDeleteError injects/ejects Deployment delete error.
func (*ErrorInjection) WithDeploymentGetError ¶
func (ei *ErrorInjection) WithDeploymentGetError(ejectOrInject string) *ErrorInjection
WithDeploymentGetError injects/ejects Deployment get error.
func (*ErrorInjection) WithDeploymentListError ¶
func (ei *ErrorInjection) WithDeploymentListError(ejectOrInject string) *ErrorInjection
WithDeploymentListError injects/ejects Deployment delete error.
func (*ErrorInjection) WithDeploymentPatchError ¶
func (ei *ErrorInjection) WithDeploymentPatchError(ejectOrInject string) *ErrorInjection
WithDeploymentPatchError injects/ejects Deployment patch error.
func (*ErrorInjection) WithDeploymentThreshold ¶
func (ei *ErrorInjection) WithDeploymentThreshold(threshold int) *ErrorInjection
WithDeploymentThreshold injects Deployment error depending on passed error threshold value.
func (*ErrorInjection) WithDeploymentUpdateError ¶
func (ei *ErrorInjection) WithDeploymentUpdateError(ejectOrInject string) *ErrorInjection
WithDeploymentUpdateError injects/ejects Deployment update error.
func (*ErrorInjection) WithZFSCreateError ¶
func (ei *ErrorInjection) WithZFSCreateError(ejectOrInject string) *ErrorInjection
WithZFSCreateError injects/ejects ZFS create error.
func (*ErrorInjection) WithZFSDeleteError ¶
func (ei *ErrorInjection) WithZFSDeleteError(ejectOrInject string) *ErrorInjection
WithZFSDeleteError injects/ejects ZFS delete error.
func (*ErrorInjection) WithZFSGetError ¶
func (ei *ErrorInjection) WithZFSGetError(ejectOrInject string) *ErrorInjection
WithZFSGetError injects/ejects ZFS get error.
func (*ErrorInjection) WithZFSThreshold ¶
func (ei *ErrorInjection) WithZFSThreshold(threshold int) *ErrorInjection
WithZFSThreshold injects ZFS errors depending on passed error threshold value
type ErrorPercentageThreshold ¶
type ErrorPercentageThreshold struct {
Threshold int `json:"threshold"`
}
ErrorPercentageThreshold is the threshold value above which the error will not be injected.
type ZFSErrorInjection ¶
type ZFSErrorInjection struct { CRUDErrorInjection CRUDErrorInjection `json:"crudErrorInjection"` ErrorPercentage ErrorPercentageThreshold `json:"errorPercentage"` }
ZFSErrorInjection is used to inject errors for Volume Replica related operations.