14 Commits

Author SHA1 Message Date
Ruslan Aliev
d1abe6e1ea Decouple implementations and unit tests in container module
Unit test should follow black-box approach.

Change-Id: I98c46c613a73b539f79d8dfe99cd73592792536d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #561
2021-07-16 21:02:03 -05:00
Kostiantyn Kalynovskyi
c17246b006 Pass HostNetwork value to docker container
This fixes a bug when in host value is specified in api object,
but it is ignored by docker

Closes: #512
Related-To: #512

Change-Id: I57e66a19124d1d0a295396491dbd22e2e2193d31
2021-04-03 17:09:32 +00:00
Kostiantyn Kalynovskyi
971c81acdb Extend container interface with mounts get log opts
This commit allows to specify options to get container logs, such
as stderr, stdout and if logs should be followed.

Also extends RunCommandOptions with ability to add mounts in addtion
to binds

Relates-To: #458
Change-Id: I83507f2f7ca6ea596f52f5d3e9f868467458b6a3
2021-02-08 00:11:29 +00:00
Kostiantyn Kalynovskyi
4671ea7f74 Allow privileged mode in docker interface
Change-Id: I12e7a895c5ccd228a3bb1a2ef3588be96893ae36
2021-02-05 04:25:06 +00:00
Kostiantyn Kalynovskyi
3ae387e9f2 Change container RunMethod to allow extending
This will make sure that when we add new features to how the
docker container is run, we don't need to change interface
method signature everywhere we use it.

Relates-To: #458

Change-Id: I12273264c1a8061300017246a1a4a17125ca8ae2
2021-02-05 04:25:06 +00:00
Sidney Shiba
f4e532e91a Extending Container interface and package
Adding the following method to the interface and implementation for
docker container:
- InspectContainer() - used to determine container status

Change-Id: I4a8096f4f5addad31daa5038a30b1ffcf1d424e9
2020-11-08 13:55:35 +00:00
Kostiantyn Kalynovskyi
ac6e8d1194 Remove not needed context pointers in container interface
Container interface is being extended right now, because we
build new things on top of it, such as bootstrap containers.

Current version of it, was delivered as MVP and is used only
in ISOGEN. During MVP stage we didn't bother too much about
the pointers and readability. However now when we built something
new on top of it, we want to make sure that it we dont make
matters worse, and building on solid foundation.

The pointers are not needed in any way, and they are dereferenced
on top of that, context.Context is an interface, and there is
very limited theoretical use of pointers to interfaces.

Change-Id: Iee1eeb89f058aa8e994cba685b49085707362ee1
2020-10-27 17:28:25 -05:00
Ruslan Aliev
ec51a71181 Add progress bar and improve cmd output for image build command
This patch provides the ability to show progress bar using
container logs (ubuntu/debian based only).

Change-Id: I86eebe4d368d81c4685fb27ca31b86cbb3dea08d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #278
2020-09-28 16:11:34 +00:00
Stanislav Egorov
611d73a2ee Added error handler for empty runtime entry
If there is no container runtime defined in the airshipctl
config then the error message is not clear. New handler shows
specific error description

Change-Id: Ib5b735ddaa1556a8a88fdb15c4b3942cd010db9b
2020-04-24 15:34:27 -07:00
Yasin, Siraj (SY495P)
c25d223c7b Add copyright for missing files
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
    missing files. Type:  go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
   > ./tools/add_license.sh

* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments

New Files:
  1. tools/add_license.sh
  2. tools/license_go.txt
  3. tools/license_yaml.txt
  4. tools/license_bash.txt

Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
2020-04-09 08:35:59 -05:00
Alexander Hughes
cc90889dd0 [#58] Update methods for golint
This patch addresses golint failures such as:
pkg/bootstrap/isogen/command_test.go:43:26: method GetId should be GetID
pkg/container/container_docker.go:171:27: method getImageId should be
getImageID
pkg/container/container_docker.go:193:27: method GetId should be GetID

Relates-To: #58

Change-Id: I7eb461387524f23a89bc2ae7ce59dac066c12281
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-02-28 22:00:43 +00:00
Ian H. Pittwood
8a3950d238 Fix typos in variable names and comments
Change-Id: I361916cc18c67e72fbfdbb4b6547f80a5d098327
2020-02-05 16:31:05 -06:00
Ian Howell
49027f4151 Tighten the restrictions of the linter
This change causes the linter to be a bit more complainy. The hope is
that this will cut down on some of the more pedantic issues being caught
in code reviews, and thus reduce the overall time a change spends in the
review process.

This change includes various changes to the codebase to bring it up to
the new standards.

Change-Id: I570d304bca5554404354f972d8a2743279a0171b
2020-01-10 14:54:34 -06:00
Dmitry Ukov
b37b6f3703 [AIR-137] Add logic to isogen subcommand
* Add add default values for isogen subcommand keys
* Introduce container interface
* Implement docker driver
* Add stdin support to container interface
* Implement volume mount for container

Change-Id: Ide0ecd474b1ccce358bdc9c85ef0006f230490b5
2019-11-01 12:27:35 +00:00