Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nesmabadr committed Jan 13, 2025
1 parent 75c8252 commit 8c83717
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
"github.com/kyma-project/lifecycle-manager/internal/crd"
"github.com/kyma-project/lifecycle-manager/internal/descriptor/provider"
"github.com/kyma-project/lifecycle-manager/internal/event"
"github.com/kyma-project/lifecycle-manager/internal/maintenancewindows"
"github.com/kyma-project/lifecycle-manager/internal/manifest/manifestclient"
"github.com/kyma-project/lifecycle-manager/internal/pkg/flags"
"github.com/kyma-project/lifecycle-manager/internal/pkg/metrics"
Expand All @@ -68,7 +69,6 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"
_ "ocm.software/ocm/api/ocm"
//nolint:gci // kubebuilder's scaffold imports must be appended here.
"github.com/kyma-project/lifecycle-manager/internal/maintenancewindows"
)

const (
Expand Down Expand Up @@ -137,8 +137,10 @@ func pprofStartServer(addr string, timeout time.Duration, setupLog logr.Logger)
}
}

// nolint: funlen // setupManager is a main function that sets up the manager

Check failure on line 140 in cmd/main.go

View workflow job for this annotation

GitHub Actions / lint

directive `// nolint: funlen // setupManager is a main function that sets up the manager` should be written without leading space as `//nolint: funlen // setupManager is a main function that sets up the manager` (nolintlint)
func setupManager(flagVar *flags.FlagVar, cacheOptions cache.Options, scheme *machineryruntime.Scheme,
setupLog logr.Logger) { //nolint: funlen // setupManager is a main function that sets up the manager
setupLog logr.Logger,
) {
config := ctrl.GetConfigOrDie()
config.QPS = float32(flagVar.ClientQPS)
config.Burst = flagVar.ClientBurst
Expand Down Expand Up @@ -188,7 +190,7 @@ func setupManager(flagVar *flags.FlagVar, cacheOptions cache.Options, scheme *ma
mandatoryModulesMetrics := metrics.NewMandatoryModulesMetrics()
moduleMetrics := metrics.NewModuleMetrics()

// TODO: The maintenance windows policy should be passed to the manifest reconciler to be resolved: https://github.com/kyma-project/lifecycle-manager/issues/2101
// The maintenance windows policy should be passed to the manifest reconciler to be resolved: https://github.com/kyma-project/lifecycle-manager/issues/2101
_, err = maintenancewindows.InitializeMaintenanceWindowsPolicy(setupLog)
if err != nil {
setupLog.Error(err, "unable to set maintenance windows policy")
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module github.com/kyma-project/lifecycle-manager

go 1.23.4

replace github.com/kyma-project/lifecycle-manager/api => ./api

replace github.com/kyma-project/lifecycle-manager/maintenancewindows => ./maintenancewindows
replace (
github.com/kyma-project/lifecycle-manager/api => ./api
github.com/kyma-project/lifecycle-manager/maintenancewindows => ./maintenancewindows
)

require (
github.com/Masterminds/semver/v3 v3.3.1
Expand Down
2 changes: 1 addition & 1 deletion internal/maintenancewindows/maintenance_policy_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func InitializeMaintenanceWindowsPolicy(log logr.Logger) (*resolver.MaintenanceW
policyFilePath := fmt.Sprintf("%s/%s.json", policiesDirectory, policyName)
if !maintenancePolicyFileExists(policyFilePath) {
log.Info("maintenance windows policy file does not exist")
return nil, nil
return nil, nil //nolint:nilnil //use nil to indicate an empty Maintenance Window Policy
}

maintenancePolicyPool, err := resolver.GetMaintenancePolicyPool()
Expand Down

0 comments on commit 8c83717

Please sign in to comment.