643 Commits

Author SHA1 Message Date
Vladislav Kuzmin
53ef504bd6 Refactor generic container executor
Refactor executor functions in go lang style

Change-Id: I81f5ff32e0ac354790c7afbc0bf4db91f58397b4
Relates-To: #202
Relates-To: #369
2021-01-05 19:56:25 +00:00
Sirisha Gopigiri
91b2164a4f Adding Regex support for Templater
Adding go code to templater to support generation of strings
based on the regular expression passed.

Closes: #438
Change-Id: Ife0c4f8d5dd8032408875c73ba098919470be9e9
2021-01-04 18:18:27 +05:30
Sirisha Gopigiri
247047f2a3 Update Sprig library and add Uint32 support
Below code updates sprig library from v2.22 to
v3.2. Also added support for uint32 coversion.

Change-Id: I263cf6f1915d2f892f6f77efdcdd477ad902f527
2020-12-21 17:40:11 +05:30
Zuul
b3cc2e4410 Merge "Improve document transformation in container executor" 2020-12-18 12:28:14 +00:00
Anderson, Craig (ca846m)
2daacf5f2a image-builder integration for ISO builds
This introduces airshipctl integration with image-builder [0], which
replaces the existing isogen tool for ephemeral ISO generation.

The airshipctl isogen executor has been updated for building ephemeral
ISOs using the image-builder container. The ability for user-declared
filenames for cloud-init user data and network data was removed, since
the user's only interest is in supplying the relevant overrides, not in
transparent naming coordination with the image-builder container. A new
object is added to the document package to identify the document kind,
label, and key to retrieve data from since this is pattern we will
reuse elsewhere.

Progress flag removed as requsted. Progress is reported directly by the
image-builder container.

Isogen debug flag removed in favor of using log.DebugEnabled()

[0] https://review.opendev.org/#/c/730777/

Depends-On: https://review.opendev.org/c/airship/images/+/730777/
Change-Id: I545004feaf2116f8ffb29faf6f7f7f5fcfe24fff
2020-12-17 14:47:53 -08:00
Vladislav Kuzmin
7f040fed97 Improve document transformation in container executor
Start using yaml utils to prepare documents for
function input.

Change-Id: I4adf4781d10ff8c23eea4bec4e85f8c5b4769a8b
Relates-To: #202
Relates-To: #369
2020-12-17 18:32:23 +04:00
Zuul
4e7053bfb5 Merge "Stop clusterctl execution if error is encountered" 2020-12-16 16:52:12 +00:00
Zuul
b6d52343dc Merge "Allow to perform phase render using document entrypoint" 2020-12-16 16:51:46 +00:00
Zuul
b897e5c016 Merge "Move container phase executor to a separate package" 2020-12-16 01:51:19 +00:00
Zuul
0dde23481f Merge "Move kubernetes-apply phase executor to a separate package" 2020-12-15 22:15:24 +00:00
Zuul
e032e0ae80 Merge "Move isogen phase executor to a separate package" 2020-12-15 21:54:55 +00:00
Kostiantyn Kalynovskyi
0f7707937b Stop clusterctl execution if error is encountered
Change-Id: Ia5b2b2bf58dbb243bf96de6ccfd66f3c354c1515
2020-12-15 13:44:00 -06:00
Zuul
09f8b6cdf3 Merge "Move clusterctl phase executor to a separate package" 2020-12-15 17:40:35 +00:00
Zuul
2dc3284c23 Merge "Split isogen package into isogen and isogen_test" 2020-12-15 17:35:14 +00:00
Kostiantyn Kalynovskyi
a6987107bd Allow to perform phase render using document entrypoint
In current setup, we rely on executor to perform render operation,
however there are many usecases, when we want to have a simple
`kustomize build` performed against document entrypoint in phase.
Now this will be a default behaviour and if a user would like
executor to perform rendering to actually understand what it's
doing, he will be able to specify --executor boolean flag.

Relates-To: #403

Change-Id: I181830f9814ff48a19ba0a1284e89900187bc7d8
2020-12-15 11:28:16 -06:00
Zuul
e2a9b4e195 Merge "Move MockDocument implementation to testutils" 2020-12-14 19:41:56 +00:00
Zuul
56e632687e Merge "Move mockContainer implementation to testutil" 2020-12-14 19:38:41 +00:00
Zuul
da324d4490 Merge "Add newline when printing an event" 2020-12-14 19:18:30 +00:00
Ruslan Aliev
01266f036e Move container phase executor to a separate package
Having an executor within container package creates
potential import cycling. This patch moves it to a separate
package which can be used to conveniently store all the executors
at one place.

