Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jq version for github actions #334

Merged
merged 6 commits into from
Mar 27, 2024
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
18 changes: 17 additions & 1 deletion component/component/app.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@ local inv = kap.inventory();
local params = inv.parameters.appcat;
local argocd = import 'lib/argocd.libjsonnet';

local app = argocd.App('appcat', '');
local app = argocd.App('appcat', '') + (
if params.services.vshn.e2eTests then {
spec+: {
ignoreDifferences+: [
{
group: '',
jsonPointers: [
'/data',
],
kind: 'Secret',
name: 'github-ci-secret',
namespace: 'appcat-e2e',
},
],
},
} else {}
);

{
appcat: app,
Expand Down
25 changes: 20 additions & 5 deletions component/component/rbac_e2e.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ local params = inv.parameters.appcat;
local e2eNs = kube.Namespace('appcat-e2e') + {
metadata+: {
labels+: {
'appuio.io/organization': 'vshn-e2e-tests',
'appuio.io/organization': 'vshn',
},
},
};

local e2eSA = kube.ServiceAccount('appcat-e2e') + {
local e2eSA = kube.ServiceAccount('github-ci') + {
metadata+: {
namespace: 'appcat-e2e',
},
Expand All @@ -26,17 +26,32 @@ local e2eRoleBinding = kube.RoleBinding('appcat-e2e') + {
subjects_: [ e2eSA ],
};

local e2eSAToken = kube.Secret('appcat-e2e-github') + {
local e2eClusterRole = kube.ClusterRole('appcat:e2e') + {
rules: [
{
apiGroups: [ 'networking.k8s.io' ],
resources: [ 'ingresses' ],
verbs: [ 'get', 'list' ],
},
],
};

local e2eClusterRoleBinding = kube.ClusterRoleBinding('appcat:e2e') {
roleRef_: e2eClusterRole,
subjects_: [ e2eSA ],
};

local e2eSAToken = kube.Secret('github-ci-secret') + {
metadata+: {
namespace: 'appcat-e2e',
annotations+: {
'kubernetes.io/service-account.name': 'appcat-e2e',
'kubernetes.io/service-account.name': 'github-ci',
'argocd.argoproj.io/compare-options': 'IgnoreExtraneous',
},
},
type: 'kubernetes.io/service-account-token',
};

if params.services.vshn.e2eTests then {
'20_rbac_vshn_e2e_tests': [ e2eNs, e2eSA, e2eRoleBinding, e2eSAToken ],
'20_rbac_vshn_e2e_tests': [ e2eNs, e2eSA, e2eRoleBinding, e2eClusterRoleBinding, e2eClusterRole, e2eSAToken ],
} else {}
4 changes: 2 additions & 2 deletions tests/e2e/keycloak/scripts/ingress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -e

ns=$(kubectl -n "$NAMESPACE" get vshnkeycloak keycloak-e2e -ojson | jq -r '.status.instanceNamespace')
ns=$(kubectl -n "$NAMESPACE" get vshnkeycloak keycloak-e2e -oyaml | yq -r '.status.instanceNamespace')

fqdn=$(kubectl -n "$ns" get ingress -ojson | jq -r '.items.[0].spec.tls.[0].hosts[0]')
fqdn=$(kubectl -n "$ns" get ingress -oyaml | yq -r '.items.[0].spec.tls.[0].hosts[0]')

echo "$fqdn = keycloak-e2e.example.com"
[[ "$fqdn" == "keycloak-e2e.example.com" ]]
2 changes: 1 addition & 1 deletion tests/e2e/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./test/e2e/
namespace: schedar-e2e
namespace: appcat-e2e
4 changes: 2 additions & 2 deletions tests/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ $(kuttl_bin): | $(go_bin)

.PHONY: .e2e-test
e2e-test: $(kuttl_bin) ## Run e2e tests
@kubectl create namespace schedar-e2e || true
@kubectl create namespace appcat-e2e || true
GOBIN=$(go_bin) $(kuttl_bin) test ./tests/e2e --config ./tests/e2e/kuttl-test.yaml --suppress-log=Events
@rm -f kubeconfig
# kuttl leaves kubeconfig garbage: https://github.com/kudobuilder/kuttl/issues/297

.PHONY: .run-single-e2e
run-single-e2e:
@kubectl create namespace schedar-e2e || true
@kubectl create namespace appcat-e2e || true
GOBIN=$(go_bin) $(kuttl_bin) test ./tests/e2e --config ./tests/e2e/kuttl-test.yaml --suppress-log=Events --test $(test)
@rm -f kubeconfig

Expand Down
Loading