Skip to content

Commit

Permalink
fix: updating flag name and adding snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
saumilmac committed Mar 20, 2024
1 parent bea70f9 commit e7402fc
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/snyk-broker/templates/broker_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
httpGet:
port: {{ .Values.deployment.container.containerPort }}
path: {{ .Values.brokerLivenessProbe.path }}
{{- if .Values.enableBrokerServerOverHttps }}
{{- if or ( and (.Values.httpsCert) (.Values.httpsKey) ) ( .Values.enableBrokerLocalWebserverOverHttps ) }}
scheme: HTTPS
{{- else }}
scheme: HTTP
Expand All @@ -70,7 +70,7 @@ spec:
httpGet:
port: {{ .Values.deployment.container.containerPort }}
path: {{ .Values.brokerReadinessProbe.path }}
{{- if .Values.enableBrokerServerOverHttps }}
{{- if or ( and (.Values.httpsCert) (.Values.httpsKey) ) ( .Values.enableBrokerLocalWebserverOverHttps ) }}
scheme: HTTPS
{{- else }}
scheme: HTTP
Expand Down
156 changes: 156 additions & 0 deletions charts/snyk-broker/tests/__snapshot__/broker_deployment_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,162 @@ HA mode on with 4 replicas:
helm.sh/chart: snyk-broker-2.6.2
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
HTTPS enabled:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.6.2
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
template:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
spec:
containers:
- env:
- name: BROKER_SERVER_URL
value: https://broker.test.snyk.io
- name: BROKER_HEALTHCHECK_PATH
value: /healthcheck
- name: BROKER_SYSTEMCHECK_PATH
value: /systemcheck
- name: BROKER_TOKEN
valueFrom:
secretKeyRef:
key: github-com-broker-token-key
name: github-com-broker-token-RELEASE-NAME
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
key: github-com-token-key
name: github-com-token-RELEASE-NAME
- name: PORT
value: "8000"
- name: BROKER_CLIENT_URL
value: http://brokerclient
- name: LOG_LEVEL
value: info
- name: LOG_ENABLE_BODY
value: "false"
- name: HTTPS_CERT
value: /home/node/tls-cert/tls.crt
- name: HTTPS_KEY
value: /home/node/tls-cert/tls.key
- name: ACCEPT_CODE
value: "true"
- name: ACCEPT_IAC
value: tf,yaml,yml,json,tpl
- name: BROKER_DISPATCHER_BASE_URL
value: https://api.test.snyk.io
image: snyk/broker:github-com
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
name: github-com-broker-RELEASE-NAME
ports:
- containerPort: 8000
name: http
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
resources:
limits:
cpu: 1
memory: 256Mi
requests:
cpu: 1
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
volumeMounts:
- mountPath: /home/node/tls-cert/
name: RELEASE-NAME-snyk-broker-tls-secret-volume
readOnly: true
securityContext: {}
serviceAccountName: snyk-broker-RELEASE-NAME
volumes:
- name: RELEASE-NAME-snyk-broker-tls-secret-volume
secret:
secretName: RELEASE-NAME-snyk-broker-tls-secret
2: |
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.6.2
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
ports:
- port: 8000
targetPort: 8000
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
type: ClusterIP
3: |
apiVersion: v1
data:
github-com-broker-token-key: MTIz
kind: Secret
metadata:
name: github-com-broker-token-RELEASE-NAME
type: Opaque
4: |
apiVersion: v1
data:
tls.crt: ""
tls.key: ""
kind: Secret
metadata:
name: RELEASE-NAME-snyk-broker-tls-secret
type: kubernetes.io/tls
5: |
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.6.2
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
default values:
1: |
apiVersion: apps/v1
Expand Down
5 changes: 5 additions & 0 deletions charts/snyk-broker/tests/broker_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ tests:
- ./fixtures/default_values.yaml
asserts:
- matchSnapshot: {}
- it: HTTPS enabled
values:
- ./fixtures/default_values_https_enabled.yaml
asserts:
- matchSnapshot: {}
- it: preflight checks off
values:
- ./fixtures/default_values_preflight_off.yaml
Expand Down
31 changes: 31 additions & 0 deletions charts/snyk-broker/tests/dummy_tls_cert.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIUXsVXn57owX5UJCSgmpiUCDscyuUwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDAzMTMxNDQzMjlaFw0yNTAz
MTMxN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CsBzSt+oxuU8z1sVNmOBBZLI+B7an
++0eLg0pyNNS2gHydJskdbEFK4xNNGLn847bawlDf3bq30OQ3KGW5EBCZklc9GEf
UA/GoX/RNhLe7e0RJy08J9Dfe8/rvBHIArmKIcM+MzDkR+6JhUYXXdIAFY4jpMxd
5Fieqj+NUF2UUFdjbtKEOjXzaNA2RRkesHaOqGAxV9FxVFRuggH3DJxiSwjzBH2z
Nvjq5VVgh6/vRbcKUYu73H5JNAdLFFruuo9lTCuNdkrzEBS3zjyx2qrAuVVWOcPc
pKm7cPgQ41H33+zWxEbotug14WoklFyDFfTVK/RCXLuFVnYIR4dL/Bsjbr23UsKU
Th+tVL+T6uKr8UoMe0ODINsX8xguywo7j4Xa09/FHlnZ9VYVOX3U3CkRs5v17uiB
oByUzTpMODcsFjJiE7TDZMAxVwazzwA12OO4ieOXlB3wiHR/uVo94MDNIVL/cQVG
d6Oj6Vz9+MmyhEaHJsXJQv0c3UrpURI7Rn1UN1oUa4vb2HX58GnQC5vJ6GP5NBvG
VQQ3xdXU2kQDPvbzHW4cF8nbIzbErXdRkqinZIEosNMhCdEtjdCeLg/Hn0K3LPk=
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions charts/snyk-broker/tests/dummy_tls_key.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDkefnSLZV/5MXP
Q17xCnYY8q4drlL0qDcY3GaXsWd1wvc6ACjl5/nOzsxVG6d0iXYXYJY7ORrfJB/E
zI/tZddgw45ONtgpdAKBxSLuUK4+isAa8N1BCy3/GTrFYi6jiXfwuG1/m1x+GeUU
sLY2QV6z8jykSCtqgRf5Uj0Rt1HlN1Termrd1Nebpe0xrWuUC5o/1H49kysRQvTT
4a8CEqN5dctRITOZfZrSGjjZEEZjeBnzv/5J73nTGBThiar8Ii3iPeH4pbnefQR0
oRFpwEmeI3Tptm/3qZeZjt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ikCggEAK57reHeKNIQDvN3ZmaHp
rhuid8UYRarzAVuJQs11PROhXWZepbt0P6Mpt9fvimPRa5HKMo3J53PAbh+Y2AFh
uLu75TF68fYJKgkWwui7wRRSgYZXSqUEHVcEkbw2YTdTmodJ67LIaTFcjrWh0JJn
KB69vsFPLgWCcZRo8NvI8EtysxFYa6fn8oUEAC8X7FB7OoejRdFmOnAp135bJX+1
KRJgpW4AX8CtkSB9mODvNSy0GhB08xL5TPke9O5SKPP7xTrIUlYIU/kElHdVMIea
MWzzM2ha54A9kK0G0GB4keMrDmuY9kY/srCCOvJORDJARDMuTMe0MEiMrv9fUYVx
3QKCAQB8w0ZhF7xMS5Tjzdetyurj2K/XtrfSc8jhitCGNoz8Gnc8kSP0trrhGydo
/u5PIDmuzu2y6h9/K+pFt7aZ8TkHaoqVrG5YRuMpSaqUgWdtpHQ5pxoG1sb86Xh4
lgQ4X6x9yu9bvUMfFVexfkLdXZOb0W7m/j/xXTLGueRABzMYYSwp9JnyldpoiR0e
GzLH3RVE1pMM9cRxEFaD0fGy9yFSsDsb+Jm/A17Wq7/I8oGS4Co/QPmNBK7U8fpk
yMtvaRgS1WKADj38X+8srg6uszO3teGAUbwP/pNq+TD9yhYJ9FOdPs0qi6rdpfUn
ZFhsRfQR6YPsCdgBxShm4loyyGHe
-----END PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Default values for snyk-broker.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

