From 69f9357e6f89aee514bdf09a0d1c1fde4adffbfb Mon Sep 17 00:00:00 2001 From: Ales Nosek Date: Sat, 20 Feb 2021 12:54:11 -0800 Subject: [PATCH] Rename config params user_registration_role -> userRegistrationRole, 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 --- api/v1alpha1/airflowcluster_types.go | 6 +++--- config/crd/bases/airflow.apache.org_airflowclusters.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/v1alpha1/airflowcluster_types.go b/api/v1alpha1/airflowcluster_types.go index db15394..78b7609 100644 --- a/api/v1alpha1/airflowcluster_types.go +++ b/api/v1alpha1/airflowcluster_types.go @@ -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 { @@ -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"` @@ -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 diff --git a/config/crd/bases/airflow.apache.org_airflowclusters.yaml b/config/crd/bases/airflow.apache.org_airflowclusters.yaml index 89e7df2..ef61dca 100644 --- a/config/crd/bases/airflow.apache.org_airflowclusters.yaml +++ b/config/crd/bases/airflow.apache.org_airflowclusters.yaml @@ -929,7 +929,7 @@ spec: flower: description: Spec for Flower component. properties: - enableroutes: + enableRoutes: description: EnableRoutes exposes Flower via OpenShit route. type: boolean image: @@ -1447,7 +1447,7 @@ 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. @@ -1455,7 +1455,7 @@ spec: Op, Viewer, Public.' type: string type: object - enableroutes: + enableRoutes: description: EnableRoutes exposes the Airflow UI via OpenShit route. type: boolean image: