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

Show k8s labels and container env vars in the details panel. #1342

Merged
merged 3 commits into from
Apr 20, 2016

Conversation

tomwilkie
Copy link
Contributor

Make the whole docker labels logic generic & template based, allowing the probe to create arbitrary tables in the details panel based on the key prefixes.

Fixes #1207, Fixes #528

@tomwilkie
Copy link
Contributor Author

@davkal would you mind taking a look at the UI? It doesn't seem to truncate these tables and show and +14 type expander:

screen shot 2016-04-19 at 10 57 20

@tomwilkie tomwilkie added the k8s Pertains to integration with Kubernetes label Apr 19, 2016
@tomwilkie tomwilkie force-pushed the k8s-labels branch 2 times, most recently from d13e723 to 99e12c2 Compare April 19, 2016 12:21
@paulbellamy
Copy link
Contributor

LGTM but I'd imagine @davkal will want to refactor the js into a Table component, inherited by NodeDetails/etc...

@tomwilkie
Copy link
Contributor Author

tomwilkie commented Apr 19, 2016

Lets wait for an LGTM from @davkal

screen shot 2016-04-19 at 14 33 04

@tomwilkie
Copy link
Contributor Author

Report for testing:
report.json.zip

@davkal
Copy link
Contributor

davkal commented Apr 19, 2016

  • truncation worked
  • react key was in the wrong place
  • empty tables render section labels

Last two items are solved by

diff --git a/client/app/scripts/components/node-details.js b/client/app/scripts/components/node-details.js
index b7c2ced..bf8cd15 100644
--- a/client/app/scripts/components/node-details.js
+++ b/client/app/scripts/components/node-details.js
@@ -191,11 +191,17 @@ export default class NodeDetails extends React.Component {
             </div>
           )}

-          {details.tables && details.tables.length > 0
-            && details.tables.map(table => (<div className="node-details-content-section">
-            <div className="node-details-content-section-header">{table.label}</div>
-            <NodeDetailsLabels rows={table.rows} key={table.id} />
-          </div>))}
+          {details.tables && details.tables.length > 0 && details.tables.map(table => {
+            if (table.rows.length > 0) {
+              return (
+                <div className="node-details-content-section" key={table.id}>
+                  <div className="node-details-content-section-header">{table.label}</div>
+                  <NodeDetailsLabels rows={table.rows} />
+                </div>
+              );
+            }
+            return null;
+          })}
         </div>
       </div>
     );

@tomwilkie tomwilkie merged commit 9eda278 into master Apr 20, 2016
@tomwilkie tomwilkie deleted the k8s-labels branch April 20, 2016 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k8s Pertains to integration with Kubernetes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's a shame every node has DockerLabels Expose Kubernetes namespaces and labels
3 participants