-
Notifications
You must be signed in to change notification settings - Fork 787
/
applications.go
27 lines (23 loc) · 948 Bytes
/
applications.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
package prow
import (
v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1"
"github.com/jenkins-x/jx-logging/pkg/log"
"github.com/jenkins-x/jx/v2/pkg/util"
"github.com/pkg/errors"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
// AddDummyApplication creates the dummy prow jenkins app
func AddDummyApplication(client kubernetes.Interface, devNamespace string, settings *v1.TeamSettings) error {
var err error
log.Logger().Infof("Setting up prow config into namespace %s", util.ColorInfo(devNamespace))
// create initial configmaps if they don't already exist, use a dummy repo so tide doesn't start scanning all github
_, err = client.CoreV1().ConfigMaps(devNamespace).Get("config", v12.GetOptions{})
if err != nil {
err = AddApplication(client, []string{"jenkins-x/dummy"}, devNamespace, "base", settings)
if err != nil {
return errors.Wrap(err, "adding dummy application")
}
}
return nil
}