Skip to content
Snippets Groups Projects
Commit b8207511 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into knecht-root-recht-helmchart

parents 92240e80 3f817f8d
No related branches found
No related tags found
No related merge requests found
...@@ -160,7 +160,7 @@ pipeline { ...@@ -160,7 +160,7 @@ pipeline {
HELM_CHART_VERSION = generateHelmChartVersion() HELM_CHART_VERSION = generateHelmChartVersion()
dir('src/main/helm') { dir('src/main/helm') {
sh "helm lint -f ../../test/unit-values.yaml" sh "helm lint -f ../../test/linter-values.yaml"
sh "helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ." sh "helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
......
#!/bin/sh #!/bin/sh
set -e set -e
set -x
helm template ./src/main/helm/ -f src/test/unit-values.yaml helm template ./src/main/helm/ -f src/test/linter-values.yaml
helm lint -f src/test/unit-values.yaml ./src/main/helm/ helm lint -f src/test/linter-values.yaml ./src/main/helm/
cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' . cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .
\ No newline at end of file
...@@ -56,10 +56,7 @@ spec: ...@@ -56,10 +56,7 @@ spec:
- to: - to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: kube-system kubernetes.io/metadata.name: {{ required "networkPolicy.dnsServerNamespace must be set" (.Values.networkPolicy).dnsServerNamespace }}
podSelector:
matchLabels:
k8s-app: kube-dns
ports: ports:
- port: 53 - port: 53
protocol: UDP protocol: UDP
......
...@@ -29,14 +29,23 @@ templates: ...@@ -29,14 +29,23 @@ templates:
- templates/network_policy.yaml - templates/network_policy.yaml
tests: tests:
- it: should match apiVersion - it: should match apiVersion
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
asserts: asserts:
- isAPIVersion: - isAPIVersion:
of: networking.k8s.io/v1 of: networking.k8s.io/v1
- it: should match kind - it: should match kind
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
asserts: asserts:
- isKind: - isKind:
of: NetworkPolicy of: NetworkPolicy
- it: validate metadata - it: validate metadata
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
asserts: asserts:
- equal: - equal:
path: metadata path: metadata
...@@ -44,6 +53,9 @@ tests: ...@@ -44,6 +53,9 @@ tests:
name: network-policy-user-manager name: network-policy-user-manager
namespace: by-helm-test namespace: by-helm-test
- it: validate spec - it: validate spec
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
asserts: asserts:
- equal: - equal:
path: spec path: spec
...@@ -72,10 +84,7 @@ tests: ...@@ -72,10 +84,7 @@ tests:
- to: - to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: kube-system kubernetes.io/metadata.name: test-namespace-dns
podSelector:
matchLabels:
k8s-app: kube-dns
ports: ports:
- port: 53 - port: 53
protocol: UDP protocol: UDP
...@@ -84,6 +93,7 @@ tests: ...@@ -84,6 +93,7 @@ tests:
- it: add ingress rule by values - it: add ingress rule by values
set: set:
networkPolicy: networkPolicy:
dnsServerNamespace: test-namespace-dns
additionalIngressConfig: additionalIngressConfig:
- podSelector: - podSelector:
matchLabels: matchLabels:
...@@ -102,6 +112,7 @@ tests: ...@@ -102,6 +112,7 @@ tests:
- it: test network policy disabled - it: test network policy disabled
set: set:
networkPolicy: networkPolicy:
dnsServerNamespace: test-namespace-dns
disabled: true disabled: true
asserts: asserts:
- hasDocuments: - hasDocuments:
...@@ -110,6 +121,7 @@ tests: ...@@ -110,6 +121,7 @@ tests:
- it: test network policy unset should be disabled - it: test network policy unset should be disabled
set: set:
networkPolicy: networkPolicy:
dnsServerNamespace: test-namespace-dns
disabled: false disabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
......
#
# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den
# Ministerpräsidenten des Landes Schleswig-Holstein
# Staatskanzlei
# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
#
# Lizenziert unter der EUPL, Version 1.2 oder - sobald
# diese von der Europäischen Kommission genehmigt wurden -
# Folgeversionen der EUPL ("Lizenz");
# Sie dürfen dieses Werk ausschließlich gemäß
# dieser Lizenz nutzen.
# Eine Kopie der Lizenz finden Sie hier:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Sofern nicht durch anwendbare Rechtsvorschriften
# gefordert oder in schriftlicher Form vereinbart, wird
# die unter der Lizenz verbreitete Software "so wie sie
# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
# ausdrücklich oder stillschweigend - verbreitet.
# Die sprachspezifischen Genehmigungen und Beschränkungen
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
baseUrl: test.sh.ozg-cloud.de
ozgcloud:
bundesland: sh
bezeichner: helm
environment: test
keycloak:
api:
password: geheim
sso:
serverUrl: sso.test.sh.ozg-cloud.de
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-dns-namespace
\ No newline at end of file
...@@ -26,10 +26,11 @@ package de.ozgcloud.user.common.lock; ...@@ -26,10 +26,11 @@ package de.ozgcloud.user.common.lock;
import java.time.Instant; import java.time.Instant;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import de.ozgcloud.common.logging.OzgCloudLogging;
import de.ozgcloud.user.common.errorhandling.LockCreationException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import de.ozgcloud.common.logging.OzgCloudLogging;
import de.ozgcloud.user.common.errorhandling.LockCreationException;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
@Log4j2 @Log4j2
...@@ -57,12 +58,12 @@ public class LockService { ...@@ -57,12 +58,12 @@ public class LockService {
public void unlock() { public void unlock() {
var count = repository.deleteAll(); var count = repository.deleteAll();
LOG.info("%s Locks deleted".formatted(count)); LOG.debug("%s Locks deleted".formatted(count));
} }
public void lock(Instant timestamp) { public void lock(Instant timestamp) {
repository.persist(Lock.builder().timestamp(timestamp.toEpochMilli()).build()); repository.persist(Lock.builder().timestamp(timestamp.toEpochMilli()).build());
LOG.info("Lock created"); LOG.debug("Lock created");
} }
Lock getByTimestamp(Instant timestamp) { Lock getByTimestamp(Instant timestamp) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment