v1

package
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugAttachmentCrd = crd.NewCrd("squash.solo.io",
	"debugattachments",
	"squash.solo.io",
	"v1",
	"DebugAttachment",
	"debatt",
	false,
	&DebugAttachment{})
View Source
var DebugAttachment_State_name = map[int32]string{
	0: "RequestingAttachment",
	1: "PendingAttachment",
	2: "Attached",
	3: "RequestingDelete",
	4: "PendingDelete",
}
View Source
var DebugAttachment_State_value = map[string]int32{
	"RequestingAttachment": 0,
	"PendingAttachment":    1,
	"Attached":             2,
	"RequestingDelete":     3,
	"PendingDelete":        4,
}

Functions

func GenDebugAttachmentName

func GenDebugAttachmentName(pod, container string) string

TODO(mitchdraft) - this should error check for length TODO(mitchdraft) - this should include process id so that we can have multiple debuggers on the same container TODO(mitchdraft) - generated identifier should be applied as a label - the point is to make the resource queriable

Types

type ApiEmitter

type ApiEmitter interface {
	Register() error
	DebugAttachment() DebugAttachmentClient
	Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *ApiSnapshot, <-chan error, error)
}

func NewApiEmitter

func NewApiEmitter(debugAttachmentClient DebugAttachmentClient) ApiEmitter

func NewApiEmitterWithEmit

func NewApiEmitterWithEmit(debugAttachmentClient DebugAttachmentClient, emit <-chan struct{}) ApiEmitter

type ApiEventLoop

type ApiEventLoop interface {
	Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}

func NewApiEventLoop

func NewApiEventLoop(emitter ApiEmitter, syncer ApiSyncer) ApiEventLoop

type ApiSnapshot

type ApiSnapshot struct {
	Debugattachments DebugattachmentsByNamespace
}

func (ApiSnapshot) Clone

func (s ApiSnapshot) Clone() ApiSnapshot

func (ApiSnapshot) Hash

func (s ApiSnapshot) Hash() uint64

func (ApiSnapshot) HashFields

func (s ApiSnapshot) HashFields() []zap.Field

func (ApiSnapshot) Stringer

func (s ApiSnapshot) Stringer() ApiSnapshotStringer

type ApiSnapshotStringer

type ApiSnapshotStringer struct {
	Version          uint64
	Debugattachments []string
}

func (ApiSnapshotStringer) String

func (ss ApiSnapshotStringer) String() string

type ApiSyncer

type ApiSyncer interface {
	Sync(context.Context, *ApiSnapshot) error
}

type ApiSyncers

type ApiSyncers []ApiSyncer

func (ApiSyncers) Sync

func (s ApiSyncers) Sync(ctx context.Context, snapshot *ApiSnapshot) error

type DebugAttachment

