(opts *UpdateOptions, vars *variables.TenantVariables)
| 1024 | } |
| 1025 | |
| 1026 | func 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 | |
| 1046 | func convertValue(opts *UpdateOptions, t *actiontemplates.ActionTemplateParameter) (*core.PropertyValue, error) { |
| 1047 | variableType := resources.ControlType(t.DisplaySettings["Octopus.ControlType"]) |
no test coverage detected