github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/cmd/subtool/getConfig.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/Cloud-Foundations/Dominator/lib/log"
     7  	"github.com/Cloud-Foundations/Dominator/lib/srpc"
     8  	"github.com/Cloud-Foundations/Dominator/sub/client"
     9  )
    10  
    11  func getConfigSubcommand(args []string, logger log.DebugLogger) error {
    12  	srpcClient := getSubClient(logger)
    13  	defer srpcClient.Close()
    14  	if err := getConfig(srpcClient); err != nil {
    15  		return fmt.Errorf("Error getting config: %s", err)
    16  	}
    17  	return nil
    18  }
    19  
    20  func getConfig(srpcClient *srpc.Client) error {
    21  	config, err := client.GetConfiguration(srpcClient)
    22  	if err != nil {
    23  		return err
    24  	}
    25  	fmt.Println(config)
    26  	return nil
    27  }