fix(installer): check parsePlatformSourceURL error, wait for PackageSource in E2E

Explicitly check error from parsePlatformSourceURL instead of relying on
the implicit guarantee that installPlatformSourceResource already checked
it. This prevents latent bugs if startup order is ever restructured.

Add wait for platform PackageSource existence in E2E test before creating
Package resource, preventing flaky failures when operator startup is slow.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin 2026-02-19 17:57:45 +03:00
parent 58e2b646be
commit dbfdbc8298
No known key found for this signature in database
GPG key ID: 7988329FDF395282
2 changed files with 8 additions and 2 deletions

View file

@ -230,8 +230,11 @@ func main() {
{
sourceRefKind := "OCIRepository"
if platformSourceURL != "" {
sourceType, _, _ := parsePlatformSourceURL(platformSourceURL)
// Error already checked by installPlatformSourceResource above
sourceType, _, err := parsePlatformSourceURL(platformSourceURL)
if err != nil {
setupLog.Error(err, "failed to parse platform source URL for PackageSource")
os.Exit(1)
}
if sourceType == "git" {
sourceRefKind = "GitRepository"
}