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

Updated elgohr/Publish-Docker-Github-Action to a supported version (v5) #3

Open
wants to merge 511 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
511 commits
Select commit Hold shift + click to select a range
2be8913
Prevent test crash in case inventory is defined in a host and the mon…
ori-amizur Jul 2, 2020
62a33ec
Adding python client
tsorya Jun 30, 2020
d71e774
Adding BUILD_FOLDER environment
tsorya Jul 2, 2020
7fa395e
MGMT-1396 Unclear message when the host is insufficient due to insuff…
gamli75 Jul 2, 2020
7fe8b05
Revert "Adding BUILD_FOLDER environment"
Jul 2, 2020
f3fb1eb
Revert "Adding python client"
Jul 2, 2020
2b15991
Adding python client
tsorya Jul 2, 2020
093b54a
updating github release action to create python client before image b…
tsorya Jul 2, 2020
48d9d5d
Changing name of release github action from image-push to release
tsorya Jul 5, 2020
8380399
Adding create-python-client to update and update minikube
tsorya Jul 5, 2020
2d27a85
Removing -it from docker run command in python client creation
tsorya Jul 5, 2020
0de22b8
Added link to the swagger ui in README
Jun 29, 2020
aeb311e
Fixing push github action, adding build of python client
tsorya Jul 5, 2020
b85ee9a
MGMT-1316 move install host to use state-switch
Jul 5, 2020
bd35c58
auto-generated mocks
Jul 5, 2020
90cad02
MGMT-1214 - allow to change hostnames of nodes prior to install comma…
yevgeny-shnaidman Jul 1, 2020
8c3e824
MGMT-1377 Support deploy manifest in bm-inventory deployment scripts
eranco74 Jul 1, 2020
28af1c1
MGMT-1377 Added deploy options to makefile
eranco74 Jul 1, 2020
78493c1
Updated the deploy-all options in the README
eranco74 Jul 2, 2020
72c1d28
Support deploying UI with podman
eranco74 Jul 5, 2020
866988f
Fixed deploy tag option for empty DEPLOY_TAG_OPTION
eranco74 Jul 5, 2020
656546e
Go swagger generate missing files from free-ips commit
ori-amizur Jul 5, 2020
9649396
MGMT-1272: Fix statusInfo for host register during install
avishayt Jul 5, 2020
6d444b7
MGMT-1406: Swagger - return updated resources from APIs
avishayt Jul 5, 2020
13ffd39
MGMT-1406: auto-generated from swagger
avishayt Jul 5, 2020
d4af3f7
MGMT-1406: Return updated resources from APIs
avishayt Jul 5, 2020
82502a5
auto-generated mocks
Jul 5, 2020
8c7f944
MGMT-1317 change disable host to new state machine model
Jul 5, 2020
5db0ded
Fix make create-python-client
eranco74 Jul 6, 2020
0a9e9aa
Unite host roles from hardcoded to use swagger models
YuviGold Jul 6, 2020
15175a9
MGMT-1312 move host update hw info from state machine model
Jul 6, 2020
9509633
MGMT-1126 Swaggger - add new state for cluster to support async intal…
Jun 28, 2020
832baf4
MGMT-1126 auto generated
Jun 28, 2020
7bf2e3d
MGMT-1126 Split cluster install to sync and async parts.
Jun 28, 2020
a109739
Alternetive waiting for mariaDB to response in drone testing
Jul 6, 2020
08cabc5
Added UT for request-id middleware
Jul 6, 2020
35e0776
MGMT-1409 - Changed swagger to add release-tag property to the compon…
Jul 5, 2020
1e03112
MGMT-1409 result of generation from swagger
Jul 5, 2020
cc1220b
MGMT-1409 Added support for release-tag in versions API
Jul 5, 2020
e449744
MGMT-1411 - adding subsystem test for seting hostnames
yevgeny-shnaidman Jul 6, 2020
d2a79ee
Add logger to subsystem
Jul 7, 2020
4f810bd
Bugfix SetBootstrap field
YuviGold Jul 7, 2020
dbd7bc1
MGMT-1313 Move host UpdateInventory out of state machine model
Jul 7, 2020
df1459c
MGMT-1313 autogenerated
Jul 7, 2020
f86670e
MGMT-1313 Update tests
Jul 7, 2020
f97a36d
MGMT-1313 PR fix
Jul 7, 2020
a3865a0
MGMT-1429: check length of GetMasterNodesIds reply before trying to s…
Jul 7, 2020
5017b9b
auto-generated mocks
Jul 8, 2020
0e5b5f4
MGMT-717: Do not generate image if a valid one already exists
avishayt Jul 6, 2020
5d15da4
MGMT-1401 status info shows parse error for HW info right after the h…
gamli75 Jul 6, 2020
9b664a0
MGMT-1435: Add state_info when first register a host
Jul 8, 2020
5845d6e
MGMT-1188 fix installation_error_reply broken test
Jul 8, 2020
55a7af1
MGMT-1284 Enhance InstallProgressParams with status enum and an info …
YuviGold Jun 29, 2020
f0f97d0
Reformat ProgressStatus to HostStage & Update DB
YuviGold Jul 1, 2020
fdfad26
Add Configuring stage
YuviGold Jul 5, 2020
7ca3c46
Add getStagesByRole
YuviGold Jul 7, 2020
dd68807
Remove stages array from DB
YuviGold Jul 8, 2020
24138d7
MGMT-1423 - requested name will always contain the current hostname w…
yevgeny-shnaidman Jul 7, 2020
36a1830
MGMT-1441 add empty implementation to cluster refresh on preparing-fo…
Jul 8, 2020
ffc6e18
MGMT-1457 Add progress status "Wait for ignition" to host progress st…
tsorya Jul 9, 2020
e94aa10
MGMT-1457 autogenerated
tsorya Jul 9, 2020
bf99ee8
MGMT-1401: S3Client: added file deletion method
RazRegev Jul 8, 2020
ec8005d
MGMT-1401 Inventory Test: Fixed typo
RazRegev Jul 8, 2020
64db9df
MGMT-1401: Inventory: Delete all cluster files on reset
RazRegev Jul 8, 2020
b9dccc9
MGMT-1401 DownloadClusterFiles: verify file name
RazRegev Jul 8, 2020
d85314a
Revert "MGMT-1401 DownloadClusterFiles: verify file name"
Jul 9, 2020
4eb2fdb
Revert "MGMT-1401: Inventory: Delete all cluster files on reset"
Jul 9, 2020
27416e6
Revert "MGMT-1401 Inventory Test: Fixed typo"
Jul 9, 2020
4b2c56a
Revert "MGMT-1401: S3Client: added file deletion method"
Jul 9, 2020
c312c97
MGMT-1211 Add installing-pending-for-action state & Handle wrong boot…
YuviGold Jul 9, 2020
14db15f
MGMT-1374 validate that hosts can be installed in the sync part of in…
Jul 12, 2020
f7918da
Fix flaky subsystem test
Jul 12, 2020
33e6bd3
Remove binary file
iranzo Jun 29, 2020
1e35f50
MGMT-1454 Separate HostProgressReport field & Fix host stages
YuviGold Jul 9, 2020
adf76e8
MGMT-1401: S3Client: added file deletion method
RazRegev Jul 8, 2020
e048091
MGMT-1401 Inventory Test: Fixed typo
RazRegev Jul 8, 2020
9e5e334
MGMT-1401: Inventory: Delete all cluster files on reset
RazRegev Jul 11, 2020
3e50312
MGMT-1401 DownloadClusterFiles: verify file exists
RazRegev Jul 12, 2020
cf06b9b
MGMT-1414 Swagger: Replace reset-agent to reset-installation
RazRegev Jul 11, 2020
466f0b1
MGMT-1414 Updated resetInstallationCmd
RazRegev Jul 11, 2020
172f76c
validate cluster name on creation and update
danielerez Jul 7, 2020
da8e8f0
configmap: set base_dns_domains from env var
danielerez Jul 9, 2020
c195756
MGMT-1404 Instruction Manager: Added stop installation cmd
RazRegev Jul 12, 2020
d8d86ba
Revert "validate cluster name on creation and update"
Jul 12, 2020
2283710
inventory: remove unused variable
danielerez Jul 9, 2020
a42f644
MGMT-1444 Move ignition generation outside of install cluster async p…
Jul 12, 2020
c46c0be
inventory: rename filesURL
danielerez Jul 9, 2020
a414fa3
MGMT-1358: validate cluster name on register and update
danielerez Jul 7, 2020
617a759
Remove mock generation from generate-from-swagger
Jul 13, 2020
0158f1d
MGMT-1487 Agent might not restart in case of failure
eranco74 Jul 13, 2020
cc09b17
MGMT-1445: Port image expiration from Python CronJob to Go goroutine
avishayt Jul 9, 2020
d5d1d98
Extended tools/wait_for_pod.py's timeout.
ybettan Jul 13, 2020
8b9b424
MGMT-1417 Swagger: added resetting-pending-user-action state
RazRegev Jul 12, 2020
c8a9792
MGMT-1417 Host statemachine: Allow register from new state
RazRegev Jul 13, 2020
4b54d06
MGMT-1417 Cluster Monitoring: Apply new state on cluster
RazRegev Jul 13, 2020
e9d773e
MGMT-1417 Host: auto-generated mock code
RazRegev Jul 13, 2020
7b40795
MGMT-1417 Tests: Added cluster & subsystem tests
RazRegev Jul 13, 2020
94070d9
MGMT-1446 Transfer Controller image flag to the Assisted-Installer
YuviGold Jul 13, 2020
5374872
MGMT-1417 Tests: Added cluster & subsystem tests
RazRegev Jul 13, 2020
34dd4da
MGMT-1424 setBootstrapHost: check if already has bootstrap
RazRegev Jul 13, 2020
2081e36
MGMT-1424 Host: set bootstrap=false on disable host
RazRegev Jul 13, 2020
ec678e1
Clear s3 expirere leftovers
Jul 13, 2020
c4f1e30
Updated bootstrap stages
eranco74 Jul 13, 2020
c0d88c1
MGMT-1349: set timeout to prepare-for-installation status
Jul 13, 2020
cc2b5d4
MGMT-1501 Wrong boot order lead to cluster error state
eranco74 Jul 14, 2020
0d0d5f4
MGMT-1501 Added subsystem
eranco74 Jul 14, 2020
4a85e6d
MGMT-1494 Cancel/Reset: Return host progress stages in response
RazRegev Jul 14, 2020
690a652
MGMT-1511 change cluster prepare-for-installation to use statemachine
Jul 14, 2020
ab02592
MGMT-1510: garbage collect dummy ISO immediately
avishayt Jul 15, 2020
9fd8110
Removed "Finish Waiting for control plane" from host stages in the sw…
eranco74 Jul 14, 2020
0c9bff9
MGMT-1505: Add clear message when trying to generate image to quickly
avishayt Jul 15, 2020
9d84a3e
MGMT-1516: Fix "code" property in returned errors
avishayt Jul 15, 2020
bcf8d22
MGMT-1520: add status_updated_at to updateClusterStateWithParams
Jul 15, 2020
9f388a1
OCPBUGSM-4240 Skip disabled hosts on cancel/reset
RazRegev Jul 15, 2020
7faeba6
MGMT-1367 Add to agent the pull-secret for authentication with cloud.…
eranco74 Jul 15, 2020
d1688df
MGMT-1481: Swagger for complete-installation API
avishayt Jul 13, 2020
ac4827d
MGMT-1481 Adding complete installation api :
tsorya Jul 13, 2020
245c0f3
MGMT-1481 tests
tsorya Jul 13, 2020
77328e4
MGMT-1481 autogenerated
tsorya Jul 13, 2020
13822c3
MGMT-1481 docs
tsorya Jul 14, 2020
7ed6466
MGMT-1502: remove dns records on cluster reset
danielerez Jul 15, 2020
4fb5671
MGMT-1500 Add preparing-for-installation state to hosts
Jul 15, 2020
a3ab04a
MGMT-1526: Clear bootstrap on register
RazRegev Jul 15, 2020
cdaa5a2
Removed all traces of s3-object-expirer
Jul 16, 2020
830d17c
MGMT-1355 service metrics: cluster creation & installation started
gamli75 Jul 2, 2020
48396f8
MGMT-1355 fix code review remarks
gamli75 Jul 8, 2020
12fb1a8
MGMT-1460: Add severity to events (swagger)
avishayt Jul 15, 2020
ed3bf69
Auto-generated from swagger
avishayt Jul 15, 2020
4ccc906
MGMT-1460: Add severity to events
avishayt Jul 15, 2020
91c7e0c
Fix README.md indentation
masayag Jul 15, 2020
970a379
Deployment script : Fixing failure when there is still no app but wai…
tsorya Jul 16, 2020
674e077
MGMT-1540 do not allow hostnames as localhost
tsorya Jul 17, 2020
49439ff
MGMT-1540 tests
tsorya Jul 17, 2020
9969e99
MGMT-1559 Upgrade to OCP 4.5.2
romfreiman Jul 17, 2020
b911689
MGMT-1453 fix: Ui shows one host in error but actually all are in err…
Jul 15, 2020
4067215
MGMT-1486: Image GC support for more than 1K objects
avishayt Jul 15, 2020
284238b
MGMT-1479 Add stage_started_at and stage_updated_at & MGMT-1493 fix s…
YuviGold Jul 14, 2020
90f386e
UpdateCluster receives parameters and returns a Cluster
YuviGold Jul 15, 2020
98d05b9
Remove UpdateReplay
YuviGold Jul 16, 2020
7306fd2
MGMT-1518 add request id to host and cluster monitors context
Jul 19, 2020
396866e
OCPBUGSM-4255 Added reset and cancel to eventsHandler
RazRegev Jul 19, 2020
6ba329e
Add FOR UPDATE db option to install clsuter transaction
Jul 19, 2020
cf7ee4c
MGMT-1565 change cluster refresh status using get cluster from db once
Jul 19, 2020
56f3edc
MGMT-1339 - BMH CRs should not be created for disabled hosts
yevgeny-shnaidman Jul 20, 2020
b786fab
MGMT-1419 - always set hstname in ignition, so that the hostname repo…
yevgeny-shnaidman Jul 20, 2020
0d2b69f
MGMT-1567 Change cluster API to use dependency injection to get host …
Jul 20, 2020
01803c4
MGMT-1579: Expired images are not deleted
avishayt Jul 20, 2020
ef97313
MGMT-1581 Bugfix unsafe status pointers
YuviGold Jul 21, 2020
101135c
go.*
ori-amizur Jul 20, 2020
e22ca4a
MGMT-1380 swagger changes
ori-amizur Jul 21, 2020
5f66772
MGMT-1380 Changes - Validations
ori-amizur Jul 21, 2020
eb2a863
GMT-1380 Refresh status changes
ori-amizur Jul 21, 2020
d2f3d15
Added Jenkinsfile
Jul 19, 2020
1c5fe4c
add agent to pipline
Jul 21, 2020
c98b138
MGMT-1566: Add missing API events
avishayt Jul 20, 2020
9820630
Bugfix UpdateHost and UpdateCluster err value
YuviGold Jul 21, 2020
4460a72
MGMT-1490 Enforce stages enum ordering
YuviGold Jul 21, 2020
9d2a6c2
Fixing PSE deployment and added some adjustments on Prom svc
jparrill Jul 21, 2020
219293a
Adding details to README.md
jparrill Jul 21, 2020
122e2f0
MGMT-1564 move stage_started_at and stage_updated_at fields to host -…
gamli75 Jul 21, 2020
e5df1d4
MGMT-1355 adding host metrics and cluster installation duration
gamli75 Jul 16, 2020
9793719
fix code review
gamli75 Jul 20, 2020
fcf1d3a
S3 Expirer unit tests
avishayt Jul 21, 2020
ea237e0
MGMT-1594 remove unused ImageBuilderCmd overwrite hack
Jul 22, 2020
0afd1c3
log collecting on post
Jul 21, 2020
2242da3
MGMT-1593 update inventory should be allowed from pending-for-input s…
ori-amizur Jul 21, 2020
5358412
MGMT-1528 add postrgres support to assisted installer
tsorya Jul 18, 2020
193c4b9
MGMT-1528 test fixes
tsorya Jul 18, 2020
bbd50b4
MGMT-1528 update drone
tsorya Jul 18, 2020
8a66622
MGMT-1528 Use dockertest to run UTs with postgress
Jul 19, 2020
90952b4
removed maria related files
Jul 20, 2020
13d735a
MGMT-1528 PR related changes
Jul 20, 2020
3272d8c
MGMT-1528 - Rebase fixes
Jul 21, 2020
725ee39
MGMT-1537 - Use supported postgres image
Jul 21, 2020
97ad82e
Fixes after rebase
Jul 22, 2020
b99ed8d
unit-test target should wait until postgres is ready
Jul 22, 2020
7acbb39
delete debug.test file
gamli75 Jul 22, 2020
402bc34
MGMT-1595 duration value is incorrect when we report installation pha…
gamli75 Jul 22, 2020
bc3e02c
MGMT-1603 Prevent dummy iso generation uploading to s3
Jul 22, 2020
8fe1d83
MGMT-1527 Getting an error in bm-inventory log when updating free-ips…
ori-amizur Jul 22, 2020
9728d01
MGMT-1596 Update hostname should be allowed from pending-for-input state
ori-amizur Jul 23, 2020
235de7f
MGMT-1241: Disk according to GB not GiB, clearer validation messages
avishayt Jul 23, 2020
072ce5f
Added "Waiting for control plane" to host stages
eranco74 Jul 23, 2020
2bdbee0
MGMT-1090 Remove the HWinfo host operation
ori-amizur Jul 23, 2020
4831b2a
MGMT-1607 Upgrade bm-inventory to install 4.5.3 OCP
romfreiman Jul 23, 2020
07ca6fd
MGMT-1318 - enhance BMH CRs with relevant inventory data
yevgeny-shnaidman Jul 19, 2020
242ebc9
MGMT-1583 Host Monitor: check for cluster errors
RazRegev Jul 26, 2020
bdef509
MGMT-1583 Subsystem: Added cluster test
RazRegev Jul 26, 2020
d24cdbf
MGMT-1118 Update ignition for RHCOS
rollandf Jul 9, 2020
881850c
MGMT-1618 Validate pull secret is set prior to generating the cluster…
eranco74 Jul 15, 2020
d26f963
MGMT-1041 Swagger add 404 to host registration
Jul 26, 2020
3b3e888
MGMT-1041 return forbidden error when host register to cluster that d…
Jul 26, 2020
35e3774
MGMT-1583 Reset Installation: allow reset from various states
RazRegev Jul 27, 2020
077eb86
MGMT-1635 improve s3 wrapper bucket create error
Jul 28, 2020
964c3cd
Publish image with PR_{hash} tag for any PR build
eranco74 Jul 28, 2020
e93b330
MGMT-1632 Subsystem: fixed "cancel_failed_cluster" test
RazRegev Jul 28, 2020
e963709
MGMT-1634 bugfix report progress subsystem test
YuviGold Jul 28, 2020
28a0e51
MGMT-1129 Machine CIDR calculation and VIP verification should exclud…
ori-amizur Jul 27, 2020
8da04f0
MGMT-1616 - move OCP release image configuration to configmap
yevgeny-shnaidman Jul 26, 2020
7efd89b
Rename inventory_test.go register host test db name
Jul 28, 2020
f515455
MGMT-1413 Added owner to cluster swagger definition
eranco74 Jul 6, 2020
cef86c7
Autogenerated
eranco74 Jul 23, 2020
2678aad
MGMT-738 Added fake auth so we will get default username in the reque…
eranco74 Jul 23, 2020
5500902
MGMT-1413 Added basic identity implementaion
eranco74 Jul 6, 2020
4eabdac
MGMT-1402: Add events for all host transitions
avishayt Jul 26, 2020
ef91930
OCPBUGSM-8565: Add cluster name to register event
avishayt Jul 28, 2020
f5df1a9
MGMT-1110 Add message of the day to agent
ori-amizur Jul 27, 2020
f95f0f9
MGMT-1231 Deployment files: custom namespace
RazRegev Jul 27, 2020
d334341
MGMT-1231 Deployment scripts: accept custom namespace
RazRegev Jul 28, 2020
f22a560
MGMT-1231 Makefile: accept NAMESPACE argument from user/env
RazRegev Jul 28, 2020
5da45f2
MGMT-1382 Add an option to download install-config that we generate
tsorya Jul 28, 2020
49f3a54
MGMT-1382 autogenerated
tsorya Jul 28, 2020
9544d9b
MGMT-1643 - trim whitespaces around inventory port and url in case ig…
yevgeny-shnaidman Jul 28, 2020
33d9aa6
MGMT-1643 - trim whitespace on the result returned by minikube comman…
yevgeny-shnaidman Jul 29, 2020
754c662
Revert "Publish image with PR_{hash} tag for any PR build"
eranco74 Jul 29, 2020
6b7a5c8
MGMT-1647 Add test function getting cluster masters
YuviGold Jul 29, 2020
11f05d9
OCPBUGSM-10683 Deploy UI: pull image
RazRegev Jul 29, 2020
781a552
MGMT-1646 clearer monitor log
YuviGold Jul 29, 2020
7bd06b7
MGMT-1231 moved '--namespace' arg outside from the mutually_exclusive…
RazRegev Jul 29, 2020
e5f50ed
OPCBUGSM-4299: Allow canceling installed hosts
RazRegev Jul 29, 2020
16b7cac
fixing sub-system test, dding system vendor info to test hosts
yevgeny-shnaidman Jul 29, 2020
6801ab6
Updated S3 bucket creation in cmd/main.
ybettan Jul 29, 2020
dc96569
Avoid pushing PR images from a fork
Jul 29, 2020
cdf86c9
MGMT-1658 enable disabling host in pending-for-input state
Jul 30, 2020
6adc414
Fix tests which rely on execution under three minutes
carbonin Jul 29, 2020
52026d9
Add /vendor to .gitignore
carbonin Jul 28, 2020
ef72646
Fix bootstrap stages enforcement
YuviGold Jul 30, 2020
44ebce5
MGMT-1080 adding mount to journal docker to assisted-installer
tsorya Jul 30, 2020
c99736a
Created a pkg for DB.
ybettan Jul 29, 2020
8c5cb08
OCPBUGSM-11342 Support SSD drives
ori-amizur Jul 29, 2020
5f6f47f
MGMT-1686 Add option to bm-inventory deploy option to reduce minimum …
Aug 2, 2020
d2f0c36
MGMT-1670 Remove redundant log messages
ori-amizur Aug 2, 2020
0b90e0b
MGMT-1428 Add TLS option for OC deployment
empovit Jul 30, 2020
1347c23
MGMT-1428 Simplify secret creation code
empovit Aug 2, 2020
b946167
MGMT-1582 Cancel/Reset from preparing-for-installation
RazRegev Aug 3, 2020
1a2a6e0
MGMT-1582 Inventory: delete cluster installation files generation job…
RazRegev Jul 29, 2020
c780640
Updated use of Postgres credentials from Secret.
ybettan Aug 2, 2020
f414302
Removed default values from DBConfig.
ybettan Aug 2, 2020
7f92fd0
Updated use of S3 credentials from Secret.
ybettan Aug 2, 2020
407ca86
Removed default values from S3Config.
ybettan Aug 2, 2020
44a33cb
MGMT-1433 User-Auth pass Pull Secret Token as env param
rollandf Jul 29, 2020
4b42a15
Onboarding to app-interface
apahim Jul 8, 2020
d71fbbc
Updated the deployed app from demo to bm-inventory.
ybettan Jul 21, 2020
b09b90e
Added a Service for bm-inventory app.
ybettan Jul 23, 2020
0851891
Renamed the app's name 'bm-inventory' --> 'assisted-service'.
ybettan Jul 26, 2020
c985524
Connected `assisted-service` deployment to its ServiceAccount.
ybettan Jul 30, 2020
1a3df2b
Removed unused code from openshfit/template.yaml.
ybettan Aug 3, 2020
ce8dd9f
OCPBUGSM-13662 Allow deploying postgres secret to costum namespace
eranco74 Aug 4, 2020
fc3c8ba
OCPBUGSM-13662 fix deploy scality-secret to get namespace option
Aug 4, 2020
b73bd0c
Updated elgohr/Publish-Docker-Github-Action to a supported version (v5)
elgohr Mar 29, 2023
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
Prev Previous commit
Next Next commit
MGMT-1658 enable disabling host in pending-for-input state
  • Loading branch information
