Enable multiple installations by not failing if all existing default resources exists #335
GitHub Actions / JUnit Test Report
failed
Dec 10, 2024 in 0s
44 tests run, 43 passed, 0 skipped, 1 failed.
Annotations
Check failure on line 1 in com/port-labs/port-k8s-exporter/pkg/defaults
github-actions / JUnit Test Report
com/port-labs/port-k8s-exporter/pkg/defaults.Test_InitIntegration_InitDefaults
Failed
Raw output
=== RUN Test_InitIntegration_InitDefaults
I1210 13:03:32.029675 10937 init.go:20] Initializing Port integration
I1210 13:03:32.217359 10937 init.go:31] Could not get integration with state key 05a78aff-f037-4047-9f5b-ac978092fab2, error: error getting Port integration: failed to get integration, got: {"ok":false,"error":"not_found","message":"Integration with installationId \"05a78aff-f037-4047-9f5b-ac978092fab2\" was not found","details":{"resource":"Integration","byField":"installationId","withValue":"05a78aff-f037-4047-9f5b-ac978092fab2"}}
I1210 13:03:32.217377 10937 init.go:32] Creating integration
I1210 13:03:32.217384 10937 init.go:37] Creating default resources
I1210 13:03:34.485923 10937 defaults.go:198] Created blueprint workload
I1210 13:03:34.566240 10937 defaults.go:198] Created blueprint cluster
I1210 13:03:34.796929 10937 defaults.go:198] Created blueprint namespace
I1210 13:03:42.634112 10937 defaults.go:254] Created page workload_overview_dashboard
W1210 13:03:45.615963 10937 defaults.go:251] Failed to create page availability_scorecard_dashboard: error creating Port page: failed to create page, got: {"ok":false,"error":"role_not_found","message":"Role with name \"bp_A9dq0LL9tSW4ZgmQ-moderator\" was not found","details":{"field":"name","value":"bp_A9dq0LL9tSW4ZgmQ-moderator"}}
I1210 13:03:45.615998 10937 defaults.go:138] Failed to create resources: error creating Port page: failed to create page, got: {"ok":false,"error":"role_not_found","message":"Role with name \"bp_A9dq0LL9tSW4ZgmQ-moderator\" was not found","details":{"field":"name","value":"bp_A9dq0LL9tSW4ZgmQ-moderator"}}.
I1210 13:03:45.616010 10937 defaults.go:280] Failed to create resources. Rolling back blueprints: [workload cluster namespace]
W1210 13:03:46.749320 10937 init.go:39] Error initializing defaults: AbortDefaultCreationError
W1210 13:03:46.749347 10937 init.go:40] The integration will start without default integration mapping and other default resources. Please create them manually in Port.
I1210 13:03:46.749355 10937 init.go:47] Could not create default resources, creating integration with no resources
I1210 13:03:46.749362 10937 init.go:48] Creating integration with config: &{false false [] false <nil> <nil>}
defaults_test.go:83:
Error Trace: /home/runner/work/port-k8s-exporter/port-k8s-exporter/pkg/defaults/defaults_test.go:83
Error: Expected nil, but got: &errors.errorString{s:"error getting Port blueprint: failed to get blueprint, got: {\"ok\":false,\"error\":\"not_found\",\"message\":\"Blueprint with identifier \\\"workload\\\" was not found\",\"details\":{\"resource\":\"Blueprint\",\"byField\":\"identifier\",\"withValue\":\"workload\"}}"}
Test: Test_InitIntegration_InitDefaults
defaults_test.go:86:
Error Trace: /home/runner/work/port-k8s-exporter/port-k8s-exporter/pkg/defaults/defaults_test.go:86
Error: Expected nil, but got: &errors.errorString{s:"error getting Port blueprint: failed to get blueprint, got: {\"ok\":false,\"error\":\"not_found\",\"message\":\"Blueprint with identifier \\\"namespace\\\" was not found\",\"details\":{\"resource\":\"Blueprint\",\"byField\":\"identifier\",\"withValue\":\"namespace\"}}"}
Test: Test_InitIntegration_InitDefaults
defaults_test.go:89:
Error Trace: /home/runner/work/port-k8s-exporter/port-k8s-exporter/pkg/defaults/defaults_test.go:89
Error: Expected nil, but got: &errors.errorString{s:"error getting Port blueprint: failed to get blueprint, got: {\"ok\":false,\"error\":\"not_found\",\"message\":\"Blueprint with identifier \\\"cluster\\\" was not found\",\"details\":{\"resource\":\"Blueprint\",\"byField\":\"identifier\",\"withValue\":\"cluster\"}}"}
Test: Test_InitIntegration_InitDefaults
defaults_test.go:92:
Error Trace: /home/runner/work/port-k8s-exporter/port-k8s-exporter/pkg/defaults/defaults_test.go:92
Error: Expected nil, but got: &errors.errorString{s:"error getting Port page: failed to get page, got: {\"ok\":false,\"error\":\"not_found\",\"message\":\"Page with identifier \\\"workload_overview_dashboard\\\" was not found\",\"details\":{\"resource\":\"Page\",\"byField\":\"identifier\",\"withValue\":\"workload_overview_dashboard\"}}"}
Test: Test_InitIntegration_InitDefaults
defaults_test.go:95:
Error Trace: /home/runner/work/port-k8s-exporter/port-k8s-exporter/pkg/defaults/defaults_test.go:95
Error: Expected nil, but got: &errors.errorString{s:"error getting Port page: failed to get page, got: {\"ok\":false,\"error\":\"not_found\",\"message\":\"Page with identifier \\\"availability_scorecard_dashboard\\\" was not found\",\"details\":{\"resource\":\"Page\",\"byField\":\"identifier\",\"withValue\":\"availability_scorecard_dashboard\"}}"}
Test: Test_InitIntegration_InitDefaults
defaults_test.go:27: Deleting default resources for 05a78aff-f037-4047-9f5b-ac978092fab2
--- FAIL: Test_InitIntegration_InitDefaults (20.93s)
Loading