forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.go
24 lines (19 loc) · 834 Bytes
/
register.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
package pipeline
import (
"context"
"github.com/rancher/rancher/pkg/controllers/user/pipeline/controller/clusterpipeline"
"github.com/rancher/rancher/pkg/controllers/user/pipeline/controller/pipeline"
"github.com/rancher/rancher/pkg/controllers/user/pipeline/controller/pipelineexecution"
"github.com/rancher/rancher/pkg/controllers/user/pipeline/utils"
"github.com/rancher/types/config"
"github.com/sirupsen/logrus"
)
func Register(ctx context.Context, cluster *config.UserContext) {
clusterPipelines := cluster.Management.Management.ClusterPipelines("")
if err := utils.InitClusterPipeline(clusterPipelines, cluster.ClusterName); err != nil {
logrus.Errorf("init cluster pipeline got error, %v", err)
}
clusterpipeline.Register(cluster)
pipeline.Register(ctx, cluster)
pipelineexecution.Register(ctx, cluster)
}