Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Commit

Permalink
Rename config params user_registration_role -> userRegistrationRole,
Browse files Browse the repository at this point in the history
enableroutes -> enableRoutes

Use camel case to align with the Kubernetes conventions.

Examples of the authentication configuration:

1. Require no authentication (this is the default if no authentication
configuration is specified):

apiVersion: airflow.apache.org/v1alpha1
kind: AirflowCluster
metadata:
  name: pk-cluster
spec:
  ui:
    authentication:
      type: none

2. Log in with OpenShift. In this example, users are assigned the Admin role upon
successful login:

apiVersion: airflow.apache.org/v1alpha1
kind: AirflowCluster
metadata:
  name: pk-cluster
spec:
  ui:
    enableRoutes: true
    authentication:
      type: openshift
      userRegistrationRole: Admin

3. Authenticate users against the database. This assumes, that users have been
created in the Airflow's database ahead of time, for example by using the airflow
create_user command, see also:
https://airflow.apache.org/docs/stable/cli-ref#create_user

apiVersion: airflow.apache.org/v1alpha1
kind: AirflowCluster
metadata:
  name: pk-cluster
spec:
  ui:
    enableRoutes: true
    authentication:
      type: database
  • Loading branch information
noseka1 committed Feb 21, 2021
1 parent c7bb1b8 commit 69f9357
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/airflowcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ type FlowerSpec struct {
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// EnableRoutes exposes Flower via OpenShit route.
// +optional
EnableRoutes bool `json:"enableroutes,omitempty"`
EnableRoutes bool `json:"enableRoutes,omitempty"`
}

func (s *FlowerSpec) validate(fp *field.Path) field.ErrorList {
Expand Down Expand Up @@ -239,7 +239,7 @@ type AirflowUISpec struct {
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// EnableRoutes exposes the Airflow UI via OpenShit route.
// +optional
EnableRoutes bool `json:"enableroutes,omitempty"`
EnableRoutes bool `json:"enableRoutes,omitempty"`
// Authentication defines the user authentication for Airflow UI.
// +optional
Authentication *AirflowUIAuthentication `json:"authentication,omitempty"`
Expand Down Expand Up @@ -475,7 +475,7 @@ type AirflowUIAuthentication struct {
// database. This setting directly translates to the AUTH_USER_REGISTRATION_ROLE setting
// in webserver_config.py. Airflow ships with a set of roles by default: Admin, User, Op,
// Viewer, Public.
UserRegistrationRole string `json:"user_registration_role,omitempty"`
UserRegistrationRole string `json:"userRegistrationRole,omitempty"`
}

// AirflowClusterStatus defines the observed state of AirflowCluster
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/airflow.apache.org_airflowclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ spec:
flower:
description: Spec for Flower component.
properties:
enableroutes:
enableRoutes:
description: EnableRoutes exposes Flower via OpenShit route.
type: boolean
image:
Expand Down Expand Up @@ -1447,15 +1447,15 @@ spec:
database = users stored in the database can log in, openshift
= users with valid OpenShift credentials can log in).'
type: string
user_registration_role:
userRegistrationRole:
description: 'Select the Airflow role that is assigned to the
user when first registered in the database. This setting directly
translates to the AUTH_USER_REGISTRATION_ROLE setting in webserver_config.py.
Airflow ships with a set of roles by default: Admin, User,
Op, Viewer, Public.'
type: string
type: object
enableroutes:
enableRoutes:
description: EnableRoutes exposes the Airflow UI via OpenShit route.
type: boolean
image:
Expand Down

0 comments on commit 69f9357

Please sign in to comment.