(t *testing.T)
| 265 | } |
| 266 | |
| 267 | func TestApplyLabelWithRefH2C(t *testing.T) { |
| 268 | entries := makeRoutes(&container.Summary{ |
| 269 | Names: []string{"/netbird-server"}, |
| 270 | State: "running", |
| 271 | NetworkSettings: &container.NetworkSettingsSummary{ |
| 272 | Networks: map[string]*network.EndpointSettings{ |
| 273 | "network": { |
| 274 | IPAddress: testDockerIP, |
| 275 | }, |
| 276 | }, |
| 277 | }, |
| 278 | Labels: map[string]string{ |
| 279 | D.LabelAliases: "netbird-api, netbird-grpc", |
| 280 | "proxy.#1.port": "80", |
| 281 | "proxy.#1.scheme": "http", |
| 282 | "proxy.#2.port": "80", |
| 283 | "proxy.#2.scheme": "h2c", |
| 284 | }, |
| 285 | }) |
| 286 | api, ok := entries["netbird-api"] |
| 287 | expect.True(t, ok) |
| 288 | grpc, ok := entries["netbird-grpc"] |
| 289 | expect.True(t, ok) |
| 290 | |
| 291 | expect.Equal(t, api.Scheme, routeTypes.SchemeHTTP) |
| 292 | expect.Equal(t, grpc.Scheme, routeTypes.SchemeH2C) |
| 293 | expect.NoError(t, grpc.Validate()) |
| 294 | expect.Equal(t, grpc.TargetURL().Scheme, "h2c") |
| 295 | } |
| 296 | |
| 297 | func TestApplyLabelWithRefIndexError(t *testing.T) { |
| 298 | c := D.FromDocker(&container.Summary{ |
nothing calls this directly
no test coverage detected