type DebugAttachment struct {
	Metadata             core.Metadata         `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"`
	Status               core.Status           `protobuf:"bytes,2,opt,name=status,proto3" json:"status" testdiff:"ignore"`
	PlankName            string                `protobuf:"bytes,3,opt,name=plank_name,json=plankName,proto3" json:"plank_name,omitempty"`
	Debugger             string                `protobuf:"bytes,4,opt,name=debugger,proto3" json:"debugger,omitempty"`
	Image                string                `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"`
	ProcessName          string                `protobuf:"bytes,6,opt,name=process_name,json=processName,proto3" json:"process_name,omitempty"`
	Node                 string                `protobuf:"bytes,7,opt,name=node,proto3" json:"node,omitempty"`
	MatchRequest         bool                  `protobuf:"varint,8,opt,name=match_request,json=matchRequest,proto3" json:"match_request,omitempty"`
	DebugServerAddress   string                `protobuf:"bytes,9,opt,name=debug_server_address,json=debugServerAddress,proto3" json:"debug_server_address,omitempty"`
	Pod                  string                `protobuf:"bytes,11,opt,name=pod,proto3" json:"pod,omitempty"`
	Container            string                `protobuf:"bytes,12,opt,name=container,proto3" json:"container,omitempty"`
	DebugNamespace       string                `protobuf:"bytes,13,opt,name=debug_namespace,json=debugNamespace,proto3" json:"debug_namespace,omitempty"`
	State                DebugAttachment_State `protobuf:"varint,20,opt,name=state,proto3,enum=squash.solo.io.DebugAttachment_State" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

@solo-kit:resource.short_name=debatt @solo-kit:resource.plural_name=debugattachments @solo-kit:resource.resource_groups=api.squash.solo.io

Attachments store the information needed for squash to coordinate a debugging session

func NewDebugAttachment

func NewDebugAttachment(namespace, name string) *DebugAttachment

TODO: modify as needed to populate additional fields

func (*DebugAttachment) DeepCopyObject

func (o *DebugAttachment) DeepCopyObject() runtime.Object

func (*DebugAttachment) Descriptor

func (*DebugAttachment) Descriptor() ([]byte, []int)

func (*DebugAttachment) Equal

func (this *DebugAttachment) Equal(that interface{}) bool

func (*DebugAttachment) GetContainer

func (m *DebugAttachment) GetContainer() string

func (*DebugAttachment) GetDebugNamespace

func (m *DebugAttachment) GetDebugNamespace() string

func (*DebugAttachment) GetDebugServerAddress

func (m *DebugAttachment) GetDebugServerAddress() string

func (*DebugAttachment) GetDebugger

func (m *DebugAttachment) GetDebugger() string

func (*DebugAttachment) GetImage

func (m *DebugAttachment) GetImage() string

func (*DebugAttachment) GetMatchRequest

func (m *DebugAttachment) GetMatchRequest() bool

func (*DebugAttachment) GetMetadata

func (m *DebugAttachment) GetMetadata() core.Metadata

func (*DebugAttachment) GetNode

func (m *DebugAttachment) GetNode() string

func (*DebugAttachment) GetObjectKind

func (o *DebugAttachment) GetObjectKind() schema.ObjectKind

func (*DebugAttachment) GetPlankName

func (m *DebugAttachment) GetPlankName() string

func (*DebugAttachment) GetPod

func (m *DebugAttachment) GetPod() string

func (*DebugAttachment) GetPortFromDebugServerAddress

func (m *DebugAttachment) GetPortFromDebugServerAddress() (int, error)

func (*DebugAttachment) GetProcessName

func (m *DebugAttachment) GetProcessName() string

func (*DebugAttachment) GetState

func (m *DebugAttachment) GetState() DebugAttachment_State

func (*DebugAttachment) GetStatus

func (m *DebugAttachment) GetStatus() core.Status

func (*DebugAttachment) Hash

func (r *DebugAttachment) Hash() uint64

func (*DebugAttachment) ProtoMessage

func (*DebugAttachment) ProtoMessage()

func (*DebugAttachment) Reset

func (m *DebugAttachment) Reset()

func (*DebugAttachment) SetMetadata

func (r *DebugAttachment) SetMetadata(meta core.Metadata)

func (*DebugAttachment) SetStatus

func (r *DebugAttachment) SetStatus(status core.Status)

func (*DebugAttachment) String

func (m *DebugAttachment) String() string

func (*DebugAttachment) XXX_DiscardUnknown

func (m *DebugAttachment) XXX_DiscardUnknown()

func (*DebugAttachment) XXX_Marshal

func (m *DebugAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DebugAttachment) XXX_Merge

func (m *DebugAttachment) XXX_Merge(src proto.Message)

func (*DebugAttachment) XXX_Size

func (m *DebugAttachment) XXX_Size() int

func (*DebugAttachment) XXX_Unmarshal

func (m *DebugAttachment) XXX_Unmarshal(b []byte) error

type DebugAttachmentClient

type DebugAttachmentClient interface {
	BaseClient() clients.ResourceClient
	Register() error
	Read(namespace, name string, opts clients.ReadOpts) (*DebugAttachment, error)
	Write(resource *DebugAttachment, opts clients.WriteOpts) (*DebugAttachment, error)
	Delete(namespace, name string, opts clients.DeleteOpts) error
	List(namespace string, opts clients.ListOpts) (DebugAttachmentList, error)
	Watch(namespace string, opts clients.WatchOpts) (<-chan DebugAttachmentList, <-chan error, error)
}

func NewDebugAttachmentClient

func NewDebugAttachmentClient(rcFactory factory.ResourceClientFactory) (DebugAttachmentClient, error)

func NewDebugAttachmentClientWithBase

func NewDebugAttachmentClientWithBase(rc clients.ResourceClient) DebugAttachmentClient

func NewDebugAttachmentClientWithToken

func NewDebugAttachmentClientWithToken(rcFactory factory.ResourceClientFactory, token string) (DebugAttachmentClient, error)

type DebugAttachmentList

type DebugAttachmentList []*DebugAttachment

func (DebugAttachmentList) AsInputResources

func (list DebugAttachmentList) AsInputResources() resources.InputResourceList

func (DebugAttachmentList) AsInterfaces

func (list DebugAttachmentList) AsInterfaces() []interface{}

func (DebugAttachmentList) AsResources

func (list DebugAttachmentList) AsResources() resources.ResourceList

func (DebugAttachmentList) Clone

func (DebugAttachmentList) Each

func (list DebugAttachmentList) Each(f func(element *DebugAttachment))

func (DebugAttachmentList) Find

func (list DebugAttachmentList) Find(namespace, name string) (*DebugAttachment, error)

namespace is optional, if left empty, names can collide if the list contains more than one with the same name

func (DebugAttachmentList) Names

func (list DebugAttachmentList) Names() []string

func (DebugAttachmentList) NamespacesDotNames

func (list DebugAttachmentList) NamespacesDotNames() []string

func (DebugAttachmentList) Sort

type DebugAttachmentReconciler

type DebugAttachmentReconciler interface {
	Reconcile(namespace string, desiredResources DebugAttachmentList, transition TransitionDebugAttachmentFunc, opts clients.ListOpts) error
}

func NewDebugAttachmentReconciler

func NewDebugAttachmentReconciler(client DebugAttachmentClient) DebugAttachmentReconciler

type DebugAttachment_State

type DebugAttachment_State int32
const (
	// Newly created DebugAttachments have state RequestingAttachment
	DebugAttachment_RequestingAttachment DebugAttachment_State = 0
	// When the event loop begins fullfilling an attachment request it sets
	// DebugAttachments state to PendingAttachment
	DebugAttachment_PendingAttachment DebugAttachment_State = 1
	// When squash client successfully attaches, it sets state to Attached
	DebugAttachment_Attached DebugAttachment_State = 2
	// Indicates that user has requested an attachment be removed
	DebugAttachment_RequestingDelete DebugAttachment_State = 3
	// When the event loop begins fullfilling a delete request it sets this
	// status and triggers a cleanup routine
	// When the cleanup routine completes, it deletes the CRD
	DebugAttachment_PendingDelete DebugAttachment_State = 4
)

func (DebugAttachment_State) EnumDescriptor

func (DebugAttachment_State) EnumDescriptor() ([]byte, []int)

func (DebugAttachment_State) String

func (x DebugAttachment_State) String() string

type DebugattachmentsByNamespace

type DebugattachmentsByNamespace map[string]DebugAttachmentList

func (DebugattachmentsByNamespace) Add

func (byNamespace DebugattachmentsByNamespace) Add(debugAttachment ...*DebugAttachment)

func (DebugattachmentsByNamespace) Clear

func (byNamespace DebugattachmentsByNamespace) Clear(namespace string)

func (DebugattachmentsByNamespace) Clone

func (DebugattachmentsByNamespace) List

type Intent

type Intent struct {
	// type of debugger to use
	Debugger string `protobuf:"bytes,1,opt,name=debugger,proto3" json:"debugger,omitempty"`
	// pod to debug
	Pod *core.ResourceRef `protobuf:"bytes,2,opt,name=pod,proto3" json:"pod,omitempty"`
	// name of container to debug
	ContainerName string `protobuf:"bytes,3,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"`
	// NOT YET IMPLEMENTED
	// if a container has multiple processes and you do not want to debug the first process, this string is used to select a specific process
	ProcessMatcher       string   `protobuf:"bytes,4,opt,name=process_matcher,json=processMatcher,proto3" json:"process_matcher,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Describes the user's debug intentions

func (*Intent) Descriptor

func (*Intent) Descriptor() ([]byte, []int)

func (*Intent) Equal

func (this *Intent) Equal(that interface{}) bool

func (*Intent) GenerateLabels

func (di *Intent) GenerateLabels() map[string]string

func (*Intent) GetContainerName

func (m *Intent) GetContainerName() string

func (*Intent) GetDebugAttachment

func (di *Intent) GetDebugAttachment(daClient DebugAttachmentClient) (*DebugAttachment, error)

For a given debug Intent, finds the corresponding DebugAttachment, errors if there is not exactly one match

func (*Intent) GetDebugAttachments

func (di *Intent) GetDebugAttachments(daClient DebugAttachmentClient) (DebugAttachmentList, error)

For a given debug Intent, finds the corresponding DebugAttachments Note, under normal operation, there should only ever be on match. This function exists for handling possible error states.

func (*Intent) GetDebugger

func (m *Intent) GetDebugger() string

func (*Intent) GetPod

func (m *Intent) GetPod() *core.ResourceRef

func (*Intent) GetProcessMatcher

func (m *Intent) GetProcessMatcher() string

func (*Intent) ProtoMessage

func (*Intent) ProtoMessage()

func (*Intent) Reset

func (m *Intent) Reset()

func (*Intent) String

func (m *Intent) String() string

func (*Intent) XXX_DiscardUnknown

func (m *Intent) XXX_DiscardUnknown()

func (*Intent) XXX_Marshal

func (m *Intent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Intent) XXX_Merge

func (m *Intent) XXX_Merge(src proto.Message)

func (*Intent) XXX_Size

func (m *Intent) XXX_Size() int

func (*Intent) XXX_Unmarshal

func (m *Intent) XXX_Unmarshal(b []byte) error

type Plank

type Plank struct {
	// plank pod reference
	Pod *core.ResourceRef `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"`
	// indicates when plank has completed the debugger-specify preparation
	ReadyForConnect      bool     `protobuf:"varint,2,opt,name=ready_for_connect,json=readyForConnect,proto3" json:"ready_for_connect,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Describes the pod squash spawns for managing a particular debug session

func (*Plank) Descriptor

func (*Plank) Descriptor() ([]byte, []int)

func (*Plank) Equal

func (this *Plank) Equal(that interface{}) bool

func (*Plank) GetPod

func (m *Plank) GetPod() *core.ResourceRef

func (*Plank) GetReadyForConnect

func (m *Plank) GetReadyForConnect() bool

func (*Plank) ProtoMessage

func (*Plank) ProtoMessage()

func (*Plank) Reset

func (m *Plank) Reset()

func (*Plank) String

func (m *Plank) String() string

func (*Plank) XXX_DiscardUnknown

func (m *Plank) XXX_DiscardUnknown()

func (*Plank) XXX_Marshal

func (m *Plank) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Plank) XXX_Merge

func (m *Plank) XXX_Merge(src proto.Message)

func (*Plank) XXX_Size

func (m *Plank) XXX_Size() int

func (*Plank) XXX_Unmarshal

func (m *Plank) XXX_Unmarshal(b []byte) error

type PortSpec

type PortSpec struct {
	// Types that are valid to be assigned to PortLocation:
	//	*PortSpec_Plank
	//	*PortSpec_Target
	PortLocation         isPortSpec_PortLocation `protobuf_oneof:"port_location"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

Contains port information needed to connect or find a debugger

func (*PortSpec) Descriptor

func (*PortSpec) Descriptor() ([]byte, []int)

func (*PortSpec) Equal

func (this *PortSpec) Equal(that interface{}) bool

func (*PortSpec) GetPlank

func (m *PortSpec) GetPlank() string

func (*PortSpec) GetPortLocation

func (m *PortSpec) GetPortLocation() isPortSpec_PortLocation

func (*PortSpec) GetTarget

func (m *PortSpec) GetTarget() string

func (*PortSpec) ProtoMessage

func (*PortSpec) ProtoMessage()

func (*PortSpec) Reset

func (m *PortSpec) Reset()

func (*PortSpec) String

func (m *PortSpec) String() string

func (*PortSpec) XXX_DiscardUnknown

func (m *PortSpec) XXX_DiscardUnknown()

func (*PortSpec) XXX_Marshal

func (m *PortSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PortSpec) XXX_Merge

func (m *PortSpec) XXX_Merge(src proto.Message)

func (*PortSpec) XXX_OneofFuncs

func (*PortSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*PortSpec) XXX_Size

func (m *PortSpec) XXX_Size() int

func (*PortSpec) XXX_Unmarshal

func (m *PortSpec) XXX_Unmarshal(b []byte) error

type PortSpec_Plank

type PortSpec_Plank struct {
	Plank string `protobuf:"bytes,1,opt,name=plank,proto3,oneof"`
}

func (*PortSpec_Plank) Equal

func (this *PortSpec_Plank) Equal(that interface{}) bool

type PortSpec_Target

type PortSpec_Target struct {
	Target string `protobuf:"bytes,2,opt,name=target,proto3,oneof"`
}

func (*PortSpec_Target) Equal

func (this *PortSpec_Target) Equal(that interface{}) bool

type TransitionDebugAttachmentFunc

type TransitionDebugAttachmentFunc func(original, desired *DebugAttachment) (bool, error)

Option to copy anything from the original to the desired before writing. Return value of false means don't update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL