-
Notifications
You must be signed in to change notification settings - Fork 738
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
feat: eventsource service metadata #3257
feat: eventsource service metadata #3257
Conversation
3dc3fd5
to
44d940c
Compare
i am not sure why kafka E2E fails, since the code changes shouldn't affect it at all. if someone has a clue of why this would happen, I'm open to suggestions |
controllers/eventsource/resource.go
Outdated
@@ -397,6 +398,8 @@ func buildService(args *AdaptorArgs) (*corev1.Service, error) { | |||
Selector: args.Labels, | |||
}, | |||
} | |||
svc.ObjectMeta.SetAnnotations(args.EventSource.Spec.Service.Metadata.Annotations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an empty dict by default, using kubebuilder comments, I will add a comment in the function denoting that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an if statement because there is a change that the yaml will be nil explicitly
controllers/eventsource/resource.go
Outdated
@@ -397,6 +398,8 @@ func buildService(args *AdaptorArgs) (*corev1.Service, error) { | |||
Selector: args.Labels, | |||
}, | |||
} | |||
svc.ObjectMeta.SetAnnotations(args.EventSource.Spec.Service.Metadata.Annotations) | |||
svc.ObjectMeta.SetLabels(args.EventSource.Spec.Service.Metadata.Labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an empty dict by default, using kubebuilder comments, I will add a comment in the function denoting that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an if statement because there is a change that the yaml will be nil explicitly
08efc9b
to
7e2be6b
Compare
i added a 3 second sleep in the e2e test, since the test was inconsistent with Kafka, even though the changes are completely irrelevant |
controllers/eventsource/resource.go
Outdated
|
||
if args.EventSource.Spec.Service.Metadata != nil { | ||
if args.EventSource.Spec.Service.Metadata.Labels != nil { | ||
svc.ObjectMeta.SetLabels(args.EventSource.Spec.Service.Metadata.Labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of SetLabels
and SetAnnotations
, can we do for loops and copy the labels and annotations over? Set
means original labels and annotations will be replaced.
3ee7f4d
to
046b481
Compare
Signed-off-by: Omer Aplatony <omerap12@gmail.com> Signed-off-by: MenD32 <amit@jounce.io>
…rgoproj#3211) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: MenD32 <amit@jounce.io>
…rgoproj#3212) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: MenD32 <amit@jounce.io>
…goproj#3213) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
e06fc6e
to
ef78747
Compare
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
controllers/eventsource/resource.go
Outdated
labels = mergeLabels(args.EventSource.Spec.Service.Metadata.Labels, labels) | ||
} | ||
if args.EventSource.Spec.Service.Metadata.Annotations != nil { | ||
annotations = mergeLabels(args.EventSource.Spec.Service.Metadata.Annotations, annotations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function mergeLabels
is weird, but we can refactor it later.
@MenD32 - can you resolve the conflict? |
Yeah |
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
Signed-off-by: MenD32 <amit@jounce.io>
test/e2e/functional_test.go
Outdated
@@ -189,6 +189,8 @@ func (s *FunctionalSuite) TestMetricsWithWebhook() { | |||
Contains("argo_events_event_processing_duration_milliseconds"). | |||
Contains("argo_events_events_processing_failed_total") | |||
|
|||
time.Sleep(3 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had some weird behavior with the kafka e2e test, and for some reason it helped, but i can remove it.
api/event-source.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this file any more.
api/event-source.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this file.
Signed-off-by: MenD32 <amit@jounce.io>
@MenD32 - unfortunately you have to resolve the conflicts again, sorry for the inconvenience. |
Signed-off-by: MenD32 <amit@jounce.io>
@MenD32 why would you want to allow custom configuration of labels and annotations on a Service? |
Interactions with other controllers F.e. backendconfig in gke |
Checklist:
added apicommon.Metadata as a field to the Service in EventSourceSpec, to allow custom configuration of labels and annotations.
inspired by issue #3242