Skip to content

Commit

Permalink
fixes based on golangci-lint run -v
Browse files Browse the repository at this point in the history
  • Loading branch information
monteiro-renato committed Nov 22, 2024
1 parent 910904b commit 011184e
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ const metricsRoleBindingName = "{{ .ProjectName }}-metrics-binding"
var _ = Describe("Manager", Ordered, func() {
var controllerPodName string
// Before running the tests, set up the environment by creating the namespace,
// Before running the tests, set up the environment by creating the namespace,
// installing CRDs, and deploying the controller.
BeforeAll(func() {
By("creating manager namespace")
Expand All @@ -197,7 +197,7 @@ var _ = Describe("Manager", Ordered, func() {
Expect(err).NotTo(HaveOccurred(), "Failed to deploy the controller-manager")
})
// After all tests have been executed, clean up by undeploying the controller, uninstalling CRDs,
// After all tests have been executed, clean up by undeploying the controller, uninstalling CRDs,
// and deleting the namespace.
AfterAll(func() {
By("cleaning up the curl pod for metrics")
Expand Down Expand Up @@ -271,7 +271,7 @@ var _ = Describe("Manager", Ordered, func() {
cmd := exec.Command("kubectl", "get",
"pods", "-l", "control-plane=controller-manager",
"-o", "go-template={{"{{"}} range .items {{"}}"}}" +
"{{"{{"}} if not .metadata.deletionTimestamp {{"}}"}}" +
"{{"{{"}} if not .metadata.deletionTimestamp {{"}}"}}" +
"{{"{{"}} .metadata.name {{"}}"}}"+
"{{"{{"}} \"\\n\" {{"}}"}}{{"{{"}} end {{"}}"}}{{"{{"}} end {{"}}"}}",
"-n", namespace,
Expand Down Expand Up @@ -369,10 +369,10 @@ var _ = Describe("Manager", Ordered, func() {
// +kubebuilder:scaffold:e2e-webhooks-checks
// TODO: Customize the e2e test suite with scenarios specific to your project.
// Consider applying sample/CR(s) and check their status and/or verifying
// TODO: Customize the e2e test suite with scenarios specific to your project.
// Consider applying sample/CR(s) and check their status and/or verifying
// the reconciliation by using the metrics, i.e.:
// metricsOutput := getMetricsOutput()
// metricsOutput := getMetricsOutput()
// Expect(metricsOutput).To(ContainSubstring(
// fmt.Sprintf(` + "`controller_runtime_reconcile_total{controller=\"%s\",result=\"success\"} 1`" + `,
// strings.ToLower(<Kind>),
Expand All @@ -381,7 +381,7 @@ var _ = Describe("Manager", Ordered, func() {
})
// serviceAccountToken returns a token for the specified service account in the given namespace.
// It uses the Kubernetes TokenRequest API to generate a token by directly sending a request
// It uses the Kubernetes TokenRequest API to generate a token by directly sending a request
// and parsing the resulting token from the API response.
func serviceAccountToken() (string, error) {
const tokenRequestRawString = ` + "`" + `{
Expand Down Expand Up @@ -411,7 +411,7 @@ func serviceAccountToken() (string, error) {
// Parse the JSON output to extract the token
var token tokenRequest
err = json.Unmarshal([]byte(output), &token)
err = json.Unmarshal(output, &token)
g.Expect(err).NotTo(HaveOccurred())
out = token.Status.Token
Expand Down

0 comments on commit 011184e

Please sign in to comment.