Implement platform management features
This commit is contained in:
@@ -1667,6 +1667,14 @@ func ValidateLogStream(stream domain.LogStream) error {
|
||||
if !validLogStorageBackend(stream.StorageBackend) {
|
||||
violations = append(violations, "storageBackend is invalid")
|
||||
}
|
||||
hasSessionID := strings.TrimSpace(stream.LogSessionID) != ""
|
||||
hasSessionStart := !stream.SessionStartedAt.IsZero()
|
||||
if hasSessionID != hasSessionStart {
|
||||
violations = append(violations, "logSessionId and sessionStartedAt must be provided together")
|
||||
}
|
||||
if (hasSessionID || hasSessionStart) && stream.Source != domain.LogStreamSourceProcess {
|
||||
violations = append(violations, "log session metadata is only valid for process streams")
|
||||
}
|
||||
return finish(violations)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user