From 1b1b18a6e4a35f931331b6ee68850c4854dd15dd Mon Sep 17 00:00:00 2001 From: Pulumi Bot <30351955+pulumi-bot@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:19:36 -0800 Subject: [PATCH] Update GitHub Actions workflows. (#1004) This PR was automatically generated by the update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt repo, from commit e74fbeeec7b1a562d45502d94fca2dcae9cab776. --------- Co-authored-by: Ian Wahbe --- .github/workflows/master.yml | 7 +++++++ .github/workflows/prerelease.yml | 7 +++++++ .github/workflows/release.yml | 7 +++++++ .golangci.yml | 9 +++------ provider/hybrid.go | 13 ++++++------- provider/image.go | 4 ++-- provider/nativeDocs.go | 2 +- provider/provider.go | 20 ++++++++++---------- 8 files changed, 43 insertions(+), 26 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 6c77b45be..62b43fb70 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -296,6 +296,13 @@ jobs: - license_check runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - name: Unshallow clone for tags diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index adb39c59a..b9685e342 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -239,6 +239,13 @@ jobs: - license_check runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - name: Unshallow clone for tags diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edb6ed327..60113b54e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -253,6 +253,13 @@ jobs: - license_check runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - name: Unshallow clone for tags diff --git a/.golangci.yml b/.golangci.yml index e5617cd32..1b236e157 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,23 +2,20 @@ linters: enable: - - deadcode - errcheck + - gci - goconst - gofmt - - golint - gosec - govet - ineffassign - - interfacer - lll - megacheck - misspell - nakedret - - structcheck + - revive - unconvert - - varcheck - - gci + - unused enable-all: false run: skip-files: diff --git a/provider/hybrid.go b/provider/hybrid.go index 2219a6955..7d3b259e9 100644 --- a/provider/hybrid.go +++ b/provider/hybrid.go @@ -43,15 +43,15 @@ func (dp dockerHybridProvider) Attach(ctx context.Context, attach *rpc.PluginAtt return dp.nativeProvider.Attach(ctx, attach) } -func (dp dockerHybridProvider) Call(ctx context.Context, request *rpc.CallRequest) (*rpc.CallResponse, error) { +func (dp dockerHybridProvider) Call(context.Context, *rpc.CallRequest) (*rpc.CallResponse, error) { return nil, status.Error(codes.Unimplemented, "Call is not yet implemented") } -func (dp dockerHybridProvider) Cancel(ctx context.Context, e *empty.Empty) (*empty.Empty, error) { +func (dp dockerHybridProvider) Cancel(context.Context, *empty.Empty) (*empty.Empty, error) { return &empty.Empty{}, nil } -func (dp dockerHybridProvider) GetSchema(ctx context.Context, request *rpc.GetSchemaRequest) ( +func (dp dockerHybridProvider) GetSchema(_ context.Context, request *rpc.GetSchemaRequest) ( *rpc.GetSchemaResponse, error) { if v := request.GetVersion(); v != 0 { return nil, fmt.Errorf("unsupported schema version %d", v) @@ -99,8 +99,7 @@ func (dp dockerHybridProvider) Invoke(ctx context.Context, request *rpc.InvokeRe return dp.bridgedProvider.Invoke(ctx, request) } -func (dp dockerHybridProvider) StreamInvoke( - request *rpc.InvokeRequest, server rpc.ResourceProvider_StreamInvokeServer) error { +func (dp dockerHybridProvider) StreamInvoke(*rpc.InvokeRequest, rpc.ResourceProvider_StreamInvokeServer) error { return status.Error(codes.Unimplemented, "StreamInvoke is not yet implemented") } @@ -158,12 +157,12 @@ func (dp dockerHybridProvider) Delete(ctx context.Context, request *rpc.DeleteRe return dp.bridgedProvider.Delete(ctx, request) } -func (dp dockerHybridProvider) Construct(ctx context.Context, request *rpc.ConstructRequest) ( +func (dp dockerHybridProvider) Construct(context.Context, *rpc.ConstructRequest) ( *rpc.ConstructResponse, error) { return nil, status.Error(codes.Unimplemented, "Construct is not yet implemented") } -func (dp dockerHybridProvider) GetPluginInfo(ctx context.Context, empty *empty.Empty) (*rpc.PluginInfo, error) { +func (dp dockerHybridProvider) GetPluginInfo(context.Context, *empty.Empty) (*rpc.PluginInfo, error) { return &rpc.PluginInfo{ Version: dp.version, }, nil diff --git a/provider/image.go b/provider/image.go index 6dacd7fe4..3f93f5319 100644 --- a/provider/image.go +++ b/provider/image.go @@ -293,7 +293,7 @@ func (p *dockerNativeProvider) dockerBuild(ctx context.Context, } // Print build logs to `Info` progress report - imageID, err := p.runImageBuild(ctx, docker, tar, opts, urn, img.Name) + imageID, err := p.runImageBuild(ctx, docker, tar, opts, urn) if err != nil { return "", nil, err } @@ -459,7 +459,7 @@ func (p *dockerNativeProvider) getRepoDigest( // 4. We only return an imageID if the image in the store matches both (1.) and (2.) func (p *dockerNativeProvider) runImageBuild( ctx context.Context, docker *client.Client, tar io.Reader, - opts types.ImageBuildOptions, urn resource.URN, name string, + opts types.ImageBuildOptions, urn resource.URN, ) (string, error) { if opts.Labels == nil { opts.Labels = make(map[string]string) diff --git a/provider/nativeDocs.go b/provider/nativeDocs.go index 4a5da0a80..5ba15d565 100644 --- a/provider/nativeDocs.go +++ b/provider/nativeDocs.go @@ -10,4 +10,4 @@ var docImageDescription string //go:embed pkg/docs-gen/examples/image.md var docImageExamples string -var docImage string = docImageDescription + "\n\n" + docImageExamples +var docImage = docImageDescription + "\n\n" + docImageExamples diff --git a/provider/provider.go b/provider/provider.go index edfbafd8c..0c4abcdec 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -45,7 +45,7 @@ type dockerNativeProvider struct { // docker native methods // Attach sends the engine address to an already running plugin. -func (p *dockerNativeProvider) Attach(context context.Context, req *rpc.PluginAttach) (*emptypb.Empty, error) { +func (p *dockerNativeProvider) Attach(_ context.Context, req *rpc.PluginAttach) (*emptypb.Empty, error) { host, err := provider.NewHostClient(req.GetAddress()) if err != nil { return nil, err @@ -55,24 +55,24 @@ func (p *dockerNativeProvider) Attach(context context.Context, req *rpc.PluginAt } // Call dynamically executes a method in the provider associated with a component resource. -func (p *dockerNativeProvider) Call(ctx context.Context, req *rpc.CallRequest) (*rpc.CallResponse, error) { +func (p *dockerNativeProvider) Call(context.Context, *rpc.CallRequest) (*rpc.CallResponse, error) { return nil, status.Error(codes.Unimplemented, "call is not yet implemented") } // Construct creates a new component resource. -func (p *dockerNativeProvider) Construct(ctx context.Context, req *rpc.ConstructRequest) ( +func (p *dockerNativeProvider) Construct(context.Context, *rpc.ConstructRequest) ( *rpc.ConstructResponse, error, ) { return nil, status.Error(codes.Unimplemented, "construct is not yet implemented") } // CheckConfig validates the configuration for this provider. -func (p *dockerNativeProvider) CheckConfig(ctx context.Context, req *rpc.CheckRequest) (*rpc.CheckResponse, error) { +func (p *dockerNativeProvider) CheckConfig(_ context.Context, req *rpc.CheckRequest) (*rpc.CheckResponse, error) { return &rpc.CheckResponse{Inputs: req.GetNews()}, nil } // DiffConfig diffs the configuration for this provider. -func (p *dockerNativeProvider) DiffConfig(ctx context.Context, req *rpc.DiffRequest) (*rpc.DiffResponse, error) { +func (p *dockerNativeProvider) DiffConfig(context.Context, *rpc.DiffRequest) (*rpc.DiffResponse, error) { return &rpc.DiffResponse{}, nil } @@ -112,7 +112,7 @@ func (p *dockerNativeProvider) Invoke(_ context.Context, req *rpc.InvokeRequest) // StreamInvoke dynamically executes a built-in function in the provider. The result is streamed // back as a series of messages. func (p *dockerNativeProvider) StreamInvoke( - req *rpc.InvokeRequest, server rpc.ResourceProvider_StreamInvokeServer, + req *rpc.InvokeRequest, _ rpc.ResourceProvider_StreamInvokeServer, ) error { tok := req.GetTok() return fmt.Errorf("unknown StreamInvoke token '%s'", tok) @@ -277,7 +277,7 @@ func (p *dockerNativeProvider) Check(ctx context.Context, req *rpc.CheckRequest) } // Diff checks what impacts a hypothetical update will have on the resource's properties. -func (p *dockerNativeProvider) Diff(ctx context.Context, req *rpc.DiffRequest) (*rpc.DiffResponse, error) { +func (p *dockerNativeProvider) Diff(_ context.Context, req *rpc.DiffRequest) (*rpc.DiffResponse, error) { urn := resource.URN(req.GetUrn()) label := fmt.Sprintf("%s.Diff(%s)", p.name, urn) logging.V(9).Infof("%s executing", label) @@ -422,7 +422,7 @@ func (p *dockerNativeProvider) Create(ctx context.Context, req *rpc.CreateReques } // Read the current live state associated with a resource. -func (p *dockerNativeProvider) Read(ctx context.Context, req *rpc.ReadRequest) (*rpc.ReadResponse, error) { +func (p *dockerNativeProvider) Read(_ context.Context, req *rpc.ReadRequest) (*rpc.ReadResponse, error) { urn := resource.URN(req.GetUrn()) label := fmt.Sprintf("%s.Read(%s)", p.name, urn) logging.V(9).Infof("%s executing", label) @@ -497,7 +497,7 @@ func (p *dockerNativeProvider) Update(ctx context.Context, req *rpc.UpdateReques // Delete tears down an existing resource with the given ID. If it fails, the resource is assumed // to still exist. -func (p *dockerNativeProvider) Delete(ctx context.Context, req *rpc.DeleteRequest) (*pbempty.Empty, error) { +func (p *dockerNativeProvider) Delete(_ context.Context, req *rpc.DeleteRequest) (*pbempty.Empty, error) { urn := resource.URN(req.GetUrn()) label := fmt.Sprintf("%s.Update(%s)", p.name, urn) logging.V(9).Infof("%s executing", label) @@ -512,7 +512,7 @@ func (p *dockerNativeProvider) GetPluginInfo(context.Context, *pbempty.Empty) (* } // GetSchema returns the JSON-serialized schema for the provider. -func (p *dockerNativeProvider) GetSchema(ctx context.Context, req *rpc.GetSchemaRequest) ( +func (p *dockerNativeProvider) GetSchema(_ context.Context, req *rpc.GetSchemaRequest) ( *rpc.GetSchemaResponse, error, ) { if v := req.GetVersion(); v != 0 {