Setting package buildStatus to pending when functions source is updated. (#637)
This commit is contained in:
committed by
Ta-Ching Chen
parent
7198b24028
commit
772fdfa15c
@@ -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.")
|
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(secretName) > 0 {
|
||||||
if len(function.Spec.Secrets) > 1 {
|
if len(function.Spec.Secrets) > 1 {
|
||||||
fatal("Please use 'fission spec apply' to update list of secrets")
|
fatal("Please use 'fission spec apply' to update list of secrets")
|
||||||
|
|||||||
+6
-3
@@ -98,6 +98,10 @@ func pkgUpdate(c *cli.Context) error {
|
|||||||
deployArchiveName := c.String("deploy")
|
deployArchiveName := c.String("deploy")
|
||||||
buildcmd := c.String("buildcmd")
|
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 &&
|
if len(srcArchiveName) == 0 && len(deployArchiveName) == 0 &&
|
||||||
len(envName) == 0 && len(buildcmd) == 0 {
|
len(envName) == 0 && len(buildcmd) == 0 {
|
||||||
fatal("Need --env or --src or --deploy or --buildcmd argument.")
|
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
|
pkg.Spec.Deployment = *deployArchiveMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set package as pending status only when there is no
|
// Set package as pending status when needToBuild is true
|
||||||
// deploy archive.
|
if needToBuild {
|
||||||
if needToBuild && len(pkg.Spec.Deployment.Type) == 0 {
|
|
||||||
// change into pending state to trigger package build
|
// change into pending state to trigger package build
|
||||||
pkg.Status = fission.PackageStatus{
|
pkg.Status = fission.PackageStatus{
|
||||||
BuildStatus: fission.BuildStatusPending,
|
BuildStatus: fission.BuildStatusPending,
|
||||||
|
|||||||
Reference in New Issue
Block a user