aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dashboard/app/subsystem.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/dashboard/app/subsystem.go b/dashboard/app/subsystem.go
index dfaa684ff..0b4300060 100644
--- a/dashboard/app/subsystem.go
+++ b/dashboard/app/subsystem.go
@@ -28,6 +28,9 @@ func reassignBugSubsystems(c context.Context, ns string, count int) error {
rev := getSubsystemRevision(c, ns)
for i, bugKey := range keys {
if bugs[i].hasUserSubsystems() {
+ // It might be that the user-set subsystem no longer exists.
+ // For now let's just log an error in this case.
+ checkOutdatedSubsystems(c, service, bugs[i])
// If we don't set the latst revision, we'll have to update this
// bug over and over again.
err = updateBugSubsystems(c, bugKey, nil, updateRevision(rev))
@@ -84,6 +87,14 @@ func bugsToUpdateSubsystems(c context.Context, ns string, count int) ([]*Bug, []
return bugs, keys, nil
}
+func checkOutdatedSubsystems(c context.Context, service *subsystem.Service, bug *Bug) {
+ for _, item := range bug.Tags.Subsystems {
+ if service.ByName(item.Name) == nil {
+ log.Errorf(c, "ns=%s bug=%s subsystem %s no longer exists", bug.Namespace, bug.Title, item.Name)
+ }
+ }
+}
+
type (
autoInference int
userAssignment string