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

Fix pod logs dock tab #4738

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Fix pod logs dock tab #4738

merged 1 commit into from
Jan 25, 2022

Conversation

Nokel81
Copy link
Collaborator

@Nokel81 Nokel81 commented Jan 24, 2022

  • Move all dependencies into a transient LogsViewModel

  • Remove dependencies on dockStore, and logTabStore

  • Make all bindings as late as possible, as per mobx rules

Signed-off-by: Sebastian Malton [email protected]

This fixes an integration test regression that is pressent on #4720

@Nokel81 Nokel81 added the bug Something isn't working label Jan 24, 2022
@Nokel81 Nokel81 added this to the 5.4.0 milestone Jan 24, 2022
@Nokel81 Nokel81 requested a review from a team as a code owner January 24, 2022 15:06
@Nokel81 Nokel81 requested review from jweak and jim-docker and removed request for a team January 24, 2022 15:06
- Move all dependencies into a transient LogsViewModel

- Remove dependencies on dockStore.selectedTab

- Make all bindings as late as possible, as per mobx rules

Signed-off-by: Sebastian Malton <[email protected]>
}

/**
* @deprecated This now only returns the empty array
Copy link
Contributor

Choose a reason for hiding this comment

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

either the comment is wrong or you forgot to change the method implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, it is correct because this.logs is a getter above on line 159 which all it does is return [];

import logTabStoreInjectable from "./tab-store.injectable";

const getLogTabDataInjectable = getInjectable({
instantiate: (di) => di.inject(logTabStoreInjectable).getData,
Copy link
Contributor

Choose a reason for hiding this comment

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

So the logTabStore is not directly a dependency but its methods are? (just seeing if I understand)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes that is correct. This is one of the benefits of DI since it makes testing much easier as each of these dependencies can not be overridden individually.

You can observe this in the modified tests for log-resource-selector

@Nokel81 Nokel81 merged commit b3df5b4 into master Jan 25, 2022
@Nokel81 Nokel81 deleted the fix/pod-logs branch January 25, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants