-
Notifications
You must be signed in to change notification settings - Fork 114
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
Passing the base platform name to the nodemanager #3612
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ type ChefRun struct { | |
NodeRun backend.Run | ||
NodeAttribute backend.NodeAttribute | ||
BulkableRequests []elastic.BulkableRequest | ||
Platform string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the raw platform to the message that is passed along in the pipeline. |
||
Ctx context.Context | ||
errc chan<- error | ||
} | ||
|
@@ -43,6 +44,7 @@ func NewChefRun(ctx context.Context, run *chef.Run, err chan<- error) ChefRun { | |
backend.Run{}, | ||
backend.NodeAttribute{}, | ||
[]elastic.BulkableRequest{}, | ||
"", | ||
ctx, | ||
err, | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,9 @@ func ChefRunTransmogrify(in <-chan message.ChefRun, out chan<- message.ChefRun, | |
continue | ||
} | ||
|
||
// Needed for the nodemanager because the platform field is combined with the version. | ||
msg.Platform = ccr.Platform() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only place we have access to the raw platform. So, we set the pipeline msg platform here. |
||
|
||
message.PropagateChefRun(out, &msg) | ||
} | ||
close(out) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ func nodeManagerPublisher(in <-chan message.ChefRun, nodeManagerClient manager.N | |
continue | ||
} | ||
|
||
nodeMetadata, err := gatherInfoForNode(msg.Node) | ||
nodeMetadata, err := gatherInfoForNode(msg) | ||
if err != nil { | ||
log.Errorf("unable parse node data to be send to manager. aborting attempt to send info to mgr for node %s -- %v", msg.Node.NodeName, err) | ||
out <- msg | ||
|
@@ -51,7 +51,9 @@ func nodeManagerPublisher(in <-chan message.ChefRun, nodeManagerClient manager.N | |
return out | ||
} | ||
|
||
func gatherInfoForNode(node backend.Node) (*manager.NodeMetadata, error) { | ||
func gatherInfoForNode(msg message.ChefRun) (*manager.NodeMetadata, error) { | ||
node := msg.Node | ||
|
||
// convert node check in time to proto timestamp | ||
timestamp, err := ptypes.TimestampProto(node.Checkin) | ||
if err != nil { | ||
|
@@ -82,7 +84,7 @@ func gatherInfoForNode(node backend.Node) (*manager.NodeMetadata, error) { | |
return &manager.NodeMetadata{ | ||
Uuid: node.EntityUuid, | ||
Name: node.NodeName, | ||
PlatformName: node.PlatformFamily, | ||
PlatformName: msg.Platform, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then at this point, we can set the platform from the pipeline message. |
||
PlatformRelease: node.PlatformVersion, | ||
LastContact: timestamp, | ||
SourceId: node.CloudID, | ||
|
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 cleaning up the way we grab the platform.