Skip to content

Commit 8290bc1

Browse files
Fix runtime (#11)
* change to Autorization * fix runtime install * bump
1 parent 625f9d5 commit 8290bc1

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.14
1+
VERSION=v0.0.15
22
OUT_DIR=dist
33
YEAR?=$(shell date +"%Y")
44

cmd/commands/runtime.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,12 @@ func updateProject(repofs fs.FS, runtimeName string) error {
229229
if appset.Spec.Template.Labels == nil {
230230
appset.Spec.Template.Labels = make(map[string]string)
231231
}
232+
if appset.Labels == nil {
233+
appset.Labels = make(map[string]string)
234+
}
232235

233-
appset.Spec.Template.Labels[store.Get().CFComponentKey] = "{{ appName }}"
236+
appset.Spec.Template.Labels[store.Get().CFType] = store.Get().CFComponentType
237+
appset.Labels[store.Get().CFType] = store.Get().CFRuntimeType
234238
return repofs.WriteYamls(projPath, project, appset)
235239
}
236240

@@ -356,9 +360,9 @@ func createEventSource(repofs fs.FS, path, runtimeName string) error {
356360
AfterStart: false,
357361
Labels: []eventsourcev1alpha1.Selector{
358362
{
359-
Key: store.Get().CFComponentKey,
360-
Operation: "!=",
361-
Value: "",
363+
Key: store.Get().CFType,
364+
Operation: "==",
365+
Value: store.Get().CFComponentType,
362366
},
363367
},
364368
},
@@ -376,12 +380,12 @@ func createEventSource(repofs fs.FS, path, runtimeName string) error {
376380
},
377381
Namespace: runtimeName,
378382
Filter: &eventsourcev1alpha1.ResourceFilter{
379-
AfterStart: true,
383+
AfterStart: false,
380384
Labels: []eventsourcev1alpha1.Selector{
381385
{
382-
Key: store.Get().CFComponentKey,
383-
Operation: "!=",
384-
Value: "",
386+
Key: store.Get().CFType,
387+
Operation: "==",
388+
Value: store.Get().CFRuntimeType,
385389
},
386390
},
387391
},
@@ -430,7 +434,7 @@ func createSensor(repofs fs.FS, path, namespace string) error {
430434
},
431435
SecureHeaders: []*apicommon.SecureHeader{
432436
{
433-
Name: "Autorization",
437+
Name: "Authorization",
434438
ValueFrom: &apicommon.ValueFromSource{
435439
SecretKeyRef: &v1.SecretKeySelector{
436440
LocalObjectReference: v1.LocalObjectReference{
@@ -471,7 +475,7 @@ func createSensor(repofs fs.FS, path, namespace string) error {
471475
},
472476
SecureHeaders: []*apicommon.SecureHeader{
473477
{
474-
Name: "Autorization",
478+
Name: "Authorization",
475479
ValueFrom: &apicommon.ValueFromSource{
476480
SecretKeyRef: &v1.SecretKeySelector{
477481
LocalObjectReference: v1.LocalObjectReference{

pkg/store/store.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ type Store struct {
5151
ArgoWorkflowsManifestsURL string
5252
CFTokenSecret string
5353
CFTokenSecretKey string
54-
CFComponentKey string
54+
CFType string
5555
EventReportingEndpoint string
5656
EventBusName string
5757
ComponentsReporterName string
5858
ComponentsReporterSA string
59+
CFComponentType string
60+
CFRuntimeType string
5961
}
6062

6163
// Get returns the global store
@@ -72,11 +74,13 @@ func init() {
7274
s.ArgoWorkflowsManifestsURL = ArgoWorkflowsManifestsURL
7375
s.CFTokenSecret = "codefresh-token"
7476
s.CFTokenSecretKey = "token"
75-
s.CFComponentKey = "codefresh.io/component"
77+
s.CFType = "codefresh.io/type"
7678
s.EventReportingEndpoint = "/argo/api/events"
7779
s.EventBusName = "codefresh-eventbus"
7880
s.ComponentsReporterName = "components-reporter"
7981
s.ComponentsReporterSA = "components-reporter-sa"
82+
s.CFComponentType = "component"
83+
s.CFRuntimeType = "runtime"
8084
initVersion()
8185
}
8286

0 commit comments

Comments
 (0)