diff --git a/.common-ci.yml b/.common-ci.yml index dcb90282..33e61894 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -35,10 +35,6 @@ stages: - build-all # Define the distribution targets -.dist-amazonlinux1: - variables: - DIST: amazonlinux1 - .dist-amazonlinux2: variables: DIST: amazonlinux2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f716cae0..da446359 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,12 +103,6 @@ unit-tests: - ${ARTIFACTS_ROOT} # Define the package build targets -package-amazonlinux1-x86_64: - extends: - - .package-build - - .dist-amazonlinux1 - - .arch-x86_64 - package-amazonlinux2-aarch64: extends: - .package-build @@ -259,7 +253,6 @@ image-packaging: - .package-artifacts - .dist-packaging needs: - - package-amazonlinux1-x86_64 - package-amazonlinux2-aarch64 - package-amazonlinux2-x86_64 - package-centos7-ppc64le diff --git a/build/container/Makefile b/build/container/Makefile index 100c22c1..3bda4970 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -119,7 +119,6 @@ $(TEST_TARGETS): test-%: test-packaging: DIST = packaging test-packaging: @echo "Testing package image contents" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux1/x86_64" || echo "Missing amazonlinux1/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux2/aarch64" || echo "Missing amazonlinux2/aarch64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/amazonlinux2/x86_64" || echo "Missing amazonlinux2/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos7/ppc64le" || echo "Missing centos7/ppc64le" diff --git a/cmd/nvidia-container-runtime.experimental/config/toml.go b/cmd/nvidia-container-runtime.experimental/config/toml.go index 7b8f3716..055ede1c 100644 --- a/cmd/nvidia-container-runtime.experimental/config/toml.go +++ b/cmd/nvidia-container-runtime.experimental/config/toml.go @@ -117,7 +117,7 @@ func (c tomlConfig) updateFromReader(cfg *Config, reader io.Reader) error { } if v, ok := section.GetStringFrom(toml, "log-level"); ok { - cfg.Root = v + cfg.LogLevel = v } } return nil diff --git a/cmd/nvidia-container-runtime.experimental/config/toml_test.go b/cmd/nvidia-container-runtime.experimental/config/toml_test.go index fee0c300..dbd29345 100644 --- a/cmd/nvidia-container-runtime.experimental/config/toml_test.go +++ b/cmd/nvidia-container-runtime.experimental/config/toml_test.go @@ -87,32 +87,42 @@ func TestUpdateFromReader(t *testing.T) { LogLevel: "info", }, }, + { + description: "log-level is set", + lines: []string{"nvidia-container-runtime.log-level=\"trace\""}, + expected: &Config{ + DebugFilePath: "/dev/null", + LogLevel: "trace", + }, + }, } - for i, tc := range testCases { - cfg := getDefaultConfig() + for _, tc := range testCases { + t.Run(tc.description, func(t *testing.T) { + cfg := getDefaultConfig() - c := tomlConfig{ - logger: logger, - sections: []tomlSection{ - {section: nvidiaContainerRuntimeConfigSection}, - }, - } - var reader io.Reader - if tc.readerError { - reader = iotest.ErrReader(fmt.Errorf("error")) - } else { - reader = strings.NewReader(strings.Join(tc.lines, "\n")) - } + c := tomlConfig{ + logger: logger, + sections: []tomlSection{ + {section: nvidiaContainerRuntimeConfigSection}, + }, + } + var reader io.Reader + if tc.readerError { + reader = iotest.ErrReader(fmt.Errorf("error")) + } else { + reader = strings.NewReader(strings.Join(tc.lines, "\n")) + } - err := c.updateFromReader(cfg, reader) + err := c.updateFromReader(cfg, reader) - if tc.expectedError { - require.Error(t, err, "%d: %v", i, tc.description) - } else { - require.NoError(t, err, "%d: %v", i, tc.description) - } - require.EqualValues(t, tc.expected, cfg, "%d: %v", i, tc.description) + if tc.expectedError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + require.EqualValues(t, tc.expected, cfg) + }) } }