-
Notifications
You must be signed in to change notification settings - Fork 31
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
[RHCLOUD-30604] return ansible_host with the high level connection status response #371
base: master
Are you sure you want to change the base?
[RHCLOUD-30604] return ansible_host with the high level connection status response #371
Conversation
93549e0
to
fb67c0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Tahmid,
I talked with Rex about this a while back. He mentioned that the ansible_host field needs to be along side the host id. More info in this comment in the jira.
At this point, I think the best thing to do is to add a new field along side the existing systems
field that contains the host id and ansible_host field. Maybe we call call this new field systems_details
(naming things is difficult)?
It feels kind of gross to add a new field to contain this info, but we would break existing clients if we changed the existing systems
field from an array of strings to an array of objects. :(
Let me know if you have any questions. I'll try to look into this a bit more closely shortly.
I just moved the
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good.
I think there is an issue where the satellite connected hosts always have an empty string for their ansible_host
even if they have a valid ansible_host in inventory.
This can be seen by modifying the inventory mock to add the ansible_host to the satellite connected host.
diff --git internal/api/connectors/inventory/inventory_mock.go internal/api/connectors/inventory/inventory_mock.go
index 7113f73..161dad8 100644
--- internal/api/connectors/inventory/inventory_mock.go
+++ internal/api/connectors/inventory/inventory_mock.go
@@ -38,6 +38,7 @@ func (this *inventoryConnectorMock) GetHostConnectionDetails(
SatelliteInstanceID: &satelliteInstanceID,
SatelliteVersion: &satelliteVersion,
SatelliteOrgID: &satelliteOrgID,
+ AnsibleHost: &ansibleHost,
}
directConnectDetails := HostDetails{
The way I see to fix it would be to stop passing the ansibleHost
parameter to the formatConnectionResponse()
method and instead add the ansiblehost
data to host
array that is passed to that method. Of course, each method that calls the formatConnectionResponse()
method will need to be modified to build that list so that it contains the host id
and ansible_host
.
I hope that makes sense.
This is complicated. :) Ping me if you need more details, etc.
@dehort I was initially thinking that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
I left one (kind of) nit-picky comment.
schema/private.openapi.yaml
Outdated
@@ -356,6 +356,18 @@ components: | |||
type: string | |||
minLength: 1 | |||
|
|||
HostIdWithAnsibleHost: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be renamed to something like HostDetails
or something a bit more generic?
Its possible that we will need to add more info about the hosts later on and then this name makes less sense.
Naming is hard :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to HostAtribute
. Unfortunately, HostDetails
is used quite extensively thoughout the codebase to mean a different thing, so didn't want to add to the confusion here.
@dehort I am occupied with the PlatEx stuff. If you or someone from the integrations team can take over this task, that'd be great! |
Hey @tahmidefaz, yep, I'll take it from here. Thank you! |
/retest |
What?
Explain what the change is linking any relevant JIRAs or Issues.
Why?
Consider what business or engineering goal does this PR achieves.
How?
Describe how the change is implemented. Any noteable new libaries, APIs, or features.
Testing
Did you add any tests for the change?
Anything Else?
Any other notes about the PR that would be useful for the reviewer.
Secure Coding Practices Checklist Link
Secure Coding Checklist