Skip to content

Commit

Permalink
replace kutil.Key with client.ObjectKey
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeindel committed Jun 3, 2024
1 parent 255ea48 commit 923a3b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/lifecycle/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (a *actuator) addCleanupOfOldAdditionalProviders(dnsProviders map[string]co
provider := &dnsv1alpha1.DNSProvider{}
if err := a.Client().Get(
ctx,
kutil.Key(namespace, ExternalDNSProviderName),
client.ObjectKey{Namespace: namespace, Name: ExternalDNSProviderName},
provider,
); err == nil {
dnsProviders[provider.Name] = component.OpDestroyAndWait(NewProviderDeployWaiter(
Expand Down Expand Up @@ -485,7 +485,7 @@ func (a *actuator) addAdditionalDNSProviders(providers map[string]*dnsv1alpha1.D
secret := &corev1.Secret{}
if err := a.Client().Get(
ctx,
kutil.Key(namespace, mappedSecretName),
client.ObjectKey{Namespace: namespace, Name: mappedSecretName},
secret,
); err != nil {
result = multierror.Append(result, fmt.Errorf("could not get dns provider[%d] secret %q -> %q: %w", i, *p.SecretName, mappedSecretName, err))
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/lifecycle/dnsrecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"context"

extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -18,7 +17,7 @@ import (
// If the DNSRecord resource is not found, it returns nil.
func GetSecretRefFromDNSRecordExternal(ctx context.Context, c client.Client, namespace, shootName string) (*corev1.SecretReference, string, *string, error) {
dns := &extensionsv1alpha1.DNSRecord{}
if err := c.Get(ctx, kutil.Key(namespace, shootName+"-external"), dns); client.IgnoreNotFound(err) != nil && !meta.IsNoMatchError(err) {
if err := c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: shootName + "-external"}, dns); client.IgnoreNotFound(err) != nil && !meta.IsNoMatchError(err) {
return nil, "", nil, err
}

Expand Down

0 comments on commit 923a3b1

Please sign in to comment.