Set package initial status if its empty (#1522)
If the user applies package YAML file has no status field, the package won't be able to be compiled or deployed due to lack of status. This PR aims to add a check at buildermgr to set initial package status to those packages.
This commit is contained in:
@@ -268,6 +268,9 @@ type (
|
||||
|
||||
// PackageStatus contains the build status of a package also the build log for examination.
|
||||
PackageStatus struct {
|
||||
// TODO: Add another status field to indicate whether a package
|
||||
// is ready for deploy instead of setting "none" in build status.
|
||||
|
||||
// BuildStatus is the package build status.
|
||||
BuildStatus BuildStatus `json:"buildstatus,omitempty"`
|
||||
|
||||
@@ -684,3 +687,7 @@ type (
|
||||
GetObjectMeta() metav1.Object
|
||||
}
|
||||
)
|
||||
|
||||
func (a Archive) IsEmpty() bool {
|
||||
return len(a.Literal) == 0 && len(a.URL) == 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user