Documentation ¶
Index ¶
- Constants
- Variables
- type AirflowConfigurableValues
- type AirflowValues
- type Client
- func (c Client) DeleteAirflow(ctx context.Context, teamID string, log logger.Logger) bool
- func (c Client) DeleteJupyter(ctx context.Context, teamID string, log logger.Logger) bool
- func (c Client) SyncAirflow(ctx context.Context, values AirflowConfigurableValues, log logger.Logger) bool
- func (c Client) SyncJupyter(ctx context.Context, values JupyterConfigurableValues, log logger.Logger) bool
- type JupyterConfigurableValues
Constants ¶
View Source
const ( TeamValueKeyRestrictEgress = "restrictEgress,omit" TeamValueKeyApiAccess = "apiAccess,omit" )
View Source
const TeamValueKeyPYPIAccess = "pypiAccess,omit"
Variables ¶
View Source
var ValidateAirflowImage validator.Func = func(fl validator.FieldLevel) bool { image := fl.Field().Interface().(string) if image == "" { return true } imageParts := strings.Split(image, ":") if len(imageParts) != 2 { return false } return strings.HasPrefix(imageParts[0], "ghcr.io/navikt/") || strings.HasPrefix(imageParts[0], "europe-north1-docker.pkg.dev") }
View Source
var ValidateAirflowRepo validator.Func = func(fl validator.FieldLevel) bool { repoName := fl.Field().Interface().(string) parts := strings.Split(repoName, "/") if len(parts) != 2 { return false } return parts[0] == "navikt" }
View Source
var ValidateCPUSpec validator.Func = func(fl validator.FieldLevel) bool { CPUSpec := fl.Field().Interface().(string) r, _ := regexp.Compile(`^(([0-9]+m?)|([0-9]+\.[0-9]+))$`) return r.MatchString(CPUSpec) }
View Source
var ValidateMemorySpec validator.Func = func(fl validator.FieldLevel) bool { memorySpec := fl.Field().Interface().(string) if _, err := strconv.ParseFloat(memorySpec, 64); err == nil { memorySpec = memorySpec + "G" } r, _ := regexp.Compile(`^(([0-9]+)|([0-9][.][0-9]+))(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)?$`) return r.MatchString(memorySpec) }
View Source
var ValidateRepoBranch validator.Func = func(fl validator.FieldLevel) bool { branch := fl.Field().Interface().(string) return !strings.Contains(branch, "/") }
Functions ¶
This section is empty.
Types ¶
type AirflowValues ¶
type AirflowValues struct { // User-configurable values AirflowConfigurableValues FernetKey string // Knorten sets Helm value pointing to k8s secret PostgresPassword string // Knorten sets Helm value pointing to k8s secret WebserverSecretKey string // Knorten sets Helm value pointing to k8s secret // Generated Helm config ExtraEnvs string `helm:"env"` WebserverEnv string `helm:"webserver.env"` WebserverServiceAccount string `helm:"webserver.serviceAccount.name"` WorkerServiceAccount string `helm:"workers.serviceAccount.name"` WorkerLabels string `helm:"workers.labels"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) DeleteAirflow ¶
func (Client) DeleteJupyter ¶
func (Client) SyncAirflow ¶
func (Client) SyncJupyter ¶
type JupyterConfigurableValues ¶
type JupyterConfigurableValues struct { TeamID string UserIdents []string // User-configurable values CPULimit string `helm:"singleuser.cpu.limit"` CPURequest string `helm:"singleuser.cpu.guarantee"` MemoryLimit string `helm:"singleuser.memory.limit"` MemoryRequest string `helm:"singleuser.memory.guarantee"` ImageName string `helm:"singleuser.image.name"` ImageTag string `helm:"singleuser.image.tag"` CullTimeout string `helm:"cull.timeout"` PYPIAccess bool AllowList []string }
Click to show internal directories.
Click to hide internal directories.