Split out the Package type into a first class Kubernetes resource (#295)

Split out the Package type into a first class Kubernetes resource. Before this change, packages were implicitly tied to functions.

This wasn't ideal because:
 * Functions will need to share packages
 * A package storage system may be more generally useful than just
   functions (for example, for storing static assets)

This change does the following:
* Updates the fission and tpr types to add a new Package and PackageSpec.  It also creates a PackageRef type, and a FunctionPackageRef type. The PackageRef simply references a package, but the FunctionPackageRef includes the name of a function within the package. This allows us to share packages between different functions.
* Updates fetcher and other components for first-class packages
* Allows customization of fetcher image pull policy in the helm charts
This commit is contained in:
Soam Vasani
2017-08-25 13:40:45 -07:00
committed by GitHub
parent b19be5c0a3
commit 6f017cf400
20 changed files with 639 additions and 121 deletions
+8 -4
View File
@@ -46,9 +46,13 @@ func functionTests(tprClient *rest.RESTClient) {
Name: "hello",
},
Spec: fission.FunctionSpec{
Source: fission.Package{},
Deployment: fission.Package{
Literal: []byte("hi"),
Source: fission.FunctionPackageRef{},
Deployment: fission.FunctionPackageRef{
PackageRef: fission.PackageRef{
Name: "foo",
Namespace: "bar",
},
FunctionName: "hello",
},
EnvironmentName: "xxx",
},
@@ -70,7 +74,7 @@ func functionTests(tprClient *rest.RESTClient) {
// read
f, err = fi.Get(function.Metadata.Name)
panicIf(err)
if len(f.Spec.Deployment.Literal) != len(function.Spec.Deployment.Literal) {
if f.Spec.Deployment.FunctionName != function.Spec.Deployment.FunctionName {
log.Panicf("Bad result from Get: %v", f)
}