diff --git a/cmd/main.go b/cmd/main.go index 53f491634d..c9fe649fa5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -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" @@ -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 ( @@ -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 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 @@ -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") diff --git a/go.mod b/go.mod index d868cb6d86..4f3e849560 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/maintenancewindows/maintenance_policy_handler.go b/internal/maintenancewindows/maintenance_policy_handler.go index af42e16223..bf89e7a354 100644 --- a/internal/maintenancewindows/maintenance_policy_handler.go +++ b/internal/maintenancewindows/maintenance_policy_handler.go @@ -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()