resource

package
v1.39.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 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
	}{
		StandalonePods:  "standalone-pods",
		Deployment:      "deployment",
		StatefulSet:     "statefulset",
		ConfigConnector: "config-connector-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 added in v1.33.0

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

func NewResource added in v1.33.0

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

func (*Resource) CheckStatus added in v1.33.0

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

func (*Resource) Deadline added in v1.33.0

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

func (*Resource) HasEncounteredUnrecoverableError added in v1.33.0

func (r *Resource) HasEncounteredUnrecoverableError() bool

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

func (*Resource) ID added in v1.33.0

func (r *Resource) ID() string

func (*Resource) IsStatusCheckCompleteOrCancelled added in v1.33.0

func (r *Resource) IsStatusCheckCompleteOrCancelled() bool

func (*Resource) MarkComplete added in v1.33.0

func (r *Resource) MarkComplete()

func (*Resource) Name added in v1.33.0

func (r *Resource) Name() string

func (*Resource) ReportSinceLastUpdated added in v1.33.0

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

ReportSinceLastUpdated returns a string representing rollout status along with tab header e.g.

  • testNs:deployment/leeroy-app: waiting for rollout to complete. (1/2) pending
  • testNs:pod/leeroy-app-xvbg : error pulling container image

func (*Resource) Status added in v1.33.0

func (r *Resource) Status() Status

func (*Resource) StatusCode added in v1.33.0

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 added in v1.33.0

func (r *Resource) StatusMessage() string

func (*Resource) String added in v1.33.0

func (r *Resource) String() string

func (*Resource) UpdateStatus added in v1.33.0

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

func (*Resource) WithPodStatuses added in v1.33.0

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

func (*Resource) WithValidator added in v1.33.0

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 added in v1.33.0

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