Fix potential nil pointer problem when both watchResources and waitForBuild are equal to false (#485)
This commit is contained in:
committed by
Soam Vasani
parent
e6191e3c69
commit
c56ed598cb
+2
-3
@@ -424,14 +424,13 @@ func specApply(c *cli.Context) error {
|
|||||||
checkErr(err, "apply specs")
|
checkErr(err, "apply specs")
|
||||||
printApplyStatus(as)
|
printApplyStatus(as)
|
||||||
|
|
||||||
var ctx context.Context
|
|
||||||
var pkgWatchCancel context.CancelFunc
|
|
||||||
if watchResources || waitForBuild {
|
if watchResources || waitForBuild {
|
||||||
// watch package builds
|
// watch package builds
|
||||||
ctx, pkgWatchCancel = context.WithCancel(context.Background())
|
|
||||||
pbw.addPackages(pkgMetas)
|
pbw.addPackages(pkgMetas)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, pkgWatchCancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
if watchResources {
|
if watchResources {
|
||||||
// if we're watching for files, we don't need to wait for builds to complete
|
// if we're watching for files, we don't need to wait for builds to complete
|
||||||
go pbw.watch(ctx)
|
go pbw.watch(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user