Parcourir la source

review comments

Matthew R Kasun il y a 2 ans
Parent
commit
a14951d939
3 fichiers modifiés avec 7 ajouts et 9 suppressions
  1. 5 8
      cli/cmd/ext_client/update.go
  2. 1 0
      controllers/regex_test.go
  3. 1 1
      models/node.go

+ 5 - 8
cli/cmd/ext_client/update.go

@@ -12,9 +12,6 @@ import (
 
 var (
 	extClientUpdateFile string
-	updatedPublicKey    string
-	updatedDNS          string
-	updatedAllowedips   []string
 )
 
 var extClientUpdateCmd = &cobra.Command{
@@ -38,8 +35,8 @@ var extClientUpdateCmd = &cobra.Command{
 			}
 		} else {
 			extClient.ClientID = extClientID
-			extClient.PublicKey = updatedPublicKey
-			extClient.DNS = updatedDNS
+			extClient.PublicKey = publicKey
+			extClient.DNS = dns
 		}
 		functions.PrettyPrint(functions.UpdateExtClient(network, clientID, extClient))
 	},
@@ -48,8 +45,8 @@ var extClientUpdateCmd = &cobra.Command{
 func init() {
 	extClientUpdateCmd.Flags().StringVar(&extClientID, "id", "", "updated ID of the external client")
 	extClientUpdateCmd.Flags().StringVar(&extClientUpdateFile, "file", "", "Filepath of updated external client definition in JSON")
-	extClientUpdateCmd.Flags().StringVar(&updatedPublicKey, "public_key", "", "updated public key of the external client")
-	extClientUpdateCmd.Flags().StringVar(&updatedDNS, "dns", "", "updated DNS of the external client")
-	extClientUpdateCmd.Flags().StringSliceVar(&updatedAllowedips, "allowedips", []string{}, "updated extra allowed IPs of the external client")
+	extClientUpdateCmd.Flags().StringVar(&publicKey, "public_key", "", "updated public key of the external client")
+	extClientUpdateCmd.Flags().StringVar(&dns, "dns", "", "updated DNS of the external client")
+	extClientUpdateCmd.Flags().StringSliceVar(&allowedips, "allowedips", []string{}, "updated extra allowed IPs of the external client")
 	rootCmd.AddCommand(extClientUpdateCmd)
 }

+ 1 - 0
controllers/regex_test.go

@@ -2,6 +2,7 @@ package controller
 
 import "testing"
 
+// TestValidName tests the validName function
 func TestValidName(t *testing.T) {
 	type args struct {
 		Name string

+ 1 - 1
models/node.go

@@ -69,7 +69,7 @@ type CommonNode struct {
 	IsEgressGateway     bool          `json:"isegressgateway" yaml:"isegressgateway"`
 	EgressGatewayRanges []string      `json:"egressgatewayranges" bson:"egressgatewayranges" yaml:"egressgatewayranges"`
 	IsIngressGateway    bool          `json:"isingressgateway" yaml:"isingressgateway"`
-	IngressDNS          string        `json:"extclientdns" yaml:"extclientdns"`
+	IngressDNS          string        `json:"ingressdns" yaml:"ingressdns"`
 	DNSOn               bool          `json:"dnson" yaml:"dnson"`
 	PersistentKeepalive time.Duration `json:"persistentkeepalive" yaml:"persistentkeepalive"`
 }