You've already forked athens-proxy-charts
fix: improve chart
This commit is contained in:
83
unittests/secrets/netrc.yaml
Normal file
83
unittests/secrets/netrc.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
chart:
|
||||
appVersion: 0.1.0
|
||||
version: 0.1.0
|
||||
suite: Secret netrc template
|
||||
release:
|
||||
name: athens-proxy-unittest
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/athens-proxy/secretNetRC.yaml
|
||||
tests:
|
||||
- it: Skip rendering by using existing secret.
|
||||
set:
|
||||
config.netrc.existingSecret.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: Rendering netrc secret with default values.
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
name: athens-proxy-unittest-netrc
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: athens-proxy-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: athens-proxy
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
helm.sh/chart: athens-proxy-0.1.0
|
||||
- equal:
|
||||
path: stringData[".netrc"]
|
||||
value: |
|
||||
# The .netrc file
|
||||
#
|
||||
# The .netrc file contains login and initialization information used by the auto-login process. It generally
|
||||
# resides in the user's home directory, but a location outside of the home directory can be set using the
|
||||
# environment variable NETRC. Both locations are overridden by the command line option -N. The selected file
|
||||
# must be a regular file, or access will be denied.
|
||||
#
|
||||
# https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html
|
||||
#
|
||||
# default login [name] password [password/token]
|
||||
# machine github.com [octocat] password [PAT]
|
||||
# machine api.github.com [octocat] password [PAT]
|
||||
|
||||
- it: Rendering netrc secret with custom values.
|
||||
set:
|
||||
config.netrc.secret.content: |
|
||||
default github.com hugo password kinnock
|
||||
default api.github.com hugo password kinnock
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData[".netrc"]
|
||||
value: |
|
||||
default github.com hugo password kinnock
|
||||
default api.github.com hugo password kinnock
|
||||
|
||||
- it: Rendering custom annotations and labels.
|
||||
set:
|
||||
config.netrc.secret.annotations:
|
||||
foo: bar
|
||||
bar: foo
|
||||
config.netrc.secret.labels:
|
||||
foo: bar
|
||||
bar: foo
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
foo: bar
|
||||
bar: foo
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
content:
|
||||
foo: bar
|
||||
bar: foo
|
Reference in New Issue
Block a user