github.com/openshift/installer@v1.4.17/pkg/asset/manifests/utils.go (about)

     1  package manifests
     2  
     3  import (
     4  	"fmt"
     5  
     6  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     7  
     8  	"github.com/openshift/installer/pkg/types"
     9  )
    10  
    11  type configurationObject struct {
    12  	metav1.TypeMeta
    13  
    14  	Metadata metadata    `json:"metadata,omitempty"`
    15  	Data     genericData `json:"data,omitempty"`
    16  }
    17  
    18  type metadata struct {
    19  	Annotations map[string]string `json:"annotations,omitempty"`
    20  	Name        string            `json:"name,omitempty"`
    21  	Namespace   string            `json:"namespace,omitempty"`
    22  }
    23  
    24  func configMap(namespace, name string, data genericData) *configurationObject {
    25  	return &configurationObject{
    26  		TypeMeta: metav1.TypeMeta{
    27  			APIVersion: "v1",
    28  			Kind:       "ConfigMap",
    29  		},
    30  		Metadata: metadata{
    31  			Name:      name,
    32  			Namespace: namespace,
    33  		},
    34  		Data: data,
    35  	}
    36  }
    37  
    38  func getAPIServerURL(ic *types.InstallConfig) string {
    39  	return fmt.Sprintf("https://api.%s:6443", ic.ClusterDomain())
    40  }
    41  
    42  func getInternalAPIServerURL(ic *types.InstallConfig) string {
    43  	return fmt.Sprintf("https://api-int.%s:6443", ic.ClusterDomain())
    44  }