Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get active events #3765

Merged
merged 49 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8d63698
Query updated
Maladie Apr 17, 2019
cb3d842
URL for active events added
Maladie Apr 17, 2019
66db316
Dependencies updated
Maladie Apr 17, 2019
82141e4
Dependencies updated
Maladie Apr 17, 2019
17625db
Dependencies updated (again)
Maladie Apr 17, 2019
3a169d2
Necessary comments added
Maladie Apr 17, 2019
49d61e8
Necessary comments added
Maladie Apr 17, 2019
0ba9cd2
go fmt
Maladie Apr 17, 2019
6a06b47
Application chart updated
Maladie Apr 17, 2019
a7a1947
Path changed to PathPrefix
Maladie Apr 17, 2019
c8bab65
Small bug fixed
Maladie Apr 18, 2019
2daf8a0
Added serviceaccount for EventService
Maladie Apr 18, 2019
1f63825
Formatting
Maladie Apr 18, 2019
970f469
Empty slice instead of nil
Maladie Apr 18, 2019
594b370
RBAC to event service tests added
Maladie Apr 19, 2019
7789f4c
Api file added
Maladie Apr 19, 2019
912de0c
Applications added to path
Maladie Apr 19, 2019
9c09c03
Acceptance test for active events added
Maladie Apr 19, 2019
cfc8e39
Merge branch 'master' into get-active-events
Maladie Apr 19, 2019
6119ae9
dep updated
Maladie Apr 19, 2019
7310c2b
Merge remote-tracking branch 'origin/get-active-events' into get-acti…
Maladie Apr 19, 2019
65558e0
dep updated
Maladie Apr 19, 2019
76d9a1b
Role changed to ClusterRole
Maladie Apr 23, 2019
0e4ad5c
Test subscription name fixed
Maladie Apr 23, 2019
7a9f399
Array creation changed to make()
Maladie Apr 23, 2019
2baa44b
Docs for Event service activeevents endpoint
Maladie Apr 24, 2019
4608e7b
Endpoint activeevents changed to events/subscribed
Maladie Apr 24, 2019
003f8cc
Removing duplicated events
Maladie Apr 24, 2019
5fbb72f
Update docs/application-connector/docs/09-03-event-service.md
crabtree Apr 26, 2019
62778e8
Update docs/application-connector/docs/assets/eventsapi.yaml
crabtree Apr 26, 2019
1419168
Update docs/application-connector/docs/09-03-event-service.md
crabtree Apr 26, 2019
2440fd4
Update components/event-service/internal/externalapi/healthcheckhandl…
crabtree Apr 26, 2019
5ba74be
Update components/event-service/docs/api/api.yaml
crabtree Apr 26, 2019
744057b
Merge branch 'master' into get-active-events
Maladie Apr 26, 2019
beac9cf
Test service
Maladie Apr 26, 2019
784a646
Merge remote-tracking branch 'origin/get-active-events' into get-acti…
Maladie Apr 26, 2019
aa1dfa1
Test fixed
Maladie Apr 26, 2019
12bd620
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
b8bb294
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
ccaf375
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
d1ad01f
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
05bdff9
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
cf08cbc
Update docs/application-connector/docs/09-03-event-service.md
May 6, 2019
7642e6f
Unit tests added
Maladie May 6, 2019
c9d8de4
Merge remote-tracking branch 'origin/get-active-events' into get-acti…
Maladie May 6, 2019
7e94063
Unit tests rewritten
Maladie May 7, 2019
f6cab60
Use Subscription getter - require finisheing
Szymongib May 7, 2019
ef947ef
Unnecessary stub removed
Maladie May 7, 2019
6d754a9
Comment fixed
Maladie May 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ spec:
kyma-alerts: {{ .Values.eventService.deployment.labels.alerts }}
release: {{ .Release.Name }}-event-service
spec:
serviceAccountName: {{.Release.Name }}-event-service
containers:
- name: {{ .Release.Name }}-event-service
image: {{ .Values.global.eventServiceImage }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
backend:
serviceName: {{ .Release.Name }}-event-service-external-api
servicePort: 8081
- path: /{{ .Release.Name }}/v1/events/subscribed
backend:
serviceName: {{ .Release.Name }}-event-service-external-api
servicePort: 8081
- path: /{{ .Release.Name }}/v1/metadata
backend:
serviceName: application-registry-external-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,44 @@ subjects:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-application-gateway
name: {{ .Release.Name }}-application-gateway
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{.Release.Name }}-event-service
namespace: {{ .Values.global.namespace }}
labels:
app: {{.Release.Name }}-event-service
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: {{ .Release.Name }}-event-service
labels:
app: {{ .Release.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups: ["*"]
resources: ["namespaces", "subscriptions"]
verbs: ["get", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: {{ .Release.Name }}-event-service
labels:
app: {{ .Release.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: User
name: system:serviceaccount:{{ .Release.Namespace }}:{{ .Release.Name }}-event-service
apiGroup: rbac.authorization.k8s.io
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-event-service
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-event-service-acceptance
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Release.Name }}-event-service-acceptance
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-event-service-acceptance
labels:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups: ["*"]
resources: ["subscriptions"]
verbs: ["create", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-event-service-acceptance
labels:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-event-service-acceptance
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: system:serviceaccount:{{ .Release.Namespace }}:{{ .Release.Name }}-event-service-acceptance
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
serviceAccountName: {{.Release.Name }}-event-service-acceptance
shareProcessNamespace: true
containers:
- name: {{.Release.Name }}-event-service-acceptance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
const (
MetadataURLFormat = "%s/%s/v1/metadata/services"
EventsURLFormat = "%s/%s/v1/events"
EventsInfoURLFormat = "%s/%s/v1/events/subscribed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider not naming it subscribed. As discussed previously with @akgalwas, there could be scenarios where there is no Kyma Subscription but still the event needs to be consumed e.g. for data events which will be consumed by a data event processing framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion with team and PO, we decided to stay with subscribed. It is general term in case of events, not necessarily pointing to Kyma Subscriptions.


RuntimeDefaultCommonName = "*Runtime*"
)
Expand Down Expand Up @@ -54,17 +55,21 @@ func (ext *ContextExtractor) CreateApplicationClientContextService(ctx context.C
func prepareRuntimeURLs(appCtx ApplicationContext, apiHosts ApiURLs) RuntimeURLs {
metadataURL := ""
eventsURL := ""
eventsInfoURL := ""

if apiHosts.MetadataBaseURL != "" {
metadataURL = fmt.Sprintf(MetadataURLFormat, apiHosts.MetadataBaseURL, appCtx.GetApplication())
}

if apiHosts.EventsBaseURL != "" {
eventsURL = fmt.Sprintf(EventsURLFormat, apiHosts.EventsBaseURL, appCtx.GetApplication())
eventsInfoURL = fmt.Sprintf(EventsInfoURLFormat, apiHosts.EventsBaseURL, appCtx.GetApplication())
}

return RuntimeURLs{
MetadataURL: metadataURL,
EventsURL: eventsURL,
MetadataURL: metadataURL,
EventsURL: eventsURL,
EventsInfoURL: eventsInfoURL,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ func Test_ExtractSerializableApplicationContext(t *testing.T) {
expectedApplicationContext := ExtendedApplicationContext{
ApplicationContext: appCtxPayload,
RuntimeURLs: RuntimeURLs{
MetadataURL: metadataBasedURL + "/" + appName + "/v1/metadata/services",
EventsURL: eventsBasedURL + "/" + appName + "/v1/events",
MetadataURL: metadataBasedURL + "/" + appName + "/v1/metadata/services",
EventsURL: eventsBasedURL + "/" + appName + "/v1/events",
EventsInfoURL: eventsBasedURL + "/" + appName + "/v1/events/subscribed",
},
}

Expand Down
5 changes: 3 additions & 2 deletions components/connector-service/internal/clientcontext/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ type ContextExtender interface {
}

type RuntimeURLs struct {
EventsURL string `json:"eventsUrl"`
MetadataURL string `json:"metadataUrl"`
EventsInfoURL string `json:"eventsInfoUrl"`
EventsURL string `json:"eventsUrl"`
MetadataURL string `json:"metadataUrl"`
}

type ApiURLs struct {
Expand Down
Loading