Fix ExternalName service handling and add standardized workload mappings #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses service handling issues and adds support for standardized workload type mappings in the Otterize intents operator.
Changes
1. ExternalName Service Handling
Fixed handling of Kubernetes ExternalName services (e.g., Knative services) that don't have pod selectors:
api/v1alpha3/otterize_labels.go,api/v1beta1/otterize_labels.go,api/v2alpha1/otterize_labels.go,api/v2beta1/otterize_labels.go(nil, false, nil)instead of error when service has no selector2. Standardized Workload Type Mappings
Added standardized service name mappings for specific workload types to provide consistent policy application:
Existing workloads (from first commit):
argo-workflowsparkactions-runnerNew workload (from second commit):
execution3. Test Coverage
Added comprehensive unit tests:
TestResolvePodToServiceIdentity_WorkflowOwnerTestResolvePodToServiceIdentity_SparkApplicationOwnerTestResolvePodToServiceIdentity_RunnerDeploymentOwnerTestResolvePodToServiceIdentity_ExecutionOwnerTesting
Files Changed
src/operator/api/v1alpha3/otterize_labels.gosrc/operator/api/v1beta1/otterize_labels.gosrc/operator/api/v2alpha1/otterize_labels.gosrc/operator/api/v2beta1/otterize_labels.gosrc/shared/serviceidresolver/podownerresolver/podownerresolver.gosrc/shared/serviceidresolver/serviceidresolver_test.goTotal: 6 files changed, 277 insertions(+)
🤖 Generated with Claude Code