Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .zuul.d/secure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,37 @@
Iek4Bf2Vsh3IcXe4WPgooBm9y0wejEmRVwApwcsArxILaa/VUJQO6zVeaLKTGTBNVKolm
pP2x748l+uFWMUGjmzao4OTyfjBKx2cXNqe/OmIyscCr7lDZkipFdDTWrR1p/FLHQiCIc
jBsgwuDMuVcVslw+cy3CPiPKZNWSJLop5cIvCEzGPBzXto9YTVQwPwnmcl+Rnc=
teuto_mgmt_token: !encrypted/pkcs1-oaep
- BSclXsTwr+3yvpYWb4vOVoJNBlZfR10FTpD7JCgJWsFWVW66i7xCDhqq5PQbNc3i5OgiB
kmCP7r+gToKchYtcl4G3C/JdUKPGl+p3qhBCzBiAnMl8ErNVEEQz6x3SHC/7d/BP4OIg/
YbaIwFzjWzF7L6d8mumDOErnxpbFwy7bf40IDnXz+e9heiuf8gwSFh3RdpC2hDTQdukY0
LSDzdQNWKPpY1qYjvUF+rvzq4DClO+HnJUSRT1iEc+X4jYZf45VbQiqpTMsZgksV+WL+V
cThq1IUsvTHSrN9KYErcTVfrLEgy9ejJpB+Jc0b1rkSbOlDs3/lrnjZ2nmGYp/lZH4f3l
sNy4C331bxbSLOfihw6I0EK1J83+jA1Qq6YtwCXlIaFtVlYfAX6PkVEXm5kTULGbfg9NE
ULjqEMfFNyBvvxVPrUnw7bV+T6PLy5di/2aUMylmWv9SjmQlPgIR/dbSJLcrPB5q1VKqR
faM46/UcNJ6Fn6nTI4nW3AFGev4LBap1ejBEiy4VFKvzHiqOPGn5xa2Z7KzAc4eqCA+2K
qC/EK228VivWyZbuVp7/N4m1qoiludalXsMIg28iUN2UOlqAF0flApd4U5R3zM4jcpYS5
2zJ+iWkZX25OMZl7jtWVZyYe8dI1Al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mDAAY39TFkcNfLdWUSnkWSxvNvd6W59NdgQ+9/1tH42po17jn5ZYh4BMtVIJyXxBF1J
H2IHzIi+HcI+tjde4ifkvLF4UKNZLm4lb4nDZS2CuB+7zsy66NbHZzfs/4twB+Cc2FpgX
FE9Pw12G4hZc25imjYbjkd9IbI+/PXwWr0R8/GqhwrUwAVFG8vb38hSjzfShwhlYcBvio
zeW7rBRtT5L78err96rrhFTuFqYtldpewF2QqOzgqpT3sISdFHhF92+etTPBZ0KIivD0b
vh/1NAp07jx5C7Kp7cG4JrV9+AP9B/tjoplCl2itzGrk9rBu+nVE7vkcpECFxg=
noris_token: !encrypted/pkcs1-oaep
- FeRLNW8L6vSdwjxmxWNJ1auG7tEGCutVdq58tN4fabgDBGqGOf8DVjwZy8Q7J/pP1cCf/
EwVZXwgS9obpFDtl2vAswAZVAPF6bZeD3u9MD7g3s+3Kyp6sYkg66g+KTdOthMS/dIUzM
Expand Down
5 changes: 4 additions & 1 deletion Tests/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ subjects = [
"scaleup-1.35",
"syself-1.34",
"syself-1.35",
"teuto-1.35",
"teuto-1.36",
]
workers = 16

Expand All @@ -54,7 +56,7 @@ scopes = [
"scs-compatible-kaas",
]
subjects = [
# add 1.36 subjects here
"teuto-1.36",
]
workers = 4

Expand All @@ -79,6 +81,7 @@ subjects = [
"noris-1.35",
"scaleup-1.35",
"syself-1.35",
"teuto-1.35",
]
workers = 4

Expand Down
4 changes: 4 additions & 0 deletions Tests/kaas/plugin/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import sys
import os

sys.path.insert(0, os.path.dirname(__file__))
15 changes: 1 addition & 14 deletions Tests/kaas/plugin/cs_helper.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
"""helper functions for ClusterStacks plugin"""
import base64
import os

from kubernetes.client import Configuration, CoreV1Api, CustomObjectsApi


def setup_client_config(client_config: Configuration, kubeconfig, cwd='.'):
"""transfer authentication data from kubeconfig to client_config, creating file `ca.crt`s"""
token = kubeconfig['users'][0]['user']['token']
client_config.api_key['authorization'] = 'Bearer {}'.format(token)
client_config.host = kubeconfig['clusters'][0]['cluster']['server']
client_config.ssl_ca_cert = os.path.abspath(os.path.join(cwd, 'ca.crt'))
with open(client_config.ssl_ca_cert, "wb") as fileobj:
fileobj.write(base64.standard_b64decode(
kubeconfig['clusters'][0]['cluster']['certificate-authority-data'].encode()
))
from kubernetes.client import CoreV1Api, CustomObjectsApi


