util

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationNameLabel = "application.apps.nine.ch/name"
	ManagedByAnnotation  = "app.kubernetes.io/managed-by"
	NctlName             = "nctl"
	PrivateKeySecretKey  = "privatekey"
	UsernameSecretKey    = "username"
	PasswordSecretKey    = "password"

	// DNSSetupURL redirects to the proper deplo.io docs entry about
	// how to setup custom hosts
	DNSSetupURL = "https://docs.nine.ch/a/myshbw3EY1"
	NoneText    = "<none>"
)
View Source
const (
	// BasicAuth key constants which represent the keys used in basic auth
	// secrets
	BasicAuthUsernameKey = "basicAuthUsername"
	BasicAuthPasswordKey = "basicAuthPassword"
)

Variables

This section is empty.

Functions

func EnvVarByName added in v1.2.3

func EnvVarByName(envVars apps.EnvVars, name string) *apps.EnvVar

func EnvVarToString

func EnvVarToString(envs apps.EnvVars) string

func EnvVarsFromMap

func EnvVarsFromMap(env map[string]string) apps.EnvVars

func GitAuthSecretName

func GitAuthSecretName(app *apps.Application) string

GitAuthSecretName returns the name of the secret which contains the git credentials for the given applications git source

func OrderReleaseList added in v1.7.0

func OrderReleaseList(releaseList *apps.ReleaseList)

OrderReleaseList orders the given list of releases, moving the latest release to the beginning of the list

func ReloginNeeded added in v1.7.6

func ReloginNeeded(err error) error

ReloginNeeded returns an error which outputs the given err with a message saying that a re-login is needed.

func UnverifiedAppHosts

func UnverifiedAppHosts(app *apps.Application) []string

func UpdateEnvVars added in v1.2.3

func UpdateEnvVars(oldEnvs []apps.EnvVar, newEnvs map[string]string, toDelete []string) apps.EnvVars

func ValidatePEM added in v1.3.0

func ValidatePEM(content string) (*string, error)

ValidatePEM validates if the passed content is in valid PEM format, errors out if the content is empty

func VerifiedAppHosts

func VerifiedAppHosts(app *apps.Application) []string

Types

type BasicAuth added in v1.1.1

type BasicAuth struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

BasicAuth contains credentials for basic authentication

func NewBasicAuthFromSecret added in v1.1.1

func NewBasicAuthFromSecret(ctx context.Context, secret meta.Reference, client *api.Client) (*BasicAuth, error)

NewBasicAuthFromSecret returns a basic auth resource filled with data from a secret.

type DNSDetail added in v1.2.2

type DNSDetail struct {
	Application string `yaml:"application"`
	Project     string `yaml:"project"`
	TXTRecord   string `yaml:"txtRecord"`
	CNAMETarget string `yaml:"cnameTarget"`
}

func GatherDNSDetails added in v1.2.2

func GatherDNSDetails(items []apps.Application) []DNSDetail

GatherDNSDetails retrieves the DNS details of all given applications

type GitAuth

type GitAuth struct {
	Username      *string
	Password      *string
	SSHPrivateKey *string
}

func GitAuthFromApp added in v1.4.0

func GitAuthFromApp(ctx context.Context, client *api.Client, app *apps.Application) (GitAuth, error)

func (GitAuth) Enabled

func (git GitAuth) Enabled() bool

Enabled returns true if any kind of credentials are set in the GitAuth

func (GitAuth) HasBasicAuth added in v1.3.0

func (git GitAuth) HasBasicAuth() bool

func (GitAuth) HasPrivateKey added in v1.3.0

func (git GitAuth) HasPrivateKey() bool

func (GitAuth) Secret

func (git GitAuth) Secret(app *apps.Application) *corev1.Secret

func (GitAuth) UpdateSecret

func (git GitAuth) UpdateSecret(secret *corev1.Secret)

UpdateSecret replaces the data of the secret with the data from GitAuth. Only replaces fields which are non-nil.

func (GitAuth) Valid added in v1.2.1

func (git GitAuth) Valid() error

Valid validates the credentials in the GitAuth

Jump to

Keyboard shortcuts

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