Files

102 lines
2.6 KiB
YAML

#
# Copyright 2024 The Kubeflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
suite: Test spark service account
templates:
- spark/serviceaccount.yaml
release:
name: spark-operator
namespace: spark-operator
tests:
- it: Should not create service account if `spark.serviceAccount.create` is false
set:
spark:
serviceAccount:
create: false
asserts:
- hasDocuments:
count: 0
- it: Should create service account by default
asserts:
- containsDocument:
apiVersion: v1
kind: ServiceAccount
name: spark-operator-spark
- it: Should use the specified service account name if `spark.serviceAccount.name` is set
set:
spark:
serviceAccount:
name: spark
asserts:
- containsDocument:
apiVersion: v1
kind: ServiceAccount
name: spark
- it: Should add extra annotations if `spark.serviceAccount.annotations` is set
set:
spark:
serviceAccount:
annotations:
key1: value1
key2: value2
asserts:
- equal:
path: metadata.annotations.key1
value: value1
- equal:
path: metadata.annotations.key2
value: value2
- it: Should create service account for every non-empty spark job namespace if `spark.jobNamespaces` is set with multiple values
set:
spark:
jobNamespaces:
- ""
- ns1
- ns2
documentIndex: 0
asserts:
- hasDocuments:
count: 2
- containsDocument:
apiVersion: v1
kind: ServiceAccount
name: spark-operator-spark
namespace: ns1
- it: Should create service account for every non-empty spark job namespace if `spark.jobNamespaces` is set with multiple values
set:
spark:
jobNamespaces:
- ""
- ns1
- ns2
documentIndex: 1
asserts:
- hasDocuments:
count: 2
- containsDocument:
apiVersion: v1
kind: ServiceAccount
name: spark-operator-spark
namespace: ns2