Michael Filanov authored and filanov committed Jul 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cdf86c9a5bfeb5be3ef2f9671df09b1b398a9ea9
9 changes: 5 additions & 4 deletions internal/host/statemachine.go
Original file line number Diff line number Diff line change
@@ -129,10 +129,11 @@ func NewHostStateMachine(th *transitionHandler) stateswitch.StateMachine {
sm.AddTransition(stateswitch.TransitionRule{
TransitionType: TransitionTypeDisableHost,
SourceStates: []stateswitch.State{
HostStatusDisconnected,
HostStatusDiscovering,
HostStatusInsufficient,
HostStatusKnown,
stateswitch.State(models.HostStatusDisconnected),
stateswitch.State(models.HostStatusDiscovering),
stateswitch.State(models.HostStatusInsufficient),
stateswitch.State(models.HostStatusKnown),
stateswitch.State(models.HostStatusPendingForInput),
},
DestinationState: HostStatusDisabled,
PostTransition: th.PostDisableHost,
25 changes: 22 additions & 3 deletions internal/host/transition_test.go
Original file line number Diff line number Diff line change
@@ -641,15 +641,24 @@ var _ = Describe("Disable", func() {
Expect(*h.Status).Should(Equal(srcState))
}

mockEventsUpdateStatus := func(srcState string) {
mockEvents.EXPECT().AddEvent(gomock.Any(), hostId.String(), models.EventSeverityInfo,
fmt.Sprintf(`Host %s: updated status from "%s" to "disabled" (Host is disabled)`,
host.ID.String(), srcState),
gomock.Any(), host.ClusterID.String()).Times(1)
}

tests := []struct {
name string
srcState string
validation func(error)
mocks []func(string)
}{
{
name: "known",
srcState: HostStatusKnown,
validation: success,
mocks: []func(string){mockEventsUpdateStatus},
},
{
name: "disabled nothing change",
@@ -660,11 +669,13 @@ var _ = Describe("Disable", func() {
name: "disconnected",
srcState: HostStatusDisconnected,
validation: success,
mocks: []func(string){mockEventsUpdateStatus},
},
{
name: "discovering",
srcState: HostStatusDiscovering,
validation: success,
mocks: []func(string){mockEventsUpdateStatus},
},
{
name: "error",
@@ -690,29 +701,37 @@ var _ = Describe("Disable", func() {
name: "insufficient",
srcState: HostStatusInsufficient,
validation: success,
mocks: []func(string){mockEventsUpdateStatus},
},
{
name: "resetting",
srcState: HostStatusResetting,
validation: failure,
},
{
name: models.HostStatusPendingForInput,
srcState: models.HostStatusPendingForInput,
validation: success,
mocks: []func(string){mockEventsUpdateStatus},
},
}

for i := range tests {
t := tests[i]
It(t.name, func() {
srcState = t.srcState
host = getTestHost(hostId, clusterId, srcState)
for _, m := range t.mocks {
m(t.srcState)
}
Expect(db.Create(&host).Error).ShouldNot(HaveOccurred())
mockEvents.EXPECT().AddEvent(gomock.Any(), hostId.String(), models.EventSeverityInfo,
fmt.Sprintf("Host %s: updated status from \"%s\" to \"disabled\" (Host is disabled)", host.ID.String(), t.srcState),
gomock.Any(), host.ClusterID.String())
t.validation(hapi.DisableHost(ctx, &host))
})
}
})

AfterEach(func() {
ctrl.Finish()
common.DeleteTestDB(db, dbName)
})
})