workload

package
v0.0.0-...-9250c3b Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EnvVarChangedFields

func EnvVarChangedFields(existing nais_io_v1.EnvVars, merged nais_io_v1.EnvVars) []*activitylog.ResourceChangedField

func EnvVarsEqual

func EnvVarsEqual(a, b nais_io_v1.EnvVars) bool

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:"-"`
	Logging             *nais_io_v1.Logging      `json:"-"`
	DeletionStartedAt   *time.Time               `json:"deletedAt"`
}

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

func (b Base) GetLogging() *nais_io_v1.Logging

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

func (ContainerImage) IsActivityLogger()

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 EnvironmentWorkloadOrder

type EnvironmentWorkloadOrder struct {
	Field     EnvironmentWorkloadOrderField `json:"field"`
	Direction model.OrderDirection          `json:"direction"`
}

type EnvironmentWorkloadOrderField

type EnvironmentWorkloadOrderField string

func (EnvironmentWorkloadOrderField) IsValid

func (e EnvironmentWorkloadOrderField) IsValid() bool

func (EnvironmentWorkloadOrderField) MarshalGQL

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

func (EnvironmentWorkloadOrderField) String

func (*EnvironmentWorkloadOrderField) UnmarshalGQL

func (e *EnvironmentWorkloadOrderField) UnmarshalGQL(v any) error

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,omitempty"`
	States                   []string `json:"states,omitempty"`
	WorkloadStatusErrorTypes []string `json:"workloadStatusErrorTypes,omitempty"`
}

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
)

func TypeFromString

func TypeFromString(s string) (Type, error)

TypeFromString returns the Type for the given string. If the string does not match any known type, -1 is returned.

func (Type) String

func (t Type) String() string

type UpdateWorkloadEnvironmentVariableInput

type UpdateWorkloadEnvironmentVariableInput struct {
	Name  string  `json:"name"`
	Value *string `json:"value,omitempty"`
}

type Workload

type Workload interface {
	model.Node
	activitylog.ActivityLogger
	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
	GetLogging() *nais_io_v1.Logging

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

	// GetConfigs returns a list of config names used by the workload
	GetConfigs() []string
	Image() *ContainerImage
}

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

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 any) error

type WorkloadResourceQuantity

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

type WorkloadResources

type WorkloadResources interface {
	IsWorkloadResources()
}

Directories

Path Synopsis
Package secret provides operations for managing Kubernetes secrets.
Package secret provides operations for managing Kubernetes secrets.

Jump to

Keyboard shortcuts

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