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

Add and delete node command for automate HA #7563

Merged
merged 30 commits into from
Nov 25, 2022
Merged

Conversation

vivekshankar1
Copy link
Collaborator

@vivekshankar1 vivekshankar1 commented Nov 23, 2022

🔩 Description: What code changed, and why?

Created command to add new node in chef automate HA, example: chef-automate node add --automate 10.0.1.2
Created command to delete node from chef automate HA, example: chef-automate node remove --automate 10.0.1.2

⛓️ Related Resources

https://chefio.atlassian.net/browse/SHIELD-171
https://chefio.atlassian.net/browse/SHIELD-172

👍 Definition of Done

Running the add node command will add node to HA setup
Running the remove node commands will remove node from HA setup.
You can verify this by running chef-automate status

Follow the docs for add and remove nodes at this link: https://deploy-preview-7563--chef-automate.netlify.app/automate/ha_onprim_deployment_procedure/

👟 How to Build and Test the Change

✅ Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

Screenshot 2022-11-25 at 4 11 47 PM

Screenshot 2022-11-25 at 4 30 53 PM

Screenshot 2022-11-25 at 4 11 18 PM

My.Movie.1.mp4

@netlify
Copy link

netlify bot commented Nov 23, 2022

Deploy Preview for chef-automate ready!

Name Link
🔨 Latest commit 9ffc255
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/6380fd32f2e7090008ad401f
😎 Deploy Preview https://deploy-preview-7563--chef-automate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -450,3 +441,16 @@ func (e *existingInfra) validateIPs() *list.List {

return errorList
}

func readConfig(path string) (ExistingInfraConfigToml, error) {
templateBytes, err := ioutil.ReadFile(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ioutil.ReadFile is deprecated (Line 446)

Suggested change
templateBytes, err := ioutil.ReadFile(path)
templateBytes, err := os.ReadFile(path)

Created by deprecated-ioutil-readfile.

}

func writeFile(tomlbytes []byte, filepath string) error {
err := ioutil.WriteFile(filepath, tomlbytes, 0600)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ioutil.WriteFile is deprecated (Line 85)

Suggested change
err := ioutil.WriteFile(filepath, tomlbytes, 0600)
err := os.WriteFile(filepath, tomlbytes, 0600)

Created by deprecated-ioutil-writefile.

@vivekshankar1 vivekshankar1 changed the title Update cli ha nodes [WIP] Update cli ha nodes Nov 23, 2022
@vivekshankar1 vivekshankar1 requested a review from a team as a code owner November 23, 2022 16:44
@github-actions github-actions bot added the documentation Anything related to the Automate docs. label Nov 23, 2022
@vivekshankar1 vivekshankar1 changed the title [WIP] Update cli ha nodes [WIP]Add and delete node command for automate HA Nov 24, 2022
@vivekshankar1 vivekshankar1 changed the title [WIP]Add and delete node command for automate HA Add and delete node command for automate HA Nov 25, 2022
@vivekshankar1 vivekshankar1 added WIP and removed WIP labels Nov 25, 2022
Copy link
Member

@atultherajput atultherajput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@dishanktiwari2501 dishanktiwari2501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and Updated the doc accordingly.

shaik80 and others added 8 commits November 25, 2022 23:01
Signed-off-by: shaik80 <sh.mudassir98@gmail.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
vivekshankar1 and others added 21 commits November 25, 2022 23:01
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: dishanktiwari2501 <dtiwari@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
@punitmundra punitmundra merged commit 31c6955 into main Nov 25, 2022
@punitmundra punitmundra deleted the update_cli_ha_nodes branch November 25, 2022 17:39
@sonarcloud
Copy link

sonarcloud bot commented Nov 25, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

82.2% 82.2% Coverage
26.3% 26.3% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acceptance: verified documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants