...

Package podhttpchaosmanager

import "github.com/chaos-mesh/chaos-mesh/controllers/chaosimpl/httpchaos/podhttpchaosmanager"
Overview
Index

Overview ▾

Variables

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")
)

type Append

Append adds an item to corresponding list in podhttpchaos

type Append struct {
    Item interface{}
}

func (*Append) Apply

func (a *Append) Apply(chaos *v1alpha1.PodHttpChaos) error

Apply runs this action

type Builder

type Builder struct {
    Log logr.Logger
    client.Client
    client.Reader
    // contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(params Params) *Builder

func (*Builder) WithInit

func (b *Builder) WithInit(source string, key types.NamespacedName) *PodHttpManager

type Clear

Clear removes all resources with the same source

type Clear struct {
    Source string
}

func (*Clear) Apply

func (s *Clear) Apply(chaos *v1alpha1.PodHttpChaos) error

Apply runs this action

type CommitResponse

CommitResponse is a tuple (Key, Err)

type CommitResponse struct {
    Key types.NamespacedName
    Err error
}

type Params

type Params struct {
    fx.In

    Logger logr.Logger
    Client client.Client
    Reader client.Reader `name:"no-cache"`
    Scheme *runtime.Scheme
}

type PodHttpManager

PodHttpManager will save all the related podhttpchaos

type PodHttpManager struct {
    Source string

    Log logr.Logger
    client.Client
    client.Reader

    Key types.NamespacedName
    T   *PodHttpTransaction
    // contains filtered or unexported fields
}

func (*PodHttpManager) Commit

func (m *PodHttpManager) Commit(ctx context.Context) (int64, error)

Commit will update all modifications to the cluster

func (*PodHttpManager) CreateNewPodHttpChaos

func (m *PodHttpManager) CreateNewPodHttpChaos(ctx context.Context) error

type PodHttpTransaction

PodHttpTransaction represents a modification on podhttpchaos

type PodHttpTransaction struct {
    Steps []Step
}

func (*PodHttpTransaction) Append

func (t *PodHttpTransaction) Append(item interface{}) error

Append adds an item to corresponding list in podnetworkchaos

func (*PodHttpTransaction) Apply

func (t *PodHttpTransaction) Apply(chaos *v1alpha1.PodHttpChaos) error

Apply runs every step on the chaos

func (*PodHttpTransaction) Clear

func (t *PodHttpTransaction) Clear(source string)

Clear will clear all related items in podhttpchaos

type Step

Step represents a step of PodHttpTransaction

type Step interface {
    // Apply will apply an action on podnetworkchaos
    Apply(chaos *v1alpha1.PodHttpChaos) error
}