-
Notifications
You must be signed in to change notification settings - Fork 111
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
Syncing configuration to the new node after node add #7949
Conversation
👷 Deploy Preview for chef-automate processing.
|
8d8cb33
to
f618496
Compare
} | ||
|
||
// Execute 'config show' command in specific service and fetch the output file to bastion | ||
func ExecuteCustomCmdInServiceNode(outputFiles []string, inputFiles []string, inputFilesPrefix string, service string, cmdString string, singleNode bool) error { |
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.
func ExecuteCustomCmdInServiceNode(outputFiles []string, inputFiles []string, inputFilesPrefix string, service string, cmdString string, singleNode bool) error { | |
func ExecuteCustomCmdOnEachNodeType(outputFiles []string, inputFiles []string, inputFilesPrefix string, service string, cmdString string, singleNode bool) error { |
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.
Done
@@ -450,7 +465,7 @@ func appendChildFileToParentFile(hostIp, parent, child string) (string, error) { | |||
} | |||
|
|||
fileContent := string(output) | |||
start := fmt.Sprintf("Output for Host IP %s : \n%s\n", hostIp, fileContent) | |||
start := fmt.Sprintf("%s\n", fileContent) |
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 needed in other commands, don't remove Host IP
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.
Done
|
||
} | ||
*/ | ||
func ExecuteCmdInAllNodeAndCaptureOutput(nodeObjects []*NodeObject, singleNode bool, outputDirectory string) error { |
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.
move this to ha_node_operations_utils.go
Also rename this, with proper explanation name
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.
Done
} else { | ||
cmd.CmdInputs.Args = inputFiles | ||
if len(inputFiles) > 0 { | ||
cmd.PreExec = prePatchCheckForFrontendNodes |
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.
you cannot import function from lib which uses this utility
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.
Removed the dependency from other libs
case OPENSEARCH: | ||
nodeMap.Opensearch = cmd | ||
} | ||
infra, err := getAutomateHAInfraDetails() |
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.
getAutomateHAInfraDetails is not in util, don't use it here.
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.
Done.
} | ||
|
||
// Create *Cmd struct instance with 'cmdString' and 'outputFiles' params | ||
func ServiceNodeConstructor(nodeMap *NodeTypeAndCmd, cmdString string, outputFiles []string, singleNode bool) *Cmd { |
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.
func ServiceNodeConstructor(nodeMap *NodeTypeAndCmd, cmdString string, outputFiles []string, singleNode bool) *Cmd { | |
func NewNodeTypeCmd(nodeMap *NodeTypeAndCmd, cmdString string, outputFiles []string, singleNode bool) *Cmd { |
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.
Updated
if err != nil { | ||
return err | ||
} | ||
err = syncConfigToAllNodes() |
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.
we should run this before error check
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.
Done
} | ||
err = syncConfigToAllNodes() | ||
if err != nil { | ||
return err |
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.
Wrap all errors with distinct strings
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.
Done
components/automate-cli/cmd/chef-automate/ha_node_operations_utils.go
Outdated
Show resolved
Hide resolved
components/automate-cli/cmd/chef-automate/ha_node_operations_utils.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
9e6b943
to
928196c
Compare
Signed-off-by: Arvinth C <arvinth.chandrasekaran@progress.com>
🔩 Description: What code changed, and why?
As an Automate HA user, when the user adds a new node, it should also add/sync up all the configs added in the bootstrap Frontend node.
⛓️ Related Resources
Jira ticket: https://chefio.atlassian.net/browse/CHEF-2712
👍 Definition of Done
Following are the scenarios covered in testing:
Why testing on Remove node flow?
Because of the following behavior of nodes getting replaced, the sync up is done in remove node flow so that the newly added nod will also have all config as well.
Before removing nodes. Automate nodes:
After remove node:
👟 How to Build and Test the Change
✅ Checklist
All PRs must tick these:
With occasional exceptions, all PRs from Progress employees must tick these:
make spell
in any component directory)All PRs from Progress employees should tick these if appropriate:
Please add a note next to any checkbox above if you are NOT ticking it.
📷 Screenshots, if applicable
Demo Videos:
Add node in AWS:
https://progresssoftware.sharepoint.com/:v:/s/ChefCoreC/ESX5RAGEcJxDiS8JjKc4HgQBjP9rHKRU-v_HSZ9voEG-sQ?e=Ejn8xR
Add node in On-prem Managed services:
https://progresssoftware.sharepoint.com/:v:/s/ChefCoreC/Ef7rnGtWzgtPk-WZlSSB2-kB88vaVmopRaynYB2f5kCfTw?e=WKsGbw
Docs and screenshots:
Config of Newly Added node without this PR change: https://progresssoftware-my.sharepoint.com/:u:/g/personal/archand_progress_com/EagitM3p-NtPhWfHg-ZBLh8B8-OTYU35dzn5F8e_q5vfmg?e=qy9v45
Config of Newly Added node with this PR change: https://progresssoftware-my.sharepoint.com/:u:/g/personal/archand_progress_com/EYOaHHNXdHVBmcIsIVlvolcB3vvSIqvHpKtuOl_XN-3cvw?e=lmslsy
Service status after adding node and applying the new config
![image](https://private-user-images.githubusercontent.com/54614142/247902019-f0243a48-caeb-4cad-9656-877cf9598443.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MDksIm5iZiI6MTcyMDU5ODIwOSwicGF0aCI6Ii81NDYxNDE0Mi8yNDc5MDIwMTktZjAyNDNhNDgtY2FlYi00Y2FkLTk2NTYtODc3Y2Y5NTk4NDQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDA3NTY0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkOGFlY2IxNTE1Y2I3YWIxZWI4N2U1MTFlNTg3YWM4ZDhjMTY2Mjk4MzYwMDJmYzdjZGVjMzFmYWUzOGIyYTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JEt6GveB7VVbjlbibufvu5m5g41Oon5Gy3dvcekihqc)
Test coverage: (Overall test coverage on Sonarqube for code written in this PR: 86%)
![image](https://private-user-images.githubusercontent.com/54614142/247520623-58ccd864-a55c-4ca2-aa0f-78126f6e77bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MDksIm5iZiI6MTcyMDU5ODIwOSwicGF0aCI6Ii81NDYxNDE0Mi8yNDc1MjA2MjMtNThjY2Q4NjQtYTU1Yy00Y2EyLWFhMGYtNzgxMjZmNmU3N2JiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDA3NTY0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhNWI5NjI3NjM0ZGVkZmIxN2FjYWJkNTMxYjFiY2ZmYjZmYTRiYTU0OTExNTJlMjY4ZDFkYjI1MzYzZDhjODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wv-vS4bfBqERy_ZkY2bF1PTlVS9ZeG6WCxmpz4enVvc)