Skip to content

Commit ec72798

Browse files
Merge pull request #88 from austinvazquez/remove-copyright-dates
chore: remove copyright dates
2 parents 94ac8f8 + a05b8b7 commit ec72798

File tree

13 files changed

+134
-28
lines changed

13 files changed

+134
-28
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: Check out code into the Go module directory
2525
uses: actions/checkout@v2
2626

27+
- name: Run static analysis
28+
run: make lint
29+
2730
- name: Build
2831
run: make all
2932

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
bin/
12
firectl
23
firectl.sha256

.headers/go.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"). You may
4+
// not use this file except in compliance with the License. A copy of the
5+
// License is located at
6+
//
7+
// http://aws.amazon.com/apache2.0/
8+
//
9+
// or in the "license" file accompanying this file. This file is distributed
10+
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11+
// express or implied. See the License for the specific language governing
12+
// permissions and limitations under the License.

.headers/makefile.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You may
4+
# not use this file except in compliance with the License. A copy of the
5+
# License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is distributed
10+
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11+
# express or implied. See the License for the specific language governing
12+
# permissions and limitations under the License.

CONTRIBUTING.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ To send us a pull request, please:
3333
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3434
3. Ensure local tests pass.
3535
4. Commit to your fork using clear commit messages.
36-
5. Send us a pull request, answering any default questions in the pull request interface.
37-
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
36+
5. Verify all commit messages include [DCO signature](#sign-your-work)
37+
6. Send us a pull request, answering any default questions in the pull request interface.
38+
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3839

3940
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4041
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
@@ -50,6 +51,61 @@ For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of
5051
[email protected] with any additional questions or comments.
5152

5253

54+
## Sign your work
55+
56+
The sign-off is a simple line at the end of the explanation for the patch. Your
57+
signature certifies that you wrote the patch or otherwise have the right to pass
58+
it on as an open-source patch. If you can certify
59+
the below (from [developercertificate.org](http://developercertificate.org/)):
60+
61+
```
62+
Developer Certificate of Origin
63+
Version 1.1
64+
65+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
66+
660 York Street, Suite 102,
67+
San Francisco, CA 94110 USA
68+
69+
Everyone is permitted to copy and distribute verbatim copies of this
70+
license document, but changing it is not allowed.
71+
72+
Developer's Certificate of Origin 1.1
73+
74+
By making a contribution to this project, I certify that:
75+
76+
(a) The contribution was created in whole or in part by me and I
77+
have the right to submit it under the open source license
78+
indicated in the file; or
79+
80+
(b) The contribution is based upon previous work that, to the best
81+
of my knowledge, is covered under an appropriate open source
82+
license and I have the right under that license to submit that
83+
work with modifications, whether created in whole or in part
84+
by me, under the same open source license (unless I am
85+
permitted to submit under a different license), as indicated
86+
in the file; or
87+
88+
(c) The contribution was provided directly to me by some other
89+
person who certified (a), (b) or (c) and I have not modified
90+
it.
91+
92+
(d) I understand and agree that this project and the contribution
93+
are public and that a record of the contribution (including all
94+
personal information I submit with it, including my sign-off) is
95+
maintained indefinitely and may be redistributed consistent with
96+
this project or the open source license(s) involved.
97+
```
98+
99+
Then you just add a line to every git commit message:
100+
101+
Signed-off-by: Joe Smith <[email protected]>
102+
103+
Use your real name (sorry, no pseudonyms or anonymous contributions.)
104+
105+
If you set your `user.name` and `user.email` git configs, you can sign your
106+
commit automatically with `git commit -s`.
107+
108+
53109
## Security issue notifications
54110
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55111

Makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You may
44
# not use this file except in compliance with the License. A copy of the
@@ -12,8 +12,8 @@
1212
# permissions and limitations under the License.
1313
SRCFILES := *.go go.sum go.mod
1414

15-
INSTALLROOT ?= /usr/local
16-
BINDIR ?= $(INSTALLROOT)/bin
15+
INSTALLPATH ?= /usr/local/bin
16+
BINPATH:=$(abspath ./bin)
1717

1818
all: firectl
1919

@@ -36,13 +36,25 @@ build-in-docker:
3636
test:
3737
go test -v ./...
3838

39-
lint:
40-
golint $(SRCFILES)
39+
$(BINPATH)/ltag:
40+
GOBIN=$(BINPATH) GO111MODULE=off go get -u github.com/kunalkushwaha/ltag
41+
42+
$(BINPATH)/git-validation:
43+
GOBIN=$(BINPATH) GO111MODULE=off go get -u github.com/vbatts/git-validation
44+
45+
$(BINPATH)/golangci-lint:
46+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(BINPATH) v1.46.2
47+
$(BINPATH)/golangci-lint --version
48+
49+
lint: $(BINPATH)/ltag $(BINPATH)/git-validation $(BINPATH)/golangci-lint
50+
$(BINPATH)/ltag -v -t ./.headers -check
51+
$(BINPATH)/git-validation -q -run DCO,short-subject -range HEAD~3..HEAD
52+
$(BINPATH)/golangci-lint run
4153

4254
clean:
4355
go clean
4456

4557
install:
46-
install -o root -g root -m755 firectl $(BINDIR)/
58+
install -o root -g root -m755 -t $(INSTALLPATH) firectl
4759

4860
.PHONY: all clean install build-in-docker test lint release

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Firectl
2-
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"). You may
44
// not use this file except in compliance with the License. A copy of the

main.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"). You may
44
// not use this file except in compliance with the License. A copy of the
@@ -134,10 +134,16 @@ func runVMM(ctx context.Context, opts *options) error {
134134
if err := m.Start(vmmCtx); err != nil {
135135
return fmt.Errorf("Failed to start machine: %v", err)
136136
}
137-
defer m.StopVMM()
137+
defer func() {
138+
if err := m.StopVMM(); err != nil {
139+
log.Errorf("An error occurred while stopping Firecracker VMM: %v", err)
140+
}
141+
}()
138142

139143
if opts.validMetadata != nil {
140-
m.SetMetadata(vmmCtx, opts.validMetadata)
144+
if err := m.SetMetadata(vmmCtx, opts.validMetadata); err != nil {
145+
log.Errorf("An error occurred while setting Firecracker VM metadata: %v", err)
146+
}
141147
}
142148

143149
installSignalHandlers(vmmCtx, m)
@@ -162,10 +168,14 @@ func installSignalHandlers(ctx context.Context, m *firecracker.Machine) {
162168
switch s := <-c; {
163169
case s == syscall.SIGTERM || s == os.Interrupt:
164170
log.Printf("Caught signal: %s, requesting clean shutdown", s.String())
165-
m.Shutdown(ctx)
171+
if err := m.Shutdown(ctx); err != nil {
172+
log.Errorf("An error occurred while shutting down Firecracker VM: %v", err)
173+
}
166174
case s == syscall.SIGQUIT:
167175
log.Printf("Caught signal: %s, forcing shutdown", s.String())
168-
m.StopVMM()
176+
if err := m.StopVMM(); err != nil {
177+
log.Errorf("An error occurred while stopping Firecracker VMM: %v", err)
178+
}
169179
}
170180
}
171181
}()

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"). You may
44
// not use this file except in compliance with the License. A copy of the

0 commit comments

Comments
 (0)