def create_cr(api_instance: CustomObjectsApi, namespace, resource_dict):
Expand Down
15 changes: 1 addition & 14 deletions Tests/kaas/plugin/gardener_helper.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
"""helper functions for Gardener plugin"""
import base64
import json
import os

from kubernetes.client import Configuration, CustomObjectsApi, ApiClient
from kubernetes.client import CustomObjectsApi, ApiClient


GARDENER_GROUP = 'core.gardener.cloud'
GARDENER_VERSION = 'v1beta1'
GARDENER_PLURAL = 'shoots'


def setup_client_config(client_config: Configuration, kubeconfig, cwd='.'):
"""transfer authentication data from kubeconfig to client_config, creating file `ca.crt`s"""
token = kubeconfig['users'][0]['user']['token']
client_config.api_key['authorization'] = 'Bearer {}'.format(token)
client_config.host = kubeconfig['clusters'][0]['cluster']['server']
client_config.ssl_ca_cert = os.path.abspath(os.path.join(cwd, 'ca.crt'))
with open(client_config.ssl_ca_cert, "wb") as fileobj:
fileobj.write(base64.standard_b64decode(
kubeconfig['clusters'][0]['cluster']['certificate-authority-data'].encode()
))


def get_cloudprofile(api_instance: CustomObjectsApi, namespace, name):
"""mimic `kubectl get cloudprofile`"""
return api_instance.get_cluster_custom_object(
Expand Down
17 changes: 17 additions & 0 deletions Tests/kaas/plugin/k8s_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""helper functions shared by the Kubernetes-based cluster plugins"""
import base64
import os

from kubernetes.client import Configuration


def setup_client_config(client_config: Configuration, kubeconfig, cwd='.'):
"""transfer authentication data from kubeconfig to client_config, creating file `ca.crt`s"""
token = kubeconfig['users'][0]['user']['token']
client_config.api_key['authorization'] = 'Bearer {}'.format(token)
client_config.host = kubeconfig['clusters'][0]['cluster']['server']
client_config.ssl_ca_cert = os.path.abspath(os.path.join(cwd, 'ca.crt'))
with open(client_config.ssl_ca_cert, "wb") as fileobj:
fileobj.write(base64.standard_b64decode(
kubeconfig['clusters'][0]['cluster']['certificate-authority-data'].encode()
))
7 changes: 4 additions & 3 deletions Tests/kaas/plugin/plugin_clusterstacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import time

from jinja2 import Environment
from kubernetes.client import ApiClient, ApiException
from kubernetes.client import ApiClient, ApiException, Configuration
import yaml

from interface import KubernetesClusterPlugin
import cs_helper as _csh
import k8s_helper

logger = logging.getLogger(__name__)
logging.getLogger("kubernetes").setLevel(logging.INFO)
Expand Down Expand Up @@ -147,8 +148,8 @@ def __init__(self, config, basepath='.', cwd='.'):
self.vars['name'] = self.config['name']
self.secrets = self.config['secrets']
self.kubeconfig = yaml.load(self._render_template('kubeconfig'), Loader=yaml.SafeLoader)
self.client_config = _csh.Configuration()
_csh.setup_client_config(self.client_config, self.kubeconfig, cwd=self.cwd)
self.client_config = Configuration()
k8s_helper.setup_client_config(self.client_config, self.kubeconfig, cwd=self.cwd)
self.namespace = self.kubeconfig['contexts'][0]['context']['namespace']

def _render_template(self, key):
Expand Down
7 changes: 4 additions & 3 deletions Tests/kaas/plugin/plugin_gardener.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import time

from jinja2 import Environment, StrictUndefined
from kubernetes.client import ApiClient, ApiException
from kubernetes.client import ApiClient, ApiException, Configuration
import yaml

from interface import KubernetesClusterPlugin
import gardener_helper as _gh
import k8s_helper

logger = logging.getLogger(__name__)
logging.getLogger("kubernetes").setLevel(logging.INFO)
Expand Down Expand Up @@ -157,8 +158,8 @@ def __init__(self, plugin_config, basepath='.', cwd='.', name=None):
self.vars['name'] = self.config['name']
self.secrets = self.config['secrets']
self.kubeconfig = yaml.load(self._render_template('kubeconfig'), Loader=yaml.SafeLoader)
self.client_config = _gh.Configuration()
_gh.setup_client_config(self.client_config, self.kubeconfig, cwd=self.cwd)
self.client_config = Configuration()
k8s_helper.setup_client_config(self.client_config, self.kubeconfig, cwd=self.cwd)
self.namespace = self.kubeconfig['contexts'][0]['context']['namespace']

def _render_template(self, key):
Expand Down
Loading
Loading