Skip to content

Commit

Permalink
[go_lib::storage_class_change] fix Values path
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy-sn authored and nabokihms committed Nov 16, 2021
1 parent 37b2f21 commit 7188087
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go_lib/hooks/storage_class_change/hook.go
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/flant/addon-operator/pkg/module_manager/go_hook"
"github.com/flant/addon-operator/sdk"
"github.com/flant/shell-operator/pkg/kube_events_manager/types"
"github.com/iancoleman/strcase"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/policy/v1beta1"
storagev1 "k8s.io/api/storage/v1"
Expand Down Expand Up @@ -208,10 +209,10 @@ func calculateEffectiveStorageClass(input *go_hook.HookInput, args Args, current
effectiveStorageClass = input.ConfigValues.Get(configValuesPath).String()
}

var internalValuesPath = fmt.Sprintf("%s.internal.effectiveStorageClass", args.ModuleName)
var internalValuesPath = fmt.Sprintf("%s.internal.effectiveStorageClass", strcase.ToLowerCamel(args.ModuleName))

if args.InternalValuesSubPath != "" {
internalValuesPath = fmt.Sprintf("%s.internal.%s.effectiveStorageClass", args.ModuleName, args.InternalValuesSubPath)
internalValuesPath = fmt.Sprintf("%s.internal.%s.effectiveStorageClass", strcase.ToLowerCamel(args.ModuleName), args.InternalValuesSubPath)
}

if len(effectiveStorageClass) == 0 {
Expand Down

0 comments on commit 7188087

Please sign in to comment.