Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <[email protected]>
  • Loading branch information
Pavel Okhlopkov committed Dec 23, 2024
1 parent 2211325 commit ad975ce
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions pkg/module_manager/models/hooks/kind/gohook.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,11 @@ func newHookConfigFromGoConfig(input *gohook.HookConfig) (config.HookConfig, err
/*** A HUGE copy paste from shell-operator’s hook_config.ConvertAndCheckV1 ***/
// WARNING no checks and defaults!
for i, kubeCfg := range input.Kubernetes {
// err := c.CheckOnKubernetesEventV1(kubeCfg, fmt.Sprintf("kubernetes[%d]", i))
// if err != nil {
// return fmt.Errorf("invalid kubernetes config [%d]: %v", i, err)
//}

monitor := &kubeeventsmanager.MonitorConfig{}
monitor.Metadata.DebugName = config.MonitorDebugName(kubeCfg.Name, i)
monitor.Metadata.MonitorId = config.MonitorConfigID()
monitor.Metadata.LogLabels = map[string]string{}
monitor.Metadata.MetricLabels = map[string]string{}
// monitor.WithMode(kubeCfg.Mode)
monitor.ApiVersion = kubeCfg.ApiVersion
monitor.Kind = kubeCfg.Kind
monitor.WithNameSelector(kubeCfg.NameSelector)
Expand Down Expand Up @@ -313,24 +307,10 @@ func newHookConfigFromGoConfig(input *gohook.HookConfig) (config.HookConfig, err
c.OnKubernetesEvents = append(c.OnKubernetesEvents, kubeConfig)
}

// for i, kubeCfg := range c.V1.OnKubernetesEvent {
// if len(kubeCfg.IncludeSnapshotsFrom) > 0 {
// err := c.CheckIncludeSnapshots(kubeCfg.IncludeSnapshotsFrom...)
// if err != nil {
// return fmt.Errorf("invalid kubernetes config [%d]: includeSnapshots %v", i, err)
// }
// }
//}

// schedule bindings with includeSnapshotsFrom
// are depend on kubernetes bindings.
c.Schedules = []htypes.ScheduleConfig{}
for _, inSch := range input.Schedule {
// err := c.CheckScheduleV1(rawSchedule)
// if err != nil {
// return fmt.Errorf("invalid schedule config [%d]: %v", i, err)
//}

res := htypes.ScheduleConfig{}

if inSch.Name == "" {
Expand All @@ -351,10 +331,6 @@ func newHookConfigFromGoConfig(input *gohook.HookConfig) (config.HookConfig, err
}
res.Group = "main"

// schedule, err := c.ConvertScheduleV1(rawSchedule)
// if err != nil {
// return err
//}
c.Schedules = append(c.Schedules, res)
}

Expand Down

0 comments on commit ad975ce

Please sign in to comment.