Skip to content

loader panic #471

@nicks

Description

@nicks

Add the following test to loader_test:

func TestBadServiceConfig(t *testing.T) {
	yaml := `name: scratch
services:
  redis:
    image: redis:6.2.6-alpine
    network_mode: bridge
    networks:
      gratheon: null
networks:
  gratheon:
    name: scratch_gratheon
`
	_, _ = LoadWithContext(context.Background(), types.ConfigDetails{
		ConfigFiles: []types.ConfigFile{
			{
				Content: []byte(yaml),
			},
		},
	})
}

Expected result:
Loader emits a reasonable error

Actual result:
Loader panics

--- FAIL: TestBadServiceConfig (0.00s)
panic: assignment to entry in nil map [recovered]
	panic: assignment to entry in nil map

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions