Project secrets into knative CRD

This commit projects secrets into the Knative CRD YAML, however
it appears that the CRD validator for the Service object will
now allow multiple volumes to be mounted into the same directory
which breaks compatiability with OpenFaaS on Kubernetes.

A separate directory is used for each secret with the key so
that "aws" will be mounted at /var/openfaas/secrets/aws/name.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2019-05-11 15:40:52 +01:00
parent b42d0703b6
commit c9544f53a9
2 changed files with 39 additions and 2 deletions

View File

@@ -25,11 +25,28 @@ type ServingSpecRunLatestConfigurationRevisionTemplate struct {
type ServingSpecRunLatestConfigurationRevisionTemplateSpec struct {
Container ServingSpecRunLatestConfigurationRevisionTemplateSpecContainer `yaml:"container"`
Volumes []Volume `yaml:"volumes,omitempty"`
}
type ServingSpecRunLatestConfigurationRevisionTemplateSpecContainer struct {
Image string `yaml:"image"`
Env []EnvPair `yaml:"env,omitempty"`
Image string `yaml:"image"`
Env []EnvPair `yaml:"env,omitempty"`
VolumeMounts []VolumeMount `yaml:"volumeMounts,omitempty"`
}
type VolumeMount struct {
Name string `yaml:"name"`
MountPath string `yaml:"mountPath"`
ReadOnly bool `yaml:"readOnly"`
}
type Volume struct {
Name string `yaml:"name"`
Secret Secret `yaml:"secret"`
}
type Secret struct {
SecretName string `yaml:"secretName"`
}
type EnvPair struct {