Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Weit <[email protected]>
  • Loading branch information
aviweit committed Jun 25, 2024
1 parent f73b4b9 commit 805194c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/controlplane/control/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

// Restart coredns deployment
// Restart coredns deployment.
func restartCoreDNS(ctx context.Context, mClient client.Client, logger *logrus.Entry) error {
logger.Infof("restarting coredns deployment")
patch := []byte(
fmt.Sprintf(
`{"spec": {"template": {"metadata": {"annotations":{"kubectl.kubernetes.io/restartedAt": "%s"}}}}}`,
`{"spec": {"template": {"metadata": {"annotations":{"kubectl.kubernetes.io/restartedAt": %q}}}}}`,
time.Now().String(),
),
)
Expand All @@ -51,7 +51,7 @@ func restartCoreDNS(ctx context.Context, mClient client.Client, logger *logrus.E
return nil
}

// Add coredns rewrite for a given external dns service
// Add coredns rewrite for a given external dns service.
func addCoreDNSRewrite(ctx context.Context, mClient client.Client, logger *logrus.Entry, name *types.NamespacedName, alias string) error {
corednsName := types.NamespacedName{
Name: "coredns",
Expand All @@ -63,9 +63,8 @@ func addCoreDNSRewrite(ctx context.Context, mClient client.Client, logger *logru
if k8serrors.IsNotFound(err) {
logger.Warnf("coredns configmap not found.")
return nil
} else {
return err
}
return err
}
if data, ok := cm.Data["Corefile"]; ok {

Check failure on line 69 in pkg/controlplane/control/dns.go

View workflow job for this annotation

GitHub Actions / static-checks

`if ok` has complex nested blocks (complexity: 11) (nestif)
// remove trailing end-of-line
Expand Down Expand Up @@ -135,9 +134,8 @@ func removeCoreDNSRewrite(ctx context.Context, mClient client.Client, logger *lo
if k8serrors.IsNotFound(err) {
logger.Warnf("coredns configmap not found.")
return nil
} else {
return err
}
return err
}
if data, ok := cm.Data["Corefile"]; ok {

Check failure on line 140 in pkg/controlplane/control/dns.go

View workflow job for this annotation

GitHub Actions / static-checks

`if ok` has complex nested blocks (complexity: 7) (nestif)
// remove trailing end-of-line
Expand Down

0 comments on commit 805194c

Please sign in to comment.