-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore(event-reporter): refactoring, variables grouping, code splitting #351
chore(event-reporter): refactoring, variables grouping, code splitting #351
Conversation
…kingMetadata to pass data between methods
…EntityParentApp to pass data between methods
…Resource to pass data between methods, created new methods to group logic inside getResourceEventPayload
func (s *applicationEventReporter) resolveApplicationVersions(ctx context.Context, a *appv1.Application, logCtx *log.Entry) *apiclient.ApplicationVersions { | ||
syncRevision := utils.GetOperationStateRevision(a) | ||
var applicationVersions *apiclient.ApplicationVersions | ||
if syncRevision != nil { |
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.
lets rid of else condition and make it nicer. also you dont need applicationVersions as variable
) ([]byte, error) { | ||
// no actual or desired state, don't send event | ||
u := &unstructured.Unstructured{} | ||
apiVersion := rr.rs.Version |
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.
create function inside ReportedResource that will build you api version, like rr.rs.GetApiVersion
c42708b
to
5230e16
Compare
Checklist: