resource

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MsgKubectlConnection = "kubectl connection error\n"

	ResourceTypes = struct {
		StandalonePods  Type
		Deployment      Type
		StatefulSet     Type
		ConfigConnector Type
		CustomResource  Type
	}{
		StandalonePods:  "standalone-pods",
		Deployment:      "deployment",
		StatefulSet:     "statefulset",
		ConfigConnector: "config-connector-resource",
		CustomResource:  "custom-resource",
	}
)

Functions

This section is empty.

Types

type Group

type Group map[string]*Resource

func (Group) Add

func (r Group) Add(d *Resource)

func (Group) Contains

func (r Group) Contains(d *Resource) bool

func (Group) Reset

func (r Group) Reset()

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func NewResource

func NewResource(name string, rType Type, ns string, deadline time.Duration, tolerateFailures bool) *Resource

func (*Resource) CheckStatus

func (r *Resource) CheckStatus(ctx context.Context, cfg kubectl.Config)

func (*Resource) Deadline

func (r *Resource) Deadline() time.Duration

func (*Resource) HasEncounteredUnrecoverableError

func (r *Resource) HasEncounteredUnrecoverableError() bool

HasEncounteredUnrecoverableError goes through all pod statuses and return true if any cannot be recovered

func (*Resource) ID

func (r *Resource) ID() string

func (*Resource) IsStatusCheckCompleteOrCancelled

func (r *Resource) IsStatusCheckCompleteOrCancelled() bool

func (*Resource) MarkComplete

func (r *Resource) MarkComplete()

func (*Resource) Name

func (r *Resource) Name() string

func (*Resource) ReportSinceLastUpdated

func (r *Resource) ReportSinceLastUpdated(isMuted bool) string

func (*Resource) Status

func (r *Resource) Status() Status

func (*Resource) StatusCode

func (r *Resource) StatusCode() proto.StatusCode

StatusCode returns the rollout status code if the status check is cancelled or if no pod data exists for this rollout. If pods are fetched, this function returns the error code a pod container encountered.

func (*Resource) StatusMessage

func (r *Resource) StatusMessage() string

func (*Resource) String

func (r *Resource) String() string

func (*Resource) UpdateStatus

func (r *Resource) UpdateStatus(ae *proto.ActionableErr)

func (*Resource) WithPodStatuses

func (r *Resource) WithPodStatuses(scs []proto.StatusCode) *Resource

func (*Resource) WithValidator

func (r *Resource) WithValidator(pd diag.Diagnose) *Resource

type Status

type Status struct {
	// contains filtered or unexported fields
}

func (Status) ActionableError

func (rs Status) ActionableError() *proto.ActionableErr

func (Status) Equal

func (rs Status) Equal(other Status) bool

func (Status) Error

func (rs Status) Error() error

func (Status) String

func (rs Status) String() string

type Type

type Type string

Type represents a kubernetes resource type to health check.

Jump to

Keyboard shortcuts

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