Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Juansasa committed Feb 26, 2025
1 parent 6d75383 commit f641d6f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
1 change: 1 addition & 0 deletions internal/controller/keycloak_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controller
import (
"context"
"fmt"

v12 "github.com/openshift/api/route/v1"
ssov1alpha1 "github.com/stakater/rhbk-operator/api/v1alpha1"
"github.com/stakater/rhbk-operator/internal/resources"
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/keycloakimport_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controller
import (
"context"
"fmt"

"github.com/go-logr/logr"
ssov1alpha1 "github.com/stakater/rhbk-operator/api/v1alpha1"
"github.com/stakater/rhbk-operator/internal/constants"
Expand Down Expand Up @@ -131,8 +132,7 @@ func (r *KeycloakImportReconciler) Reconcile(ctx context.Context, req ctrl.Reque

// If no job found create job and wait for next reconcile when job is completed
if found == nil {
importJob := &v14.Job{}
importJob, err = resources.Build(cr, statefulSet, importSecret.Resource.ResourceVersion, r.Scheme)
importJob, err := resources.Build(cr, statefulSet, importSecret.Resource.ResourceVersion, r.Scheme)
if err != nil {
return r.HandleError(ctx, cr, err, "Failed to build import job")
}
Expand Down
9 changes: 1 addition & 8 deletions internal/resources/realm_import_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package resources

import (
"fmt"

"github.com/stakater/rhbk-operator/api/v1alpha1"
"github.com/stakater/rhbk-operator/internal/constants"
v1 "k8s.io/api/apps/v1"
v12 "k8s.io/api/batch/v1"
v14 "k8s.io/api/core/v1"
v13 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
)
Expand All @@ -25,13 +25,6 @@ func GetRealmMountPath(cr *v1alpha1.KeycloakImport) string {
return fmt.Sprintf("/mnt/realm-import/%s-realm.json", cr.Name)
}

func GetImportJobSelectorLabel(importCrName string, secretRevision string) labels.Selector {
return labels.SelectorFromSet(map[string]string{
constants.RHBKRealmImportLabel: importCrName,
constants.RHBKRealmImportRevisionLabel: secretRevision,
})
}

func Build(cr *v1alpha1.KeycloakImport, sts *v1.StatefulSet, revision string, scheme *runtime.Scheme) (*v12.Job, error) {
template := sts.Spec.Template.DeepCopy()
template.Labels["app"] = "realm-import-job"
Expand Down
5 changes: 3 additions & 2 deletions internal/resources/realm_import_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bytes"
"context"
"fmt"
"strconv"
"text/template"

"github.com/stakater/rhbk-operator/internal/constants"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"strconv"
"text/template"

"github.com/stakater/rhbk-operator/api/v1alpha1"
v1 "k8s.io/api/core/v1"
Expand Down
3 changes: 2 additions & 1 deletion internal/resources/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"encoding/json"
"fmt"
"hash/fnv"
"strconv"

v12 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/labels"
"strconv"

"github.com/stakater/rhbk-operator/internal/constants"
v1 "k8s.io/api/batch/v1"
Expand Down

0 comments on commit f641d6f

Please sign in to comment.