Skip to content

Commit

Permalink
Allow non user-configurable properties in VM deployment
Browse files Browse the repository at this point in the history
Currently, VM operator ignores any vApp properties that are not user
configurable when patching with values specified in the bootstrap
resources (VM metadata ConfigMap/Secret). There are some valid
use-cases where users might want to patch hidden properties defined in
an image. This change fixes this behavior.

Fixes vmware-tanzu#181.
  • Loading branch information
aruneshpa committed Sep 7, 2023
1 parent a95f788 commit 95131f4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/vmprovider/providers/vsphere/session/session_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ func MergeExtraConfig(extraConfig []vimTypes.BaseOptionValue, newMap map[string]
func GetMergedvAppConfigSpec(inProps map[string]string, vmProps []vimTypes.VAppPropertyInfo) *vimTypes.VmConfigSpec {
outProps := make([]vimTypes.VAppPropertySpec, 0)

// Update any vApp properties if they have been specified in VM metadata.
for _, vmProp := range vmProps {
if vmProp.UserConfigurable == nil || !*vmProp.UserConfigurable {
continue
}

inPropValue, found := inProps[vmProp.Id]
if !found || vmProp.Value == inPropValue {
continue
Expand Down

0 comments on commit 95131f4

Please sign in to comment.