Setting package buildStatus to pending when functions source is updated. (#637)

This commit is contained in:
smruthi2187
2018-04-24 15:24:46 +08:00
committed by Ta-Ching Chen
parent 7198b24028
commit 772fdfa15c
2 changed files with 10 additions and 3 deletions
+4
View File
@@ -393,6 +393,10 @@ func fnUpdate(c *cli.Context) error {
fatal("Need --env or --deploy or --src or --pkg or --entrypoint or --buildcmd or --secret or --secretNamespace or --configmap or --configmapNamespace argument.")
}
if len(srcArchiveName) > 0 && len(deployArchiveName) > 0 {
fatal("Need either of --src or --deploy and not both arguments.")
}
if len(secretName) > 0 {
if len(function.Spec.Secrets) > 1 {
fatal("Please use 'fission spec apply' to update list of secrets")
+6 -3
View File
@@ -98,6 +98,10 @@ func pkgUpdate(c *cli.Context) error {
deployArchiveName := c.String("deploy")
buildcmd := c.String("buildcmd")
if len(srcArchiveName) > 0 && len(deployArchiveName) > 0 {
fatal("Need either of --src or --deploy and not both arguments.")
}
if len(srcArchiveName) == 0 && len(deployArchiveName) == 0 &&
len(envName) == 0 && len(buildcmd) == 0 {
fatal("Need --env or --src or --deploy or --buildcmd argument.")
@@ -158,9 +162,8 @@ func updatePackage(client *client.Client, pkg *crd.Package, envName,
pkg.Spec.Deployment = *deployArchiveMetadata
}
// Set package as pending status only when there is no
// deploy archive.
if needToBuild && len(pkg.Spec.Deployment.Type) == 0 {
// Set package as pending status when needToBuild is true
if needToBuild {
// change into pending state to trigger package build
pkg.Status = fission.PackageStatus{
BuildStatus: fission.BuildStatusPending,