@@ -20,12 +20,12 @@ import (
2020 "os"
2121 "time"
2222
23- "github.com/codefresh-io/cli-v2/pkg/cdUtils"
24- "github.com/codefresh-io/cli-v2/pkg/eventUtils"
2523 "github.com/codefresh-io/cli-v2/pkg/log"
2624 "github.com/codefresh-io/cli-v2/pkg/runtime"
2725 "github.com/codefresh-io/cli-v2/pkg/store"
2826 "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"
2929
3030 "github.com/Masterminds/semver/v3"
3131 appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
@@ -523,8 +523,8 @@ func updateProject(repofs fs.FS, runtimeName string) error {
523523 project .ObjectMeta .Labels = make (map [string ]string )
524524 }
525525
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
528528 return repofs .WriteYamls (projPath , project , appset )
529529}
530530
@@ -611,18 +611,18 @@ func createRBAC(repofs fs.FS, path, runtimeName string) error {
611611}
612612
613613func createEventSource (repofs fs.FS , path , namespace string ) error {
614- eventSource := eventUtils .CreateEventSource (& eventUtils .CreateEventSourceOptions {
614+ eventSource := eventsutil .CreateEventSource (& eventsutil .CreateEventSourceOptions {
615615 Name : store .Get ().ComponentsReporterName ,
616616 Namespace : namespace ,
617617 ServiceAccountName : store .Get ().ComponentsReporterSA ,
618618 EventBusName : store .Get ().EventBusName ,
619- Resource : map [string ]eventUtils .CreateResourceEventSourceOptions {
619+ Resource : map [string ]eventsutil .CreateResourceEventSourceOptions {
620620 "components" : {
621621 Group : "argoproj.io" ,
622622 Version : "v1alpha1" ,
623623 Resource : "applications" ,
624624 Namespace : namespace ,
625- Selectors : []eventUtils .CreateSelectorOptions {
625+ Selectors : []eventsutil .CreateSelectorOptions {
626626 {
627627 Key : store .Get ().LabelKeyCFType ,
628628 Operation : "==" ,
@@ -635,7 +635,7 @@ func createEventSource(repofs fs.FS, path, namespace string) error {
635635 Version : "v1alpha1" ,
636636 Resource : "appprojects" ,
637637 Namespace : namespace ,
638- Selectors : []eventUtils .CreateSelectorOptions {
638+ Selectors : []eventsutil .CreateSelectorOptions {
639639 {
640640 Key : store .Get ().LabelKeyCFType ,
641641 Operation : "==" ,
@@ -649,7 +649,7 @@ func createEventSource(repofs fs.FS, path, namespace string) error {
649649}
650650
651651func createSensor (repofs fs.FS , name , path , namespace , eventSourceName string ) error {
652- sensor := eventUtils .CreateSensor (& eventUtils .CreateSensorOptions {
652+ sensor := eventsutil .CreateSensor (& eventsutil .CreateSensorOptions {
653653 Name : name ,
654654 Namespace : namespace ,
655655 EventSourceName : eventSourceName ,
@@ -716,19 +716,19 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
716716 resPath := insFs .Join (apstore .Default .AppsDir , gsName , runtimeName , "resources" )
717717 eventSourceName := gsName + "-event-source"
718718 gsSyncName := gsName + "-synchronize"
719- selectors := []eventUtils .CreateSelectorOptions {
719+ selectors := []eventsutil .CreateSelectorOptions {
720720 {
721721 Key : "app.kubernetes.io/instance" ,
722722 Operation : "==" ,
723723 Value : gsSyncName ,
724724 },
725725 }
726- eventSource := eventUtils .CreateEventSource (& eventUtils .CreateEventSourceOptions {
726+ eventSource := eventsutil .CreateEventSource (& eventsutil .CreateEventSourceOptions {
727727 Name : eventSourceName ,
728728 Namespace : runtimeName ,
729729 ServiceAccountName : store .Get ().ComponentsReporterSA ,
730730 EventBusName : store .Get ().EventBusName ,
731- Resource : map [string ]eventUtils .CreateResourceEventSourceOptions {
731+ Resource : map [string ]eventsutil .CreateResourceEventSourceOptions {
732732 // "clusterWorkflowTemplate": {
733733 // Group: "argoproj.io",
734734 // Version: "v1alpha1",
@@ -805,7 +805,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
805805 return err
806806 }
807807
808- sensor := eventUtils .CreateSensor (& eventUtils .CreateSensorOptions {
808+ sensor := eventsutil .CreateSensor (& eventsutil .CreateSensorOptions {
809809 Name : gsName + "-sensor" ,
810810 Namespace : runtimeName ,
811811 EventSourceName : eventSourceName ,
@@ -829,7 +829,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon
829829
830830 gsPath := gsCloneOpts .FS .Join (apstore .Default .AppsDir , gsName , runtimeName )
831831 fullGsPath := gsCloneOpts .FS .Join (gsCloneOpts .FS .Root (), gsPath )[1 :]
832- syncApp := cdUtils .CreateApp (& cdUtils .CreateAppOptions {
832+ syncApp := cdutil .CreateApp (& cdutil .CreateAppOptions {
833833 Name : gsSyncName ,
834834 Namespace : runtimeName ,
835835 Project : runtimeName ,
0 commit comments