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

Nest Interface Policy under the interface field #625

Merged
merged 3 commits into from
Feb 5, 2022
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ insert_final_newline = true
[{*.yml, *.yaml}]
indent_size = 2

[*.graphql]
indent_size = 4
indent_style = space

[Makefile]
indent_style = tab
indent_size = 4
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@ metadata:
{{- include "engine.labels" . | nindent 4 }}
data:
cluster-policy.yaml: |
apiVersion: 0.2.0

rules:
{{- if .Values.testSetup.enabled }}
{{- toYaml .Values.testSetup.globalPolicyRules | nindent 8 }}
{{- end }}
{{- toYaml .Values.globalPolicyRules | nindent 8 }}
{{- toYaml .Values.globalPolicy | nindent 4 }}
116 changes: 53 additions & 63 deletions deploy/kubernetes/charts/capact/charts/engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,67 +60,57 @@ affinity: {}

# order from highest priority to the lowest
policyOrder: "ACTION,GLOBAL,WORKFLOW"
globalPolicyRules:
globalPolicy:
# Insert Interface paths with Implementations. For example:
#
# - interface:
# # Rules for exact path and revision (looked up in first place)
# path: "cap.interface.database.postgresql.install"
# revision: "0.1.0"
# oneOf:
# - implementationConstraints:
# requires:
# - path: "cap.type.gcp.auth.service-account"
# # any revision
# attributes:
# - path: "cap.attribute.cloud.provider.gcp"
# # any revision
# inject:
# typeInstances:
# - id: "{uuid}"
# typeRef:
# path: "cap.type.gcp.auth.service-account"
# revision: "0.1.0"
# - implementationConstraints:
# attributes:
# - path: cap.attribute.cloud.provider.aws
# # any revision
# - implementationConstraints:
# path: cap.implementation.bitnami.postgresql.install
# - interface:
# # Rules for exact path in any revision (looked up in second place)
# path: "cap.interface.database.postgresql.install"
# oneOf:
# - implementationConstraints:
# requires:
# - path: "cap.type.gcp.auth.service-account"
# # any revision
# attributes:
# - path: "cap.attribute.cloud.provider.gcp"
# # any revision

- interface:
# any other Interface (looked up in third place, if there is no rule for `path` and `revision` or `path`)
path: "cap.*"
oneOf:
- implementationConstraints: # prefer Implementation for Kubernetes
requires:
- path: "cap.core.type.platform.kubernetes"
# any revision
- implementationConstraints: {} # fallback to any Implementation

testSetup:
enabled: false
globalPolicyRules:
- interface:
path: "cap.interface.capactio.capact.validation.action.passing"
oneOf:
- implementationConstraints:
requires:
- path: "cap.type.capactio.capact.validation.single-key"
attributes:
- path: "cap.attribute.capactio.capact.validation.policy.most-preferred"
inject:
requiredTypeInstances: [] # DO NOT MODIFY this line, as it is found and replaced during integration tests
- implementationConstraints:
path: cap.implementation.capactio.capact.validation.action.passing-a
# interface:
# rules:
# - interface:
# # Rules for exact path and revision (looked up in first place)
# path: "cap.interface.database.postgresql.install"
# revision: "0.1.0"
# oneOf:
# - implementationConstraints:
# requires:
# - path: "cap.type.gcp.auth.service-account"
# # any revision
# attributes:
# - path: "cap.attribute.cloud.provider.gcp"
# # any revision
# inject:
# typeInstances:
# - id: "{uuid}"
# typeRef:
# path: "cap.type.gcp.auth.service-account"
# revision: "0.1.0"
# - implementationConstraints:
# attributes:
# - path: cap.attribute.cloud.provider.aws
# # any revision
# - implementationConstraints:
# path: cap.implementation.bitnami.postgresql.install
# - interface:
# # Rules for exact path in any revision (looked up in second place)
# path: "cap.interface.database.postgresql.install"
# oneOf:
# - implementationConstraints:
# requires:
# - path: "cap.type.gcp.auth.service-account"
# # any revision
# attributes:
# - path: "cap.attribute.cloud.provider.gcp"
# # any revision
interface:
rules:
- interface:
# any other Interface (looked up in third place, if there is no rule for `path` and `revision` or `path`)
path: "cap.*"
oneOf:
- implementationConstraints: # prefer Implementation for Kubernetes
requires:
- path: "cap.core.type.platform.kubernetes"
# any revision
- implementationConstraints: {} # fallback to any Implementation

## Currently, not used but setting this filed is supported by all scripts and CLI.
mszostok marked this conversation as resolved.
Show resolved Hide resolved
#testSetup:
# enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,5 @@ spec:
value: "{{ .Values.global.gateway.auth.username }}"
- name: GATEWAY_PASSWORD
value: "{{ .Values.global.gateway.auth.password }}"
- name: APP_CLUSTER_POLICY_NAME
value: {{ include "capact.fullname" . }}-engine-cluster-policy
- name: APP_CLUSTER_POLICY_NAMESPACE
value: {{.Release.Namespace}}
imagePullPolicy: {{ .Values.integrationTest.image.pullPolicy }}
restartPolicy: Never
Loading