Skip to content

Commit

Permalink
amends
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Scherba <[email protected]>
  • Loading branch information
miklezzzz committed Dec 19, 2024
1 parent 345d75f commit a063fe5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pkg/hook/config/config_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,13 @@ func convertMutating(cfgV1 KubernetesAdmissionConfigV1) (htypes.MutatingConfig,
}

func (cv1 *HookConfigV1) CheckConversion(kubeConfigs []htypes.OnKubernetesEventConfig, cfgV1 KubernetesConversionConfigV1) error {
var allErr error

if len(cfgV1.IncludeSnapshotsFrom) > 0 {
if err := CheckIncludeSnapshots(kubeConfigs, cfgV1.IncludeSnapshotsFrom...); err != nil {
allErr = multierror.Append(allErr, fmt.Errorf("includeSnapshotsFrom is invalid: %w", err))
return fmt.Errorf("includeSnapshotsFrom is invalid: %w", err)
}
}

return allErr
return nil
}

func (cv1 *HookConfigV1) ConvertConversion(cfgV1 KubernetesConversionConfigV1) (htypes.ConversionConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/hook/hook_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (hm *Manager) loadHook(hookPath string) (*Hook, error) {
hook.WithTmpDir(hm.TempDir())

if hook.Config == nil {
return nil, fmt.Errorf("hook %s is marked as executable but doesn't contain config section", hook.Path)
return nil, fmt.Errorf("hook %q is marked as executable but doesn't contain config section", hook.Path)
}

hookEntry.Infof("Loaded config: %s", hook.GetConfigDescription())
Expand Down
2 changes: 1 addition & 1 deletion pkg/shell-operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (op *ShellOperator) initValidatingWebhookManager() error {

err := op.AdmissionWebhookManager.Init()
if err != nil {
return fmt.Errorf("ConversionWebhookManager init: %w", err)
return fmt.Errorf("ValidatingWebhookManager init: %w", err)
}

for _, hookName := range hookNames {
Expand Down

0 comments on commit a063fe5

Please sign in to comment.