##### Snyk Specific Values #####

# Broker Token is a value from Snyk. Get this from the integration settings page or your Snyk Representative
brokerToken: "123"

# brokerClientUrl is the address of the broker. This needs to be the address of itself. In the case of Kubernetes, you need to ensure that you are pointing to the cluster ingress you have setup.
# Ex: http://kubernetes-ingress.domain.com:8000/broker
brokerClientUrl: "http://brokerclient"

# Do not touch unless directed by a Snyk Representative
brokerServerUrl: "https://broker.test.snyk.io"

preflightChecks:
enabled: true

highAvailabilityMode:
enabled: false
brokerDispatcherUrl: "https://api.test.snyk.io"

# To enable broker client to run a HTTPS server enable enableBrokerLocalWebserverOverHttps flag and also provide location of HTTPS_CERT and HTTPS_KEY
enableBrokerLocalWebserverOverHttps: true

# Location of mounted cert
httpsCert: "dummy_tls_cert.crt"

# Location of mounted HTTPS key
httpsKey: "dummy_tls_key.key"
4 changes: 2 additions & 2 deletions charts/snyk-broker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ logEnableBody: "false"

##### Enable HTTPS #####

# To enable broker client to run a HTTPS server enable enableBrokerServerOverHttps flag and also provide location of HTTPS_CERT and HTTPS_KEY
enableBrokerServerOverHttps: false
# To enable broker client to run a HTTPS server enable enableBrokerLocalWebserverOverHttps flag and also provide location of HTTPS_CERT and HTTPS_KEY
enableBrokerLocalWebserverOverHttps: false

# Location of mounted cert
httpsCert: ""
Expand Down

0 comments on commit e7402fc

Please sign in to comment.