From c91cb12f42faf56e0b55d74d1e98cce89411dab6 Mon Sep 17 00:00:00 2001 From: Michel Morin Date: Thu, 26 Sep 2024 11:24:11 +0200 Subject: [PATCH] secu --- cdpcli/clidriver.py | 5 ++++ testdns.py | 73 --------------------------------------------- 2 files changed, 5 insertions(+), 73 deletions(-) delete mode 100644 testdns.py diff --git a/cdpcli/clidriver.py b/cdpcli/clidriver.py index 8889ed6..f76247a 100644 --- a/cdpcli/clidriver.py +++ b/cdpcli/clidriver.py @@ -657,6 +657,11 @@ def __k8s(self): if not self._context.opt['--use-registry'] == 'aws-ecr' and 'kind' in doc and 'spec' in doc and ('template' in doc['spec'] or 'jobTemplate' in doc['spec']): doc=CLIDriver.addImageSecret(doc,image_pull_secret_value) + if self._context.getParamOrEnv("no-requests",False): + if doc['kind'] == 'Deployment' or doc['kind'] == 'StatefulSet' or doc['kind'] == 'Job' or doc['kind'] == 'DaemonSet': + for container in range(len(doc["spec"]["template"]["spec"]["containers"])): + doc["spec"]["template"]["spec"]["containers"][container]["resources"]["requests"]["cpu"] = 0 + LOG.verbose(doc) with open('%s/all_resources.yaml' % final_template_deploy_spec_dir, 'w') as outfile: yaml.dump_all(final_docs, outfile) diff --git a/testdns.py b/testdns.py deleted file mode 100644 index aa6dc7f..0000000 --- a/testdns.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/python -# -*-coding:Utf-8 -* -# -# connects to a SOLIDserver, create dns server, zone and records -# -########################################################## - -import logging -import pprint -import os, sys -import uuid - -sys.path.insert(0, os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - -from SOLIDserverRest import * -from SOLIDserverRest import adv as sdsadv - -logging.basicConfig(format='[%(filename)s:%(lineno)d] %(levelname)s: %(message)s', - level=logging.INFO) - -# configuration - to be adapted -SDS_HOST = "ipam.ouest-france.fr" -SDS_LOGIN = "037207T" -SDS_PWD = "10RDPACpdr35" - -logging.info("create a connection to the SOLIDserver") - -sds = sdsadv.SDS(ip_address=SDS_HOST, - user=SDS_LOGIN, - pwd=SDS_PWD) - -try: - sds.connect(method="native") -except SDSError as e: - logging.error(e) - exit() - -logging.info(sds) - -# -------------------------- -logging.info("create DNS record") -name = "testmmr" -dns_rr = sdsadv.DNS_record(sds, name) -dns_rr.set_zone(zone) -dns_rr.set_type('A', ip='127.1.2.3') -dns_rr.create() - -logging.info(dns_rr) -dns_rr.delete() - -dns_rr = sdsadv.DNS_record(sds, name) -dns_rr.set_zone(dns_zone) -dns_rr.set_type('CNAME', target='ingress.dev-k8s.of.ouest-france.fr') -dns_rr.create() - -logging.info(dns_rr) -dns_rr.delete() - -dns_rr = sdsadv.DNS_record(sds, name) -dns_rr.set_zone(dns_zone) -dns_rr.set_type('MX', priority=10, target="foo.bar") -dns_rr.create() - -logging.info(dns_rr) -dns_rr.delete() - -# -------------------------- -logging.info("cleaning") -dns_zone.delete() -dns.delete() - -del sds