@@ -20,12 +20,12 @@ import (
20
20
"os"
21
21
"time"
22
22
23
- "github.com/codefresh-io/cli-v2/pkg/cdUtils"
24
- "github.com/codefresh-io/cli-v2/pkg/eventUtils"
25
23
"github.com/codefresh-io/cli-v2/pkg/log"
26
24
"github.com/codefresh-io/cli-v2/pkg/runtime"
27
25
"github.com/codefresh-io/cli-v2/pkg/store"
28
26
"github.com/codefresh-io/cli-v2/pkg/util"
27
+ cdutil "github.com/codefresh-io/cli-v2/pkg/util/cd"
28
+ eventsutil "github.com/codefresh-io/cli-v2/pkg/util/events"
29
29
30
30
"github.com/Masterminds/semver/v3"
31
31
appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
@@ -523,8 +523,8 @@ func updateProject(repofs fs.FS, runtimeName string) error {
523
523
project .ObjectMeta .Labels = make (map [string ]string )
524
524
}
525
525
526
- appset .Spec .Template .Labels [store .Get ().LabelKeyCFType ] = "component"
527
- project .ObjectMeta .Labels [store .Get ().LabelKeyCFType ] = "runtime"
526
+ appset .Spec .Template .Labels [store .Get ().LabelKeyCFType ] = store . Get (). CFComponentType
527
+ project .ObjectMeta .Labels [store .Get ().LabelKeyCFType ] = store . Get (). CFRuntimeType
528
528
return repofs .WriteYamls (projPath , project , appset )
529
529
}
530
530
@@ -611,18 +611,18 @@ func createRBAC(repofs fs.FS, path, runtimeName string) error {
611
611
}
612
612
613
613
func createEventSource (repofs fs.FS , path , namespace string ) error {
614
- eventSource := eventUtils .CreateEventSource (& eventUtils .CreateEventSourceOptions {
614
+ eventSource := eventsutil .CreateEventSource (& eventsutil .CreateEventSourceOptions {
615
615
Name : store .Get ().ComponentsReporterName ,
616
616
Namespace : namespace ,
617
617
ServiceAccountName : store .Get ().ComponentsReporterSA ,
618
618
EventBusName : store .Get ().EventBusName ,
619
- Resource : map [string ]eventUtils .CreateResourceEventSourceOptions {
619
+ Resource : map [string ]eventsutil .CreateResourceEventSourceOptions {
620
620
"components" : {
621
621
Group : "argoproj.io" ,
622
622
Version : "v1alpha1" ,
623
623
Resource : "applications" ,
624
624
Namespace : namespace ,
625
- Selectors : []eventUtils .CreateSelectorOptions {
625
+ Selectors : []eventsutil .CreateSelectorOptions {
626
626
{
627
627
Key : store .Get ().LabelKeyCFType ,
628
628
Operation : "==" ,
@@ -635,7 +635,7 @@ func createEventSource(repofs fs.FS, path, namespace string) error {
635
635
Version : "v1alpha1" ,
636
636
Resource : "appprojects" ,
637
637
Namespace : namespace ,
638
- Selectors : []eventUtils .CreateSelectorOptions {
638
+ Selectors : []eventsutil .CreateSelectorOptions {
639
639
{
640
640
Key : store .Get ().LabelKeyCFType ,
641
641
Operation : "==" ,
@@ -649,7 +649,7 @@ func createEventSource(repofs fs.FS, path, namespace string) error {
649
649
}
650
650
651
651
func createSensor (repofs fs.FS , name , path , namespace , eventSourceName string ) error {
652
- sensor := eventUtils .CreateSensor (& eventUtils .CreateSensorOptions {
652
+ sensor := eventsutil .CreateSensor (& eventsutil .CreateSensorOptions {
653
653
Name : name ,
654
654
Namespace : namespace ,
655
655
EventSourceName : eventSourceName ,
@@ -716,19 +716,19 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
716
716
resPath := insFs .Join (apstore .Default .AppsDir , gsName , runtimeName , "resources" )
717
717
eventSourceName := gsName + "-event-source"
718
718
gsSyncName := gsName + "-synchronize"
719
- selectors := []eventUtils .CreateSelectorOptions {
719
+ selectors := []eventsutil .CreateSelectorOptions {
720
720
{
721
721
Key : "app.kubernetes.io/instance" ,
722
722
Operation : "==" ,
723
723
Value : gsSyncName ,
724
724
},
725
725
}
726
- eventSource := eventUtils .CreateEventSource (& eventUtils .CreateEventSourceOptions {
726
+ eventSource := eventsutil .CreateEventSource (& eventsutil .CreateEventSourceOptions {
727
727
Name : eventSourceName ,
728
728
Namespace : runtimeName ,
729
729
ServiceAccountName : store .Get ().ComponentsReporterSA ,
730
730
EventBusName : store .Get ().EventBusName ,
731
- Resource : map [string ]eventUtils .CreateResourceEventSourceOptions {
731
+ Resource : map [string ]eventsutil .CreateResourceEventSourceOptions {
732
732
// "clusterWorkflowTemplate": {
733
733
// Group: "argoproj.io",
734
734
// Version: "v1alpha1",
@@ -805,7 +805,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
805
805
return err
806
806
}
807
807
808
- sensor := eventUtils .CreateSensor (& eventUtils .CreateSensorOptions {
808
+ sensor := eventsutil .CreateSensor (& eventsutil .CreateSensorOptions {
809
809
Name : gsName + "-sensor" ,
810
810
Namespace : runtimeName ,
811
811
EventSourceName : eventSourceName ,
@@ -829,7 +829,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
829
829
830
830
gsPath := gsCloneOpts .FS .Join (apstore .Default .AppsDir , gsName , runtimeName )
831
831
fullGsPath := gsCloneOpts .FS .Join (gsCloneOpts .FS .Root (), gsPath )[1 :]
832
- syncApp := cdUtils .CreateApp (& cdUtils .CreateAppOptions {
832
+ syncApp := cdutil .CreateApp (& cdutil .CreateAppOptions {
833
833
Name : gsSyncName ,
834
834
Namespace : runtimeName ,
835
835
Project : runtimeName ,
0 commit comments