1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

Bump dockercli (#1905)

* updates to support newer version of docker sdk

Bumps [github.com/docker/cli](https://github.com/docker/cli) from 24.0.2+incompatible to 24.0.4+incompatible.
- [Commits](https://github.com/docker/cli/compare/v24.0.2...v24.0.4)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat: upgrade to go 1.20

* feat: upgrade to go 1.20

* chore: use go version from go.mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Casey Lee 2023-07-10 21:55:53 -07:00 committed by GitHub
parent 0c1dc1e2f6
commit d798d91d59
6 changed files with 21 additions and 26 deletions

View file

@ -8,7 +8,6 @@ concurrency:
env: env:
ACT_OWNER: ${{ github.repository_owner }} ACT_OWNER: ${{ github.repository_owner }}
ACT_REPOSITORY: ${{ github.repository }} ACT_REPOSITORY: ${{ github.repository }}
GO_VERSION: 1.18
CGO_ENABLED: 0 CGO_ENABLED: 0
jobs: jobs:
@ -21,7 +20,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- uses: golangci/golangci-lint-action@v3.6.0 - uses: golangci/golangci-lint-action@v3.6.0
with: with:
@ -46,7 +45,7 @@ jobs:
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- uses: actions/cache@v3 - uses: actions/cache@v3
if: ${{ !env.ACT }} if: ${{ !env.ACT }}
@ -81,7 +80,7 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- name: Run Tests - name: Run Tests
uses: ./.github/actions/run-tests uses: ./.github/actions/run-tests
@ -96,7 +95,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- uses: actions/cache@v3 - uses: actions/cache@v3
if: ${{ !env.ACT }} if: ${{ !env.ACT }}

View file

@ -4,9 +4,6 @@ on:
- cron: '0 2 1 * *' - cron: '0 2 1 * *'
workflow_dispatch: {} workflow_dispatch: {}
env:
GO_VERSION: 1.18
jobs: jobs:
release: release:
name: promote name: promote
@ -20,7 +17,7 @@ jobs:
- uses: fregante/setup-git-user@v2 - uses: fregante/setup-git-user@v2
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- uses: actions/cache@v3 - uses: actions/cache@v3
if: ${{ !env.ACT }} if: ${{ !env.ACT }}

View file

@ -4,9 +4,6 @@ on:
tags: tags:
- v* - v*
env:
GO_VERSION: 1.18
jobs: jobs:
release: release:
name: release name: release
@ -17,7 +14,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: ${{ env.GO_VERSION }} go-version-file: go.mod
check-latest: true check-latest: true
- uses: actions/cache@v3 - uses: actions/cache@v3
if: ${{ !env.ACT }} if: ${{ !env.ACT }}

View file

@ -8,16 +8,16 @@ import (
"github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/credentials" "github.com/docker/cli/cli/config/credentials"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry"
"github.com/nektos/act/pkg/common" "github.com/nektos/act/pkg/common"
) )
func LoadDockerAuthConfig(ctx context.Context, image string) (types.AuthConfig, error) { func LoadDockerAuthConfig(ctx context.Context, image string) (registry.AuthConfig, error) {
logger := common.Logger(ctx) logger := common.Logger(ctx)
config, err := config.Load(config.Dir()) config, err := config.Load(config.Dir())
if err != nil { if err != nil {
logger.Warnf("Could not load docker config: %v", err) logger.Warnf("Could not load docker config: %v", err)
return types.AuthConfig{}, err return registry.AuthConfig{}, err
} }
if !config.ContainsAuth() { if !config.ContainsAuth() {
@ -33,13 +33,13 @@ func LoadDockerAuthConfig(ctx context.Context, image string) (types.AuthConfig,
authConfig, err := config.GetAuthConfig(hostName) authConfig, err := config.GetAuthConfig(hostName)
if err != nil { if err != nil {
logger.Warnf("Could not get auth config from docker config: %v", err) logger.Warnf("Could not get auth config from docker config: %v", err)
return types.AuthConfig{}, err return registry.AuthConfig{}, err
} }
return types.AuthConfig(authConfig), nil return registry.AuthConfig(authConfig), nil
} }
func LoadDockerAuthConfigs(ctx context.Context) map[string]types.AuthConfig { func LoadDockerAuthConfigs(ctx context.Context) map[string]registry.AuthConfig {
logger := common.Logger(ctx) logger := common.Logger(ctx)
config, err := config.Load(config.Dir()) config, err := config.Load(config.Dir())
if err != nil { if err != nil {
@ -52,9 +52,9 @@ func LoadDockerAuthConfigs(ctx context.Context) map[string]types.AuthConfig {
} }
creds, _ := config.GetAllCredentials() creds, _ := config.GetAllCredentials()
authConfigs := make(map[string]types.AuthConfig, len(creds)) authConfigs := make(map[string]registry.AuthConfig, len(creds))
for k, v := range creds { for k, v := range creds {
authConfigs[k] = types.AuthConfig(v) authConfigs[k] = registry.AuthConfig(v)
} }
return authConfigs return authConfigs

View file

@ -11,6 +11,7 @@ import (
"github.com/docker/distribution/reference" "github.com/docker/distribution/reference"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
"github.com/nektos/act/pkg/common" "github.com/nektos/act/pkg/common"
) )
@ -82,7 +83,7 @@ func getImagePullOptions(ctx context.Context, input NewDockerPullExecutorInput)
if input.Username != "" && input.Password != "" { if input.Username != "" && input.Password != "" {
logger.Debugf("using authentication for docker pull") logger.Debugf("using authentication for docker pull")
authConfig := types.AuthConfig{ authConfig := registry.AuthConfig{
Username: input.Username, Username: input.Username,
Password: input.Password, Password: input.Password,
} }

View file

@ -6,10 +6,11 @@ import (
"context" "context"
"github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/volume"
"github.com/nektos/act/pkg/common" "github.com/nektos/act/pkg/common"
) )
func NewDockerVolumeRemoveExecutor(volume string, force bool) common.Executor { func NewDockerVolumeRemoveExecutor(volumeName string, force bool) common.Executor {
return func(ctx context.Context) error { return func(ctx context.Context) error {
cli, err := GetDockerClient(ctx) cli, err := GetDockerClient(ctx)
if err != nil { if err != nil {
@ -17,14 +18,14 @@ func NewDockerVolumeRemoveExecutor(volume string, force bool) common.Executor {
} }
defer cli.Close() defer cli.Close()
list, err := cli.VolumeList(ctx, filters.NewArgs()) list, err := cli.VolumeList(ctx, volume.ListOptions{Filters: filters.NewArgs()})
if err != nil { if err != nil {
return err return err
} }
for _, vol := range list.Volumes { for _, vol := range list.Volumes {
if vol.Name == volume { if vol.Name == volumeName {
return removeExecutor(volume, force)(ctx) return removeExecutor(volumeName, force)(ctx)
} }
} }