Change-Id: Ibd07c2ba46d1971604bdbd9e5e360759bb68a659
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
2020-12-14 13:16:35 -06:00
Vladimir Kozhukalov
359c1657d4 Add newline when printing an event
Change-Id: Ib2dcf5e849f7668ee8318e50f6ad1b598bb1a31b
2020-12-12 11:52:24 +03:00
Ruslan Aliev
b85f8fa8f9 Move kubernetes-apply phase executor to a separate package
Having an executor within applier package creates
potential import cycling. This patch moves it to a separate
package which can be used to conveniently store all the executors
at one place.

Change-Id: I68d909489b691e4fb7129446ef9a3fb085f8683c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
2020-12-11 14:09:41 -06:00
Ruslan Aliev
36303006af Move isogen phase executor to a separate package
Having an executor within isogen package creates
potential import cycling. This patch moves it to a separate
package which can be used to conveniently store all the executors
at one place.

Change-Id: I2154c0af6c28f47abb2448863332766260106759
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
2020-12-11 14:09:41 -06:00
Ruslan Aliev
71dc1d4703 Move clusterctl phase executor to a separate package
Having an executor within clusterctl.client package creates
potential import cycling. This patch moves it to a separate
package which can be used to conveniently store all the executors
at one place.

Change-Id: Ib0a6072a393e68885d9ef911aa2894a0de055668
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #374
2020-12-11 14:09:41 -06:00
Ruslan Aliev
b799edc0a7 Split isogen package into isogen and isogen_test
We should follow black-box pattern in unit test, so they should be
performed in a separate package. This patch fixes it for isogen
package.

Change-Id: I60a22213e943eaa85ce75979071897c42308e1ae
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
2020-12-11 14:09:41 -06:00
Ruslan Aliev
94a17694ea Move MockDocument implementation to testutils
Currently MockDocument implementation located under pkg/bootstrap/isogen
package, which is not relevant for it and makes it impossible to import
in other test packages. Also _test.go filename is not proper one for
this source file since it doesn't contain any unit tests inside.

Change-Id: I9b3f28df653637701f5d6fca4376da5a22f39658
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
2020-12-11 14:09:41 -06:00
Ruslan Aliev
d7ca864295 Move mockContainer implementation to testutil
Currently mockContainer implementation is located under
pkg/bootstrap/isogen and it's not possible to import it from
other packages. This patch moves it to appropriate new package
under testutil.

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To : #432

Change-Id: I36510e8e065434de597e7316dfbe51da0825d343
2020-12-11 14:09:41 -06:00
bijayasharma
6cacf4756f Minor fix on comment message (ClusterKubeconfigContext)
This commit fixes the minor comment message on pkg/cluster/clustermap/map.go
file and not related to any issue.

Change-Id: Ie92a7c09ada8b0983631cbcd0cd82622c068fc5b
2020-12-11 15:15:19 +00:00
Zuul
5dbacb0a20 Merge "Bootstrap Ephemeral - Command methods" 2020-12-10 17:03:56 +00:00
Sidney Shiba
fb49020d00 Bootstrap Ephemeral - Command methods
This patch set includes the methods supporting the bootstrap
container feature, which will be used by the BootConfiguration
executor, as part of "phase run" implementation.

The methods under command.go file are responsible for creating the
bootstrap container, monitor its state, etc.

Change-Id: I3f6b1a0bb7c7be7ac29487d09ae2ccd5e9f4bd87
2020-12-08 15:41:46 -06:00
Zuul
4aa3abd8b0 Merge "Unit tests for cluster check-certificate-expiration command" 2020-12-08 16:42:58 +00:00
Zuul
9346bd88e8 Merge "Add printers for events" 2020-12-08 16:22:41 +00:00
Zuul
431d9fcf13 Merge "Uplift kustomize api and kyaml versions" 2020-12-08 16:16:30 +00:00
guhaneswaran20
fd768e36a2 Unit tests for cluster check-certificate-expiration command
Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw

Closes: #391

