Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kuma-cp): allow using Dataplane kind in top level targetRef in all policies #12659

Merged
merged 14 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ func validateTop(targetRef common_api.TargetRef) validators.ValidationError {
common_api.MeshGateway,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
IsInboundPolicy: true,
Automaat marked this conversation as resolved.
Show resolved Hide resolved
})
return targetRefErr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
common_api.MeshService,
common_api.MeshGateway,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
IsInboundPolicy: true,
})
return targetRefErr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ func (r *MeshFaultInjectionResource) validateTop(targetRef *common_api.TargetRef
common_api.MeshGateway,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
IsInboundPolicy: true,
})
default:
return mesh.ValidateTargetRef(*targetRef, &mesh.ValidateTargetRefOpts{
Expand All @@ -42,7 +44,9 @@ func (r *MeshFaultInjectionResource) validateTop(targetRef *common_api.TargetRef
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
IsInboundPolicy: true,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
common_api.MeshGateway,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (r *MeshHTTPRouteResource) validateTop(targetRef *common_api.TargetRef) val
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand All @@ -48,6 +49,7 @@ func (r *MeshHTTPRouteResource) validateTop(targetRef *common_api.TargetRef) val
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
common_api.MeshGateway,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand Down
2 changes: 2 additions & 0 deletions pkg/plugins/policies/meshmetric/api/v1alpha1/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (r *MeshMetricResource) validateTop(targetRef *common_api.TargetRef) valida
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.MeshGateway,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand All @@ -44,6 +45,7 @@ func (r *MeshMetricResource) validateTop(targetRef *common_api.TargetRef) valida
common_api.Mesh,
common_api.MeshSubset,
common_api.MeshService,
common_api.Dataplane,
common_api.MeshServiceSubset,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
SupportedKinds: []common_api.TargetRefKind{
common_api.Mesh,
common_api.MeshSubset,
common_api.Dataplane,
},
})
return targetRefErr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (r *MeshProxyPatchResource) validateTop(targetRef *common_api.TargetRef) va
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.MeshGateway,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: false,
})
Expand All @@ -52,6 +53,7 @@ func (r *MeshProxyPatchResource) validateTop(targetRef *common_api.TargetRef) va
SupportedKinds: []common_api.TargetRefKind{
common_api.Mesh,
common_api.MeshSubset,
common_api.Dataplane,
common_api.MeshService,
common_api.MeshServiceSubset,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ func (r *MeshRateLimitResource) validateTop(targetRef *common_api.TargetRef) val
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.MeshHTTPRoute,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
IsInboundPolicy: true,
})
default:
return mesh.ValidateTargetRef(*targetRef, &mesh.ValidateTargetRefOpts{
Expand All @@ -45,7 +47,9 @@ func (r *MeshRateLimitResource) validateTop(targetRef *common_api.TargetRef) val
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
IsInboundPolicy: true,
})
}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/plugins/policies/meshretry/api/v1alpha1/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (r *MeshRetryResource) validateTop(targetRef *common_api.TargetRef) validat
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.MeshHTTPRoute,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand All @@ -48,6 +49,7 @@ func (r *MeshRetryResource) validateTop(targetRef *common_api.TargetRef) validat
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
})
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/plugins/policies/meshtcproute/api/v1alpha1/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (r *MeshTCPRouteResource) validateTop(targetRef *common_api.TargetRef) vali
common_api.MeshGateway,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
GatewayListenerTagsAllowed: true,
})
Expand All @@ -43,6 +44,7 @@ func (r *MeshTCPRouteResource) validateTop(targetRef *common_api.TargetRef) vali
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/policies/meshtls/api/v1alpha1/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
SupportedKinds: []common_api.TargetRefKind{
common_api.Mesh,
common_api.MeshSubset,
common_api.Dataplane,
Automaat marked this conversation as resolved.
Show resolved Hide resolved
},
})
return targetRefErr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ func validateTop(targetRef *common_api.TargetRef) validators.ValidationError {
common_api.MeshSubset,
common_api.MeshService,
common_api.MeshServiceSubset,
common_api.Dataplane,
},
IsInboundPolicy: true,
})
return targetRefErr
}
Expand Down
Loading