Fix: properly handle nil downloadReleasedPolicy in getters

Ensure getter functions handle nil downloadReleasedPolicy correctly by creating a new instance when needed, maintaining backward compatibility with existing code while supporting air-gapped mode.

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-03 21:19:39 +00:00
parent 6f9c0ae85f
commit a8574c61ea

View File

@@ -91,8 +91,9 @@ func getResourceHandler(ctx context.Context, scanInfo *cautils.ScanInfo, tenantC
}
// Only initialize cloud connector if not in air-gapped mode
// This call initializes the global cloud API connector for later use
if !isAirGappedMode(scanInfo) {
getter.GetKSCloudAPIConnector()
_ = getter.GetKSCloudAPIConnector()
}
rbacObjects := getRBACHandler(tenantConfig, k8s, scanInfo.Submit)
return resourcehandler.NewK8sResourceHandler(k8s, hostSensorHandler, rbacObjects, tenantConfig.GetContextName())