Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub Actions workflows. #1004

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 6 additions & 7 deletions provider/hybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions provider/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion provider/nativeDocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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 {
Expand Down
Loading