Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Lint backport #1475

Merged
merged 7 commits into from
Apr 3, 2019
Merged

Conversation

ganeshmaharaj
Copy link
Contributor

Testing if linter changes will fix 1.6 backports.

jongwu and others added 7 commits April 2, 2019 21:37
Now, function NewFactory will return nil even create template
does't complete. As for this, it will tell user that factory
has been initialized no matter whether the template is created
or not. This patch correct it by adding another return value
of error in NewFactory.

Testing initFactoryCommand when enable template will need root
privilege to mount tmpfs. So skip it for no-root user.

Testing initFactoryCommand func will create template, but no
proxy type assigned to VMconfig which will using katabuiltinProxy
instead. this will lead to failure for this type of proxy will
check proxyparams which contains many null value. This commit
fix it by substitute katabuiltinProxy as noopProxy when for test
purpose.

Fixes: kata-containers#1333
Signed-off-by: Jianyong Wu <[email protected]>
Fixes: kata-containers#1422

Detect failing test case:

```
....
=== RUN   TestEnterContainerFailingContNotStarted
--- PASS: TestEnterContainerFailingContNotStarted (0.01s)
=== RUN   TestEnterContainer
--- FAIL: TestEnterContainer (0.00s)
 Error Trace: sandbox_test.go:1154
 Error:      	Expected value not to be nil.
 Messages:   	Entering non-running container should fail
 Error Trace: sandbox_test.go:1157
 Error:      	Expected nil, but got: &errors.errorString{s:"Can not
move from running to running"}
 Messages:   	Failed to start sandbox: Can not move from running to
running
FAIL
```

`TestEnterContainerFailingContNotStarted` calls `cleanUp` at function
begging but it doesn't clean its garbage after it ends.
`TestEnterContainer` only call `cleanUp` in the end but it doesn't do
cleanUp in the begging, that gives first test case a chance to impact
latter one.

This commit modifies all the test cases, let them all do the cleanUp()
in the end.

The policy here is: "everyone needs to take their garbage away when they
leave" :)

Signed-off-by: Wei Zhang <[email protected]>
do cleanup inside startVM() if start vm get error

Fixes: kata-containers#1426

Signed-off-by: Ace-Tang <[email protected]>
update architecture.md link, since it has moved to within the
design/ directory.

Fixes: kata-containers#1462

Signed-off-by: Gabi Beyer <[email protected]>
Like shim, we should validate the proxy path if it is provided.

Fixes: kata-containers#1424

Signed-off-by: Peng Tao <[email protected]>
gometalinter is deprecated and will be archived April '19. The
suggestion is to switch to golangci-lint which is apparently 5x faster
than gometalinter.

Partially Fixes: kata-containers#1377

Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
(cherry picked from commit f442876)
After we switched golang linter to golangci-lint, we has extra 'deadcode'
linter check, and we need to remove this linter check for all
generic items.

Fixes: kata-containers#1432

Signed-off-by: Penny Zheng <[email protected]>
(cherry picked from commit 2e5194e)
@ganeshmaharaj ganeshmaharaj requested a review from a team as a code owner April 3, 2019 18:35
@egernst egernst merged commit 60ea75d into kata-containers:stable-1.6 Apr 3, 2019
@ganeshmaharaj ganeshmaharaj deleted the lint-backport branch July 17, 2019 17:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants