Skip to content

Commit

Permalink
fix: endpointslices belongs to discovery.k8s.io group
Browse files Browse the repository at this point in the history
Signed-off-by: rambohe-ch <[email protected]>
  • Loading branch information
rambohe-ch committed Jan 6, 2025
1 parent 290d189 commit af1d3c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1444,12 +1444,12 @@ webhooks:
service:
name: yurt-manager-webhook-service
namespace: {{ .Release.Namespace }}
path: /mutate-core-openyurt-io-v1-endpointslice
path: /mutate-discovery-k8s-io-v1-endpointslice
failurePolicy: Ignore
name: mutate.core.v1.endpointslice.openyurt.io
name: mutate.discovery.v1.endpointslice.k8s.io
rules:
- apiGroups:
- ""
- discovery.k8s.io
apiVersions:
- v1
operations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func remapAutonomyEndpoints(ctx context.Context, client client.Client, slice *di
return nil
}

for _, e := range slice.Endpoints {
readyServing := true
for i, e := range slice.Endpoints {
// If the endpoint is ready, skip
if e.Conditions.Ready != nil && *e.Conditions.Ready {
continue
Expand Down Expand Up @@ -115,10 +116,10 @@ func remapAutonomyEndpoints(ctx context.Context, client client.Client, slice *di

// Set not ready addresses to ready & serving
if e.Conditions.Ready != nil {
*e.Conditions.Ready = true
slice.Endpoints[i].Conditions.Ready = &readyServing
}
if e.Conditions.Serving != nil {
*e.Conditions.Serving = true
slice.Endpoints[i].Conditions.Serving = &readyServing
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ func (webhook *EndpointSliceHandler) SetupWebhookWithManager(mgr ctrl.Manager) (
return util.RegisterWebhook(mgr, &v1.EndpointSlice{}, webhook)
}

// +kubebuilder:webhook:path=/mutate-core-openyurt-io-v1-endpointslice,mutating=true,failurePolicy=ignore,sideEffects=None,admissionReviewVersions=v1,groups="",resources=endpointslices,verbs=update,versions=v1,name=mutate.core.v1.endpointslice.openyurt.io
// +kubebuilder:webhook:path=/mutate-discovery-k8s-io-v1-endpointslice,mutating=true,failurePolicy=ignore,sideEffects=None,admissionReviewVersions=v1,groups="discovery.k8s.io",resources=endpointslices,verbs=update,versions=v1,name=mutate.discovery.v1.endpointslice.k8s.io

var _ webhook.CustomDefaulter = &EndpointSliceHandler{}

0 comments on commit af1d3c4

Please sign in to comment.