Change-Id: I2e16eb99eca17f809196f9691cc8d0671b6ac15c
2020-12-07 04:57:51 +00:00
Zuul
bf4b794502 Merge "check node certificate expiration" 2020-12-04 23:40:32 +00:00
Vladislav Kuzmin
feadd70f34 Add printers for events
It will allow users to see what's happening during phase execution.

Change-Id: I31c4f98ccbd811ac88c7eabdf5efbe6ffaae6a41
Relates-To: #339
2020-12-05 00:26:02 +04:00
Zuul
fbcfac6660 Merge "Add baremetal inventory implementation." 2020-12-04 18:54:33 +00:00
Dmitry Ukov
aa46185975 Uplift kustomize api and kyaml versions
Change-Id: Id8334a74efb7f1004a36f2bfc0c6eca81380ef4d
Relates-to: #369
2020-12-04 13:43:26 +04:00
Kostiantyn Kalynovskyi
4698abad49 Add baremetal inventory implementation.
The implementation is inspired by pkg/remote module, and evolves
it to be built on top of document bundles as well as makes it
more command line oriented by adding RunOperation method.

Change-Id: If95a007986eb61c977c1ddbe5a94cfbeefeac225
Relates-To: #397
Relates-To: #362
Relates-To: #359
2020-12-03 12:41:56 -06:00
guhaneswaran20
426340e31c check node certificate expiration
Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw

Relates-To: #391

Change-Id: I8c9c83dfb2eb11af48857fb96404dcf2eb3eaa55
2020-12-03 08:14:55 +00:00
Zuul
c3fb0fce35 Merge "Extend document filesystem with chmod and dir methods" 2020-12-02 23:38:33 +00:00
Zuul
92ceea5581 Merge "Add generic container executor" 2020-12-02 17:15:55 +00:00
Zuul
c5342bd833 Merge "check kubeconf certificate expiration" 2020-12-02 16:43:47 +00:00
Ruslan Aliev
05b5ca599b Extend document filesystem with chmod and dir methods
These methods will be used instead of calling their direct
analogs in the code in order to have more consistency.

Change-Id: Ie2eaf03b1fbd049ed5788f1a769a332ef863494b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
2020-12-02 09:03:17 -06:00
Ruslan Aliev
ca71de3951 Move document filesystem to a separate package
In order to widely use filesystem interface in airshipctl
there is need to move it to separate package to avoid
importing unnecessary dependencies from document
package and, as a consequence, possible cyclic dependencies.
 * filesystem moved from document/fs to pkg/fs

Change-Id: I3b6298462f03db43594a9fa26bf23ab7687c5589
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
2020-11-30 19:51:30 -06:00
Vladislav Kuzmin
258b81122e Add generic container executor
This executor based on kyaml.RunFns[1].
It allows to execute arbitrary container as RunFns function
and handle any input data as ExecutorBundle.
Be aware that runtimeutils.FunctionSpec used for version 0.4.1[2]
and it can be changed in the future. It means that yaml scheme
of executor can be changed during kyaml uplift.
This executor transforms executor yaml to RunFns function acceptable format.

[1] https://github.com/kubernetes-sigs/kustomize/blob/master/kyaml/runfn/runfn.go
[2] https://github.com/kubernetes-sigs/kustomize/blob/kyaml/v0.4.1/kyaml/fn/runtime/runtimeutil/functiontypes.go#L22

Change-Id: I9eb648783f1ed462d2b8359d9dc86320c4db2a83
Closes: #202
Closes: #369
2020-11-26 17:11:56 +04:00
guhaneswaran20
0302462450 check kubeconf certificate expiration
Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw

Relates-To: #391

Change-Id: I66c1cce8a506b763d6ac18c055f3162381c9fd70
2020-11-20 07:09:35 +00:00
Zuul
47ada2c541 Merge "Small improvement to Events processor interface" 2020-11-19 14:01:58 +00:00
Zuul
337978d9c1 Merge "Check TLS certificate expiration" 2020-11-18 21:50:21 +00:00
guhaneswaran20
ecfb38c7bf Check TLS certificate expiration
Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw

Relates-To: #391

Change-Id: Ia1d4524f5228542cf3fc4b29074c668eca3c55bb
2020-11-18 14:34:49 +00:00
Dmitry Ukov
3acd9ab8f5 Add DeepCopy generation target to Makefile
Change-Id: I974f8472f2ad8231a6612849f1bc73895c96ef81
Closes: #384
2020-11-18 18:20:25 +04:00