File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,10 @@ var startCmd = &cobra.Command{
6565var setupCmd = & cobra.Command {
6666 Use : "setup" ,
6767 Run : func (cmd * cobra.Command , args []string ) {
68- existingConfig , err := GetConfig ()
68+ _ , err := GetConfig ()
6969 if err == nil {
70- fmt .Println (existingConfig )
71- if existingConfig .WireguardConfig .PrivateKey != "" {
72- cmd .Println ("Sorry, you can't change any config" )
73- return
74- }
70+ cmd .Println ("Sorry, you can't change any config" )
71+ return
7572 }
7673
7774 wireguard_cidr , err := strconv .Atoi (cmd .Flag ("wireguard-cidr" ).Value .String ())
Original file line number Diff line number Diff line change @@ -28,14 +28,7 @@ type DockerNetworkConfig struct {
2828func GetConfig () (* AgentConfig , error ) {
2929 var config AgentConfig
3030 if err := rDB .First (& config ).Error ; err != nil {
31- if errors .Is (err , gorm .ErrRecordNotFound ) {
32- return & AgentConfig {
33- WireguardConfig : WireguardConfig {},
34- DockerNetwork : DockerNetworkConfig {},
35- }, nil
36- } else {
37- return nil , errors .New ("error getting config" )
38- }
31+ return nil , errors .New ("error getting config" )
3932 }
4033 return & config , nil
4134}
You can’t perform that action at this time.
0 commit comments