Skip to content

Commit

Permalink
Merge branch 'main' into azurite
Browse files Browse the repository at this point in the history
* main:
  docs: document disabling ryuk with properties (testcontainers#2603)
  fix: allow compose files and readers to be used together (testcontainers#2598)
  chore(deps): bump urllib3 from 2.2.1 to 2.2.2 (testcontainers#2590)
  docs: example for NATS cluster (testcontainers#2591)
  docs: fix deprecation for material extensions emoji (testcontainers#2592)
  gha: update golangci-lint to v1.59.1 (testcontainers#2588)
  network: WithCheckDuplicate: don't set CheckDuplicate value (testcontainers#2589)
  fix: proper synchronisation for start/stop log production (testcontainers#2576)
  chore(deps): bump github.com/docker/docker from v25.0.5 to v26.1.4 (testcontainers#2584)
  docs: update contributing guide (testcontainers#2586)
  feat: add testcontainers labels to the built images (testcontainers#2579)
  feat(mongodb): Make the replica set name configurable (testcontainers#2538)
  chore: skip reaper tests if ryuk is disabled (testcontainers#2582)
  chore: increase check time to 60 secs instead of 20 (testcontainers#2581)
  fix: prepend substitutors for built images (testcontainers#2577)
  docs: update colima docs (testcontainers#2578)
  fix(cockroachdb): Fixes cockroachdb wait strategy handling (testcontainers#2456)
  Fix race condition when looking up reaper (ryuk) container (testcontainers#2508)
  chore: bring golangci-lint back (testcontainers#2571)
  docs(compose): Fix typo docker compose docs (testcontainers#2565)
  • Loading branch information
mdelapenya committed Jun 24, 2024
2 parents 2024322 + 23f2bcd commit 7997a29
Show file tree
Hide file tree
Showing 147 changed files with 2,220 additions and 1,787 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ jobs:
id: go

- name: golangci-lint
# TODO: Remove each example/module once it passes the golangci-lint
if: ${{ inputs.platform == 'ubuntu-latest' && inputs.go-version == '1.20.x' }}
if: ${{ inputs.platform == 'ubuntu-latest' }}
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.55.2
version: v1.59.1
# Optional: working directory, useful for monorepos
working-directory: ${{ inputs.project-directory }}
# Optional: golangci-lint command line arguments.
Expand All @@ -92,7 +91,7 @@ jobs:

- name: modTidy
working-directory: ./${{ inputs.project-directory }}
run: make tools-tidy
run: make tidy

- name: ensure compilation
working-directory: ./${{ inputs.project-directory }}
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ test-all: tools test-tools test-unit
.PHONY: test-examples
test-examples:
@echo "Running example tests..."
make -C examples test
$(MAKE) -C examples test

.PHONY: tidy-all
tidy-all:
make -C examples tidy-examples
make -C modules tidy-modules
$(MAKE) tidy
$(MAKE) -C examples tidy-examples
$(MAKE) -C modules tidy-modules

## -------------------------------------

Expand Down
7 changes: 4 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions commons-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define go_install
endef

$(GOBIN)/golangci-lint:
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2)
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1)

$(GOBIN)/gotestsum:
$(call go_install,gotest.tools/gotestsum@latest)
Expand Down Expand Up @@ -47,6 +47,6 @@ tools:
.PHONY: test-tools
test-tools: $(GOBIN)/gotestsum

.PHONY: tools-tidy
tools-tidy:
.PHONY: tidy
tidy:
go mod tidy
18 changes: 18 additions & 0 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,31 @@ func (c *ContainerRequest) BuildOptions() (types.ImageBuildOptions, error) {

// make sure the first tag is the one defined in the ContainerRequest
tag := fmt.Sprintf("%s:%s", c.GetRepo(), c.GetTag())

// apply substitutors to the built image
for _, is := range c.ImageSubstitutors {
modifiedTag, err := is.Substitute(tag)
if err != nil {
return buildOptions, fmt.Errorf("failed to substitute image %s with %s: %w", tag, is.Description(), err)
}

if modifiedTag != tag {
Logger.Printf("✍🏼 Replacing image with %s. From: %s to %s\n", is.Description(), tag, modifiedTag)
tag = modifiedTag
}
}

if len(buildOptions.Tags) > 0 {
// prepend the tag
buildOptions.Tags = append([]string{tag}, buildOptions.Tags...)
} else {
buildOptions.Tags = []string{tag}
}

if !c.ShouldKeepBuiltImage() {
buildOptions.Labels = core.DefaultLabels(core.SessionID())
}

return buildOptions, nil
}

Expand Down
Loading

0 comments on commit 7997a29

Please sign in to comment.