Documentation ¶
Index ¶
- Constants
- Variables
- func BuildEnvironmentAnnotations() map[string]string
- func ErrorStatus(status *pb.DeploymentStatus) error
- func InitConfig(cfg *Config)
- func InjectAnnotations(resource json.RawMessage, annotations map[string]string) (json.RawMessage, error)
- func MakeDeploymentRequest(cfg Config, deadline time.Time, kubernetes *pb.Kubernetes) *pb.DeploymentRequest
- func MultiDocumentFileAsJSON(path string, ctx TemplateVariables) ([]json.RawMessage, error)
- func NewGrpcConnection(cfg Config) (*grpc.ClientConn, error)
- func Prepare(ctx context.Context, cfg *Config) (*pb.DeploymentRequest, error)
- func SetupLogging(cfg Config)
- type ActionsFormatter
- type Config
- type Deployer
- type Error
- type ExitCode
- type TemplateVariables
Constants ¶
View Source
const ( DefaultRef = "master" DefaultOwner = "navikt" DefaultDeployServer = "deploy.nav.cloud.nais.io:443" DefaultOtelCollectorEndpoint = "https://collector-internet.external.prod-gcp.nav.cloud.nais.io" DefaultTracingDashboardURL = "https://grafana.nav.cloud.nais.io/d/cdxgyzr3rikn4a/deploy-tracing-drilldown?var-trace_id=" DefaultDeployTimeout = time.Minute * 10 )
View Source
const ( DeployClientVersion = "deploy.nais.io/client-version" GithubWorkflowRunURL = "deploy.nais.io/github-workflow-run-url" )
Variables ¶
View Source
var ( ErrResourceRequired = errors.New("at least one Kubernetes resource is required to make sense of the deployment") ErrAuthRequired = errors.New("Github token or API key required") ErrClusterRequired = errors.New("cluster required; see reference section in the documentation for available environments") ErrMalformedAPIKey = errors.New("API key must be a hex encoded string") ErrInvalidTelemetryFormat = errors.New("telemetry input format malformed") )
Functions ¶
func BuildEnvironmentAnnotations ¶
https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
func ErrorStatus ¶
func ErrorStatus(status *pb.DeploymentStatus) error
func InitConfig ¶
func InitConfig(cfg *Config)
func InjectAnnotations ¶
func InjectAnnotations(resource json.RawMessage, annotations map[string]string) (json.RawMessage, error)
func MakeDeploymentRequest ¶
func MakeDeploymentRequest(cfg Config, deadline time.Time, kubernetes *pb.Kubernetes) *pb.DeploymentRequest
func MultiDocumentFileAsJSON ¶
func MultiDocumentFileAsJSON(path string, ctx TemplateVariables) ([]json.RawMessage, error)
func NewGrpcConnection ¶
func NewGrpcConnection(cfg Config) (*grpc.ClientConn, error)
func SetupLogging ¶
func SetupLogging(cfg Config)
Types ¶
type ActionsFormatter ¶
type ActionsFormatter struct{}
type Config ¶
type Config struct { APIKey string Actions bool Cluster string DeployServerURL string DryRun bool Environment string GithubToken string GrpcAuthentication bool GrpcUseTLS bool Owner string PollInterval time.Duration PrintPayload bool Quiet bool Ref string Repository string Resource []string Retry bool RetryInterval time.Duration Team string Traceparent string TelemetryInput string Telemetry *telemetry.PipelineTimings Timeout time.Duration TracingDashboardURL string OpenTelemetryCollectorURL string Variables []string VariablesFile string Wait bool }
type Deployer ¶
type Deployer struct {
Client pb.DeployClient
}
type ExitCode ¶
type ExitCode int
const ( ExitSuccess ExitCode = iota ExitDeploymentFailure ExitDeploymentError ExitDeploymentInactive ExitNoDeployment ExitInvocationFailure ExitInternalError ExitTemplateError ExitTimeout )
Keep separate to avoid skewing exit codes
func ErrorExitCode ¶
type TemplateVariables ¶
type TemplateVariables map[string]interface{}
Click to show internal directories.
Click to hide internal directories.