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 backup config management to flexctl #244

Merged
merged 16 commits into from
Jul 18, 2024

Conversation

ndarilek
Copy link
Contributor

This adds a flexctl backup config command.

root@5683596bd029d8:/# flexctl backup config help                                                                       
Manage backup configuration                                                                                             
                                                                                                                        
Usage:                                                                                                                  
  flexctl backup config [command]                                                                                       
                                                                                                                        
Available Commands:                                                                                                     
  show        Show current configuration                                                                                
  update      Update configuration                                                                                      
                                                                                                                        
Flags:                                                                                                                  
  -h, --help   help for config                                                                                          
                                                                                                                        
Use "flexctl backup config [command] --help" for more information about a command.                                      
root@5683596bd029d8:/# flexctl backup config show                                                                       
  ArchiveTimeout = 60s                                                                                                  
  RecoveryWindow = 7d                                                                                                   
  FullBackupFrequency = 24h                                                                                             
  MinimumRedundancy = 5                                                                                                 
root@5683596bd029d8:/# flexctl backup config update                                                                     
At least one flag must be specified.                                                                                    
root@5683596bd029d8:/# flexctl backup config update --minimum-redundancy foo                                            
error updating configuration: invalid value for minimum_redundancy: foo                                                 
root@5683596bd029d8:/# flexctl backup config update --minimum-redundancy 3                                              
Updated                                                                                                                 
A restart is required for these changes to take effect.                                                                 
root@5683596bd029d8:/# flexctl backup config show                                                                       
  ArchiveTimeout = 60s                                                                                                  
  RecoveryWindow = 7d                                                                                                   
  FullBackupFrequency = 24h                                                                                             
  MinimumRedundancy = 3                                                                                                 

Copy link
Contributor

@davissp14 davissp14 left a comment

Choose a reason for hiding this comment

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

Awesome work with this! Just a few notes.

cmd/flexctl/backups.go Outdated Show resolved Hide resolved
return err
}

fmt.Printf(" ArchiveTimeout = %s\n", rv.Result.ArchiveTimeout)
Copy link
Contributor

Choose a reason for hiding this comment

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

To future proof this, we could consider just pretty printing the json output. However, I think this is totally fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went back and forth on this but came to the same conclusion. If we make it more unwieldy, I'm happy to switch it later, or if you think we should do it now then I can.

cmd/flexctl/backups.go Outdated Show resolved Hide resolved
cmd/flexctl/backups.go Outdated Show resolved Hide resolved
cmd/flexctl/backups.go Outdated Show resolved Hide resolved
internal/supervisor/ensure_kill_linux.go Show resolved Hide resolved
@ndarilek
Copy link
Contributor Author

All feedback should be addressed. Please let me know if I missed anything, and please make any suggestions for the command structure since I'm going to mirror it under fly pg and don't want to circle back and change it later. :)

Thanks.

Copy link
Contributor

@davissp14 davissp14 left a comment

Choose a reason for hiding this comment

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

Looks good!

@ndarilek ndarilek merged commit a0e95ba into master Jul 18, 2024
5 of 6 checks passed
@ndarilek ndarilek deleted the 39-add-config-management-to-flexctl branch July 18, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants