|
| 1 | +/* |
| 2 | +Copyright 2025 The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
1 | 17 | package registry
|
2 | 18 |
|
3 | 19 | import (
|
@@ -76,8 +92,8 @@ func (dr DNSRecord) IsEndpoint(e *endpoint.Endpoint) bool {
|
76 | 92 | func (dr DNSRecord) EndpointLabels() endpoint.Labels {
|
77 | 93 | labels := endpoint.Labels{}
|
78 | 94 |
|
79 |
| - labels[endpoint.OwnerLabelKey] = dr.ObjectMeta.Labels[RecordOwnerLabel] |
80 |
| - labels[endpoint.ResourceLabelKey] = dr.ObjectMeta.Labels[RecordResourceLabel] |
| 95 | + labels[endpoint.OwnerLabelKey] = dr.Labels[RecordOwnerLabel] |
| 96 | + labels[endpoint.ResourceLabelKey] = dr.Labels[RecordResourceLabel] |
81 | 97 | return labels
|
82 | 98 | }
|
83 | 99 |
|
@@ -158,7 +174,7 @@ func NewCRDClientForAPIVersionKind(client kubernetes.Interface, kubeConfig, apiS
|
158 | 174 | )
|
159 | 175 | metav1.AddToGroupVersion(scheme, groupVersion)
|
160 | 176 |
|
161 |
| - config.ContentConfig.GroupVersion = &groupVersion |
| 177 | + config.GroupVersion = &groupVersion |
162 | 178 | config.APIPath = "/apis"
|
163 | 179 | config.NegotiatedSerializer = serializer.WithoutConversionCodecFactory{CodecFactory: serializer.NewCodecFactory(scheme)}
|
164 | 180 |
|
@@ -459,32 +475,32 @@ func (r *crdrequest) Body(obj interface{}) CRDRequest {
|
459 | 475 | }
|
460 | 476 |
|
461 | 477 | func (r *crdrequest) Do(ctx context.Context) CRDResult {
|
462 |
| - var real *rest.Request |
| 478 | + var req *rest.Request |
463 | 479 | switch r.method {
|
464 | 480 | case "POST":
|
465 |
| - real = r.client.Interface.Post() |
| 481 | + req = r.client.Interface.Post() |
466 | 482 | case "PUT":
|
467 |
| - real = r.client.Interface.Put() |
| 483 | + req = r.client.Interface.Put() |
468 | 484 | case "DELETE":
|
469 |
| - real = r.client.Interface.Delete() |
| 485 | + req = r.client.Interface.Delete() |
470 | 486 | default:
|
471 |
| - real = r.client.Interface.Get() |
| 487 | + req = r.client.Interface.Get() |
472 | 488 | }
|
473 | 489 |
|
474 |
| - real = real.Namespace(r.namespace).Resource(r.resource.Name) |
| 490 | + req = req.Namespace(r.namespace).Resource(r.resource.Name) |
475 | 491 | if r.name != "" {
|
476 |
| - real = real.Name(r.name) |
| 492 | + req = req.Name(r.name) |
477 | 493 | }
|
478 | 494 |
|
479 | 495 | if r.params != nil {
|
480 |
| - real = real.VersionedParams(r.params, r.client.codec) |
| 496 | + req = req.VersionedParams(r.params, r.client.codec) |
481 | 497 | }
|
482 | 498 |
|
483 | 499 | if r.body != nil {
|
484 |
| - real = real.Body(r.body) |
| 500 | + req = req.Body(r.body) |
485 | 501 | }
|
486 | 502 |
|
487 |
| - result := real.Do(ctx) |
| 503 | + result := req.Do(ctx) |
488 | 504 | return &crdresult{result}
|
489 | 505 | }
|
490 | 506 |
|
|
0 commit comments