workload

package
v0.0.0-...-2a06ba9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetPod

func GetPod(ctx context.Context, environmentName string, teamSlug slug.Slug, instanceName string) (*v1.Pod, error)

func ListAllPods

func ListAllPods(ctx context.Context, environmentName string, teamSlug slug.Slug, workloadName string) ([]*v1.Pod, error)

func ListAllPodsForJob

func ListAllPodsForJob(ctx context.Context, environmentName string, teamSlug slug.Slug, jobName string) ([]*v1.Pod, error)

func NewLoaderContext

func NewLoaderContext(ctx context.Context, podWatcher *watcher.Watcher[*corev1.Pod]) context.Context

func NewWatcher

func NewWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*corev1.Pod]

Types

type ApplicationAuthIntegrations

type ApplicationAuthIntegrations interface {
	AuthIntegration
}

type AuthIntegration

type AuthIntegration interface {
	IsAuthIntegration()
}

type Base

type Base struct {
	Name                string                   `json:"name"`
	EnvironmentName     string                   `json:"-"`
	TeamSlug            slug.Slug                `json:"-"`
	ImageString         string                   `json:"-"`
	Conditions          []metav1.Condition       `json:"-"`
	AccessPolicy        *nais_io_v1.AccessPolicy `json:"-"`
	Annotations         map[string]string        `json:"-"`
	RolloutCompleteTime int64                    `json:"-"`
	Type                Type                     `json:"-"`
}

func (Base) GetAccessPolicy

func (b Base) GetAccessPolicy() *nais_io_v1.AccessPolicy

func (Base) GetAnnotations

func (b Base) GetAnnotations() map[string]string

func (Base) GetConditions

func (b Base) GetConditions() []metav1.Condition

func (Base) GetEnvironmentName

func (b Base) GetEnvironmentName() string

func (Base) GetImageString

func (b Base) GetImageString() string

func (Base) GetName

func (b Base) GetName() string

func (Base) GetRolloutCompleteTime

func (b Base) GetRolloutCompleteTime() int64

func (Base) GetTeamSlug

func (b Base) GetTeamSlug() slug.Slug

func (Base) GetType

func (b Base) GetType() Type

func (Base) Image

func (b Base) Image() *ContainerImage

type ContainerImage

type ContainerImage struct {
	Name string `json:"name"`
	Tag  string `json:"tag"`
}

func (ContainerImage) ID

func (c ContainerImage) ID() ident.Ident

func (ContainerImage) IsNode

func (ContainerImage) IsNode()

func (ContainerImage) Ref

func (c ContainerImage) Ref() string

type EntraIDAuthIntegration

type EntraIDAuthIntegration struct{}

func GetEntraIDAuthIntegrationForApplication

func GetEntraIDAuthIntegrationForApplication(azure *nais_io_v1.Azure) *EntraIDAuthIntegration

func GetEntraIDAuthIntegrationForJob

func GetEntraIDAuthIntegrationForJob(azure *nais_io_v1.AzureNaisJob) *EntraIDAuthIntegration

func (EntraIDAuthIntegration) IsAuthIntegration

func (EntraIDAuthIntegration) IsAuthIntegration()

func (EntraIDAuthIntegration) Name

type IDPortenAuthIntegration

type IDPortenAuthIntegration struct{}

func GetIDPortenAuthIntegration

func GetIDPortenAuthIntegration(idp *nais_io_v1.IDPorten) *IDPortenAuthIntegration

func (IDPortenAuthIntegration) IsAuthIntegration

func (IDPortenAuthIntegration) IsAuthIntegration()

func (IDPortenAuthIntegration) Name

type JobAuthIntegrations

type JobAuthIntegrations interface {
	AuthIntegration
}

type MaskinportenAuthIntegration

type MaskinportenAuthIntegration struct{}

func (MaskinportenAuthIntegration) IsAuthIntegration

func (MaskinportenAuthIntegration) IsAuthIntegration()

func (MaskinportenAuthIntegration) Name

type Reference

type Reference struct {
	// Name is the name of the referenced workload.
	Name string

	// Type is the type of the referenced workload.
	Type Type
}

func ReferenceFromOwnerReferences

func ReferenceFromOwnerReferences(ownerReferences []metav1.OwnerReference) *Reference

ReferenceFromOwnerReferences returns a Reference for the first valid owner reference. If none can be found, nil is returned.

type TeamWorkloadsFilter

type TeamWorkloadsFilter struct {
	Environments []string `json:"environments"`
}

type TokenXAuthIntegration

type TokenXAuthIntegration struct{}

func GetTokenXAuthIntegration

func GetTokenXAuthIntegration(tx *nais_io_v1.TokenX) *TokenXAuthIntegration

func (TokenXAuthIntegration) IsAuthIntegration

func (TokenXAuthIntegration) IsAuthIntegration()

func (TokenXAuthIntegration) Name

type Type

type Type int
const (
	TypeApplication Type = iota
	TypeJob
)

type Workload

type Workload interface {
	model.Node
	IsWorkload()
	GetName() string
	GetEnvironmentName() string
	GetTeamSlug() slug.Slug
	GetImageString() string
	GetAccessPolicy() *nais_io_v1.AccessPolicy
	GetConditions() []metav1.Condition
	GetAnnotations() map[string]string
	GetRolloutCompleteTime() int64
	GetType() Type

	// GetSecrets returns a list of secret names used by the workload
	GetSecrets() []string
}

type WorkloadConnection

type WorkloadConnection = pagination.Connection[Workload]

type WorkloadEdge

type WorkloadEdge = pagination.Edge[Workload]

type WorkloadManifest

type WorkloadManifest interface {
	IsWorkloadManifest()
}

type WorkloadOrder

type WorkloadOrder struct {
	Field     WorkloadOrderField   `json:"field"`
	Direction model.OrderDirection `json:"direction"`
}

type WorkloadOrderField

type WorkloadOrderField string
const (
	WorkloadOrderFieldName           WorkloadOrderField = "NAME"
	WorkloadOrderFieldStatus         WorkloadOrderField = "STATUS"
	WorkloadOrderFieldEnvironment    WorkloadOrderField = "ENVIRONMENT"
	WorkloadOrderFieldDeploymentTime WorkloadOrderField = "DEPLOYMENT_TIME"
)

func (WorkloadOrderField) IsValid

func (e WorkloadOrderField) IsValid() bool

func (WorkloadOrderField) MarshalGQL

func (e WorkloadOrderField) MarshalGQL(w io.Writer)

func (WorkloadOrderField) String

func (e WorkloadOrderField) String() string

func (*WorkloadOrderField) UnmarshalGQL

func (e *WorkloadOrderField) UnmarshalGQL(v interface{}) error

type WorkloadResourceQuantity

type WorkloadResourceQuantity struct {
	CPU    float64 `json:"cpu"`
	Memory int64   `json:"memory"`
}

type WorkloadResources

type WorkloadResources interface {
	IsWorkloadResources()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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