-
Notifications
You must be signed in to change notification settings - Fork 712
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
Add service images widget #2487
Conversation
@fbarl Please review and let me know if you have any questions on how it works. The best way to test is to use |
0cf02aa
to
7dd308f
Compare
Where exactly in the flux ui does it go? AFAIK the flux ui only has link destinations for an entire service, not for service + image. |
@rade It takes you to the |
Ah! But you have underlined "authfe" and "logging" items in your example. Do these go to the container detail panels? Or are they not clickable? (which, IMO, would be visually misleading, since every other underlined item is a link). Also, the blue "New image(s) available" text looks clickable since blue is a very commonly used for links. Like here in github :) |
That might be better - it avoids any confusion as to what is/isn't clickable, and what clicking will actually do. We could perhaps make it smaller, and place it on the same level as the heading (but right-aligned), so as to save precious vertical space and be less disruptive to the overall look and function of the details panel. |
7dd308f
to
375fef8
Compare
Opted for a link instead of a button, since we don't currently use a Button anywhere else. I also changed the 'New Images available' text to green instead of blue. |
On which detail panels is this info displayed? I've looked at the code and can't work it out :( Flux operates on k8s deployments, of which services can be seen as a specialisation. So the info should be shown in both. |
We could even additionally show the info on pods and even containers, when these are part of a deployment. |
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.
Really nice PR and it really paves the path for further integrations I now think will be smoother than I initially thought. :)
I left a few suggestions in the code and would add just one UI comment to them - the spinner seems to overflow the Node Details panel sometimes. You should be able to reproduce it if you keep the viewport height not to big and click around the nodes.
I think that the current View in Deploy
link looks much better than the initial solution with underlined entries.
client/app/scripts/reducers/root.js
Outdated
@@ -84,6 +84,7 @@ export const initialState = makeMap({ | |||
viewport: makeMap(), | |||
websocketClosed: false, | |||
zoomCache: makeMap(), | |||
serviceImages: makeMap({ fetching: false }) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
client/app/scripts/reducers/root.js
Outdated
return state.setIn(['serviceImages', 'errors'], action.errors); | ||
} | ||
|
||
const service = find(action.services, s => s.ID === action.serviceId); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -678,4 +678,33 @@ describe('RootReducer', () => { | |||
constructEdgeId('def456', 'abc123') | |||
]); | |||
}); | |||
it('receives images for a service', () => { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
||
componentDidMount() { | ||
if (this.props.serviceName) { | ||
this.props.getImagesForService(this.props.params.orgId, this.props.serviceName); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
} | ||
|
||
handleServiceClick() { | ||
this.props.router.push(`/flux/${this.props.params.orgId}/services/${encodeURIComponent(this.props.serviceName)}`); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
||
function getNewImages(images, currentId) { | ||
// Assume that the current image is always in the list of all available images. | ||
// Should be a safe assumption... |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
{fetching && <CircularProgress />} | ||
{!fetching && errors && <p>Error: {JSON.stringify(map(errors, 'message'))}</p>} | ||
{!errors && !fetching && !service && 'No service images found'} | ||
{!errors && !fetching && service && |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
||
import { getImagesForService } from '../../actions/app-actions'; | ||
|
||
const topologyWhitelist = ['services']; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@rade, it should be displayed on the bottom of node details of each node in Services topology. The important thing is to test it in combination with https://github.com/weaveworks/service-ui/pull/495 which hasn't been merged yet. I did it by running |
That's what I guessed. My point was that it should at least also be shown in the Deployment topology. |
@fbarl I updated this branch with your feedback, PTAL. I also added the image status widget to the 'deployments' view. |
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 left one more tiny comment, otherwise LGTM.
return ( | ||
<div key={container.Name} className="wrapper"> | ||
<div className="node-details-table-node-label">{container.Name}</div> | ||
<div className="node-details-table-node-label">{statusText}</div> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
94a58b2
to
cccfd50
Compare
cccfd50
to
3ec7cc8
Compare
Implements #2478, depends on https://github.com/weaveworks/service-ui/pull/495
Displays information about the status of images for a given kubernetes service. This is an initial proof-of-concept to use a reference for doing more complex integrations between services.
The link is clickable and will navigate to Flux using the service-ui router that is passed to it via context.
Introduces a
<CloudFeature />
component that changes the context from Scope to service-ui, allowing for components to access any part of the state tree.