Skip to content

Commit

Permalink
[Federation][init-03] Print the federation API server address on succ…
Browse files Browse the repository at this point in the history
…ess.
  • Loading branch information
madhusudancs committed Nov 3, 2016
1 parent b8109ea commit abc7106
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion federation/pkg/kubefed/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
*/

// TODO(madhusdancs):
// 1. Make printSuccess prepend protocol/scheme to the IPs/hostnames.
// 1. Add a dry-run support.
// 2. Make all the API object names customizable.
// Ex: federation-apiserver, federation-controller-manager, etc.
Expand All @@ -31,6 +32,7 @@ package init
import (
"fmt"
"io"
"strings"
"time"

kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
Expand Down Expand Up @@ -197,7 +199,8 @@ func initFederation(cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Comman
if err != nil {
return err
}
return nil

return printSuccess(cmdOut, ips, hostnames)
}

func createNamespace(clientset *client.Clientset, namespace string) (*api.Namespace, error) {
Expand Down Expand Up @@ -515,3 +518,10 @@ func createControllerManager(clientset *client.Clientset, namespace, name, kubec

return clientset.Extensions().Deployments(namespace).Create(dep)
}

func printSuccess(cmdOut io.Writer, ips, hostnames []string) error {
svcEndpoints := append(ips, hostnames...)
_, err := fmt.Fprintf(cmdOut, "Federation API server is running at: %s\n", strings.Join(svcEndpoints, ", "))
return err
}

0 comments on commit abc7106

Please sign in to comment.