(feat) add CodeServer addon and addon improvements (#1059)

* simplify addons to not require manually entered volumemounts, just mount them all.

* simplify addons

* cleanup promtail and codeserver

* fix mistake in codeserver

* try to add codeserver runtest

* add netshoot runtest

* fix codeserver ports

* different codeserver port for integrationt est

* bump common
This commit is contained in:
Kjeld Schouten-Lebbing
2021-09-29 15:10:26 +02:00
committed by GitHub
parent 2b5fe533f6
commit cfdffdb3be
13 changed files with 326 additions and 149 deletions
+1 -40
View File
@@ -9,13 +9,7 @@ class Test < ChartTest
baseValues = {
addons: {
codeserver: {
enabled: true,
volumeMounts: [
{
name: "config",
mountPath: "/data/config"
}
]
enabled: true
}
}
}
@@ -110,39 +104,6 @@ class Test < ChartTest
refute_nil(deploykeyVolume)
assert_equal("common-test-deploykey", deploykeyVolume["secret"]["secretName"])
end
it 'an existing secret can be passed as a git deployKey' do
values = baseValues.deep_merge_override({
addons: {
codeserver: {
git: {
deployKeySecret: "existingSecret"
}
}
}
})
chart.value values
deployment = chart.resources(kind: "Deployment").first
secret = chart.resources(kind: "Secret").first
containers = deployment["spec"]["template"]["spec"]["containers"]
volumes = deployment["spec"]["template"]["spec"]["volumes"]
codeserverContainer = containers.find{ |c| c["name"] == "codeserver" }
# Check that the secret has not been created
assert_nil(secret)
# Make sure the deployKey volumeMount is present in the sidecar container
deploykeyVolumeMount = codeserverContainer["volumeMounts"].find { |v| v["name"] == "deploykey"}
refute_nil(deploykeyVolumeMount)
assert_equal("/root/.ssh/id_rsa", deploykeyVolumeMount["mountPath"])
assert_equal("id_rsa", deploykeyVolumeMount["subPath"])
# Make sure the deployKey volume is present in the Deployment
deploykeyVolume = volumes.find{ |v| v["name"] == "deploykey" }
refute_nil(deploykeyVolume)
assert_equal(values[:addons][:codeserver][:git][:deployKeySecret], deploykeyVolume["secret"]["secretName"])
end
end
end
end
+1 -8
View File
@@ -18,14 +18,7 @@ class Test < ChartTest
values = {
addons: {
promtail: {
enabled: true,
volumeMounts: [
{
name: "config",
mountPath: "/tmp",
readOnly: true
}
]
enabled: true
}
}
}