Functions have access to secrets/configmaps specified by the user (#399)

This commit solves part of the issue #52 , functions are able to access secrets/configmaps specified by the user. For now, CLI only accept one secret/configmap. For advanced users, it will be able to use YAML to declare multiple secrets/configmaps in later changes.
This commit is contained in:
prithviramesh
2018-02-05 17:49:26 +08:00
committed by Ta-Ching Chen
parent 4cf195768e
commit 1eb0453ce4
14 changed files with 411 additions and 31 deletions
+7 -2
View File
@@ -417,7 +417,9 @@ func (envw *environmentWatcher) getBuilderDeploymentList(sel map[string]string)
}
func (envw *environmentWatcher) createBuilderDeployment(env *crd.Environment) (*v1beta1.Deployment, error) {
sharedMountPath := "/package"
sharedMountPath := "/packages"
sharedCfgMapPath := "/configs"
sharedSecretPath := "/secrets"
name := envw.getCacheKey(env.Metadata.Name, env.Metadata.ResourceVersion)
sel := envw.getLabels(env.Metadata.Name, env.Metadata.ResourceVersion)
var replicas int32 = 1
@@ -483,7 +485,10 @@ func (envw *environmentWatcher) createBuilderDeployment(env *crd.Environment) (*
MountPath: sharedMountPath,
},
},
Command: []string{"/fetcher", sharedMountPath},
Command: []string{"/fetcher",
"-secret-dir", sharedSecretPath,
"-cfgmap-dir", sharedCfgMapPath,
sharedMountPath},
ReadinessProbe: &apiv1.Probe{
InitialDelaySeconds: 5,
PeriodSeconds: 2,