(ctx context.Context, creds map[string]string)
| 1127 | } |
| 1128 | |
| 1129 | func (rc *RunContext) handleServiceCredentials(ctx context.Context, creds map[string]string) (username, password string, err error) { |
| 1130 | if creds == nil { |
| 1131 | return |
| 1132 | } |
| 1133 | if len(creds) != 2 { |
| 1134 | err = fmt.Errorf("invalid property count for key 'credentials:'") |
| 1135 | return |
| 1136 | } |
| 1137 | |
| 1138 | ee := rc.NewExpressionEvaluator(ctx) |
| 1139 | if username = ee.Interpolate(ctx, creds["username"]); username == "" { |
| 1140 | err = fmt.Errorf("failed to interpolate credentials.username") |
| 1141 | return |
| 1142 | } |
| 1143 | |
| 1144 | if password = ee.Interpolate(ctx, creds["password"]); password == "" { |
| 1145 | err = fmt.Errorf("failed to interpolate credentials.password") |
| 1146 | return |
| 1147 | } |
| 1148 | |
| 1149 | return |
| 1150 | } |
| 1151 | |
| 1152 | // GetServiceBindsAndMounts returns the binds and mounts for the service container, resolving paths as appropriate |
| 1153 | func (rc *RunContext) GetServiceBindsAndMounts(svcVolumes []string) ([]string, map[string]string) { |
no test coverage detected