From 4c3333d17b1888046206acd00b39ec46158f8b55 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 10 Oct 2022 17:31:44 +0100 Subject: [PATCH] skaffold: add default k8s definition skaffold.yaml contains some definiton --- .k8s/skaffold.py | 7 ++++++- .k8s/templates/default.yaml | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .k8s/templates/default.yaml diff --git a/.k8s/skaffold.py b/.k8s/skaffold.py index 4d9e9808d..3d05a47b7 100644 --- a/.k8s/skaffold.py +++ b/.k8s/skaffold.py @@ -102,8 +102,13 @@ def main(): for line in infile: outfile.write(line) - print("Copying dockerignore files...") + print("Copying dockerignore file...") + # avoid exposing anything unrelated to the source code. shutil.copyfile('.k8s/.dockerignore', '.dockerignore') + print("Copying default yaml file...") + # skaffold requires a default manifest ... this is the workaround for now. + shutil.copyfile(f'{templatesLocation}/default.yaml', f'{generatedLocation}/default.yaml') + if __name__ == '__main__': main() diff --git a/.k8s/templates/default.yaml b/.k8s/templates/default.yaml new file mode 100644 index 000000000..73915b807 --- /dev/null +++ b/.k8s/templates/default.yaml @@ -0,0 +1,22 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "apm-agen-python-3-6-none" + labels: + repo: "apm-agent-python" + type: "unit-test" + version: "3.6" + framework: "none" +spec: + ttlSecondsAfterFinished: 0 + backoffLimit: 0 + template: + spec: + restartPolicy: Never + containers: + - name: "python-3-6" + image: "apm-agent-python-3.6" + command: [ "echo hi" ] + env: + - name: WEBFRAMEWORK + value: "none"