var ( // ErrPodNotFound means operate pod may be deleted(almostly) ErrPodNotFound = errors.New("pod not found") // ErrPodNotRunning means operate pod may be not working // and it's non-sense to make changes on it. ErrPodNotRunning = errors.New("pod not running") )
Append adds an item to corresponding list in podnetworkchaos
type Append struct { Item interface{} }
func (a *Append) Apply(chaos *v1alpha1.PodIOChaos) error
Apply runs this action
type Builder struct { Log logr.Logger client.Client client.Reader // contains filtered or unexported fields }
func NewBuilder(params Params) *Builder
func (b *Builder) WithInit(source string, key types.NamespacedName) *PodIOManager
Clear removes all resources with the same source
type Clear struct { Source string }
func (s *Clear) Apply(chaos *v1alpha1.PodIOChaos) error
Apply runs this action
CommitResponse is a tuple (Key, Err)
type CommitResponse struct { Key types.NamespacedName Err error }
type Params struct { fx.In Logger logr.Logger Client client.Client Reader client.Reader `name:"no-cache"` Scheme *runtime.Scheme }
PodIOManager will save all the related podiochaos
type PodIOManager struct { Source string Log logr.Logger client.Client client.Reader Key types.NamespacedName T *PodIOTransaction // contains filtered or unexported fields }
func (m *PodIOManager) Commit(ctx context.Context, owner *v1alpha1.IOChaos) (int64, error)
Commit will update all modifications to the cluster
func (m *PodIOManager) CreateNewPodIOChaos(ctx context.Context) error
PodIOTransaction represents a modification on podnetwork
type PodIOTransaction struct { Steps []Step }
func (t *PodIOTransaction) Append(item interface{}) error
Append adds an item to corresponding list in podnetworkchaos
func (t *PodIOTransaction) Apply(chaos *v1alpha1.PodIOChaos) error
Apply runs every step on the chaos
func (t *PodIOTransaction) Clear(source string)
Clear will clear all related items in podnetworkchaos
func (t *PodIOTransaction) SetContainer(container string) error
func (t *PodIOTransaction) SetVolumePath(path string) error
SetVolumePath sets the volumePath field of podiochaos
SetContainer sets the container field of podiochaos
type SetContainer struct { Container string }
func (s *SetContainer) Apply(chaos *v1alpha1.PodIOChaos) error
Apply runs this action
SetVolumePath sets the volumePath field of podiochaos
type SetVolumePath struct { Path string }
func (s *SetVolumePath) Apply(chaos *v1alpha1.PodIOChaos) error
Apply runs this action
Step represents a step of PodIOTransaction
type Step interface { // Apply will apply an action on podnetworkchaos Apply(chaos *v1alpha1.PodIOChaos) error }