forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
utils.go
38 lines (31 loc) · 819 Bytes
/
utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package manifests
import (
"fmt"
"github.com/openshift/installer/pkg/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type configurationObject struct {
metav1.TypeMeta
Metadata metadata `json:"metadata,omitempty"`
Data genericData `json:"data,omitempty"`
}
type metadata struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
func configMap(namespace, name string, data genericData) *configurationObject {
return &configurationObject{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Kind: "ConfigMap",
},
Metadata: metadata{
Name: name,
Namespace: namespace,
},
Data: data,
}
}
func getAPIServerURL(ic *types.InstallConfig) string {
return fmt.Sprintf("https://%s-api.%s:6443", ic.ObjectMeta.Name, ic.BaseDomain)
}