MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / updateCommonVariableValueV1

Function updateCommonVariableValueV1

pkg/cmd/tenant/variables/update/update.go:1026–1044  ·  view source on GitHub ↗
(opts *UpdateOptions, vars *variables.TenantVariables)

Source from the content-addressed store, hash-verified

1024}
1025
1026func updateCommonVariableValueV1(opts *UpdateOptions, vars *variables.TenantVariables) (bool, error) {
1027 for _, v := range vars.LibraryVariables {
1028 if strings.EqualFold(v.LibraryVariableSetName, opts.LibraryVariableSet.Value) {
1029 t, err := findTemplate(v.Templates, opts.Name.Value)
1030 if err != nil {
1031 return false, err
1032 }
1033 value, err := convertValue(opts, t)
1034 if err != nil {
1035 return false, err
1036 }
1037 v.Variables[t.ID] = *value
1038
1039 return value.IsSensitive, nil
1040 }
1041 }
1042
1043 return false, fmt.Errorf("unable to find requested variable")
1044}
1045
1046func convertValue(opts *UpdateOptions, t *actiontemplates.ActionTemplateParameter) (*core.PropertyValue, error) {
1047 variableType := resources.ControlType(t.DisplaySettings["Octopus.ControlType"])

Callers 1

updateRunV1Function · 0.85

Calls 2

findTemplateFunction · 0.85
convertValueFunction · 0.85

Tested by

no test coverage detected