提交 bcdab838 编写于 作者: M Marcin Maciaszczyk 提交者: Rob Franken

Add conditions to details pages (#1449)

* Extract conditions component

* Add conditions component for pod details view

* Unify backend condition structures for pods and nodes

* Fix typos

* Fix double header issue

* gofmt files

* Generate translations
上级 a1ac1f7f
......@@ -66,6 +66,19 @@
<translation id="1417978160910275828" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_ANNOTATIONS_1" desc="Text on the button to show fewer annotations">show fewer annotations</translation>
<translation id="6884163988875905686" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_ANNOTATIONS_2" desc="Text on the button to show all the annotations">show all annotations</translation>
<translation id="6935188165410090417" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_LASTAPPLIEDCONFIGURATION_0" desc="Label for the kubectl.kubernetes.io/last-applied-configuration annotation">last applied configuration</translation>
<translation id="6456481460873145449" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_0" desc="Label \'Conditions\' for the conditions section.">Conditions</translation>
<translation id="8993677465322195935" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_1" desc="Label \'Type\' for the condition table header.">Type</translation>
<translation id="286975103376271553" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_10" desc="Label when there is no data.">-</translation>
<translation id="3386572067498503433" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_11" desc="Label when there is no data.">-</translation>
<translation id="6464751813964841186" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_12" desc="Label when there is no data.">-</translation>
<translation id="3102698318305254308" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_2" desc="Label \'Status\' for the condition table header.">Status</translation>
<translation id="3198492785716828854" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_3" desc="Label \'Last heartbeat time\' for the condition table header.">Last heartbeat time</translation>
<translation id="3828327508280797097" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_4" desc="Label \'Last transition time\' for the condition table header.">Last transition time</translation>
<translation id="5617747719771691362" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_5" desc="Label \'Reason\' for the condition table header.">Reason</translation>
<translation id="3635038721825489232" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_6" desc="Label \'Message\' for the condition table header.">Message</translation>
<translation id="4637603666933267922" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_7" desc="Label when there is no data.">-</translation>
<translation id="8716449963013807367" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_8" desc="Label when there is no data.">-</translation>
<translation id="3496419655731709621" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_9" desc="Label when there is no data.">-</translation>
<translation id="2631421290135072028" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_0" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show less labels</translation>
<translation id="3570731037158883626" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_0" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show fewer labels</translation>
<translation id="8950559770902715649" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_1" desc="Tooltip on the &quot;show all&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show all labels</translation>
......@@ -606,6 +619,7 @@
<translation id="2098640878944079437" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_2" desc="Label \'Memory requests (bytes)\' for the allocated resources table header on the node details page.">Memory requests (bytes)</translation>
<translation id="3673841583478758858" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_3" desc="Label \'Memory limits (bytes)\' for the allocated resources table header on the node details page.">Memory limits (bytes)</translation>
<translation id="5151958604373828629" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_4" desc="Label \'Pods\' for the allocated resources table header on the node details page.">Pods</translation>
<translation id="330471964041910704" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_5" desc="Label \'Allocated resources\' for the allocated resources section.">Allocated resources</translation>
<translation id="5267711044387124403" key="MSG_NODEDETAIL_NODECONDITIONS_0" desc="Label \'Type\' for the condition table header on the node details page.">Type</translation>
<translation id="5870959377244624248" key="MSG_NODEDETAIL_NODECONDITIONS_1" desc="Label \'Status\' for the condition table header on the node details page.">Status</translation>
<translation id="7420515051262677922" key="MSG_NODEDETAIL_NODECONDITIONS_2" desc="Label \'Last heartbeat time\' for the condition table header on the node details page.">Last heartbeat time</translation>
......
......@@ -70,6 +70,19 @@
<translation id="1417978160910275828" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_ANNOTATIONS_1" desc="Text on the button to show fewer annotations">show fewer annotations</translation>
<translation id="6884163988875905686" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_ANNOTATIONS_2" desc="Text on the button to show all the annotations">show all annotations</translation>
<translation id="6935188165410090417" key="MSG_COMMON_COMPONENTS_ANNOTATIONS_LASTAPPLIEDCONFIGURATION_0" desc="Label for the kubectl.kubernetes.io/last-applied-configuration annotation">last applied configuration</translation>
<translation id="6456481460873145449" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_0" desc="Label \'Conditions\' for the conditions section.">Conditions</translation>
<translation id="8993677465322195935" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_1" desc="Label \'Type\' for the condition table header.">Type</translation>
<translation id="286975103376271553" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_10" desc="Label when there is no data.">-</translation>
<translation id="3386572067498503433" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_11" desc="Label when there is no data.">-</translation>
<translation id="6464751813964841186" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_12" desc="Label when there is no data.">-</translation>
<translation id="3102698318305254308" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_2" desc="Label \'Status\' for the condition table header.">Status</translation>
<translation id="3198492785716828854" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_3" desc="Label \'Last heartbeat time\' for the condition table header.">Last heartbeat time</translation>
<translation id="3828327508280797097" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_4" desc="Label \'Last transition time\' for the condition table header.">Last transition time</translation>
<translation id="5617747719771691362" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_5" desc="Label \'Reason\' for the condition table header.">Reason</translation>
<translation id="3635038721825489232" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_6" desc="Label \'Message\' for the condition table header.">Message</translation>
<translation id="4637603666933267922" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_7" desc="Label when there is no data.">-</translation>
<translation id="8716449963013807367" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_8" desc="Label when there is no data.">-</translation>
<translation id="3496419655731709621" key="MSG_COMMON_COMPONENTS_CONDITIONS_CONDITIONSLIST_9" desc="Label when there is no data.">-</translation>
<translation id="2631421290135072028" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_0" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show less labels</translation>
<translation id="3570731037158883626" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_0" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show fewer labels</translation>
<translation id="8950559770902715649" key="MSG_COMMON_COMPONENTS_LABELS_LABELS_1" desc="Tooltip on the &quot;show all&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show all labels</translation>
......@@ -636,6 +649,7 @@
<translation id="2098640878944079437" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_2" desc="Label \'Memory requests (bytes)\' for the allocated resources table header on the node details page.">Memory requests (bytes)</translation>
<translation id="3673841583478758858" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_3" desc="Label \'Memory limits (bytes)\' for the allocated resources table header on the node details page.">Memory limits (bytes)</translation>
<translation id="5151958604373828629" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_4" desc="Label \'Pods\' for the allocated resources table header on the node details page.">Pods</translation>
<translation id="330471964041910704" key="MSG_NODEDETAIL_NODEALLOCATEDRESOURCES_5" desc="Label \'Allocated resources\' for the allocated resources section.">Allocated resources</translation>
<translation id="5267711044387124403" key="MSG_NODEDETAIL_NODECONDITIONS_0" desc="Label \'Type\' for the condition table header on the node details page.">Type</translation>
<translation id="5870959377244624248" key="MSG_NODEDETAIL_NODECONDITIONS_1" desc="Label \'Status\' for the condition table header on the node details page.">Status</translation>
<translation id="7420515051262677922" key="MSG_NODEDETAIL_NODECONDITIONS_2" desc="Label \'Last heartbeat time\' for the condition table header on the node details page.">Last heartbeat time</translation>
......
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package common
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
)
// Condition represents a single condition of a pod or node.
type Condition struct {
// Type of a condition.
Type string `json:"type"`
// Status of a condition.
Status api.ConditionStatus `json:"status"`
// Last probe time of a condition.
LastProbeTime unversioned.Time `json:"lastProbeTime"`
// Last transition time of a condition.
LastTransitionTime unversioned.Time `json:"lastTransitionTime"`
// Reason of a condition.
Reason string `json:"reason"`
// Message of a condition.
Message string `json:"message"`
}
......@@ -73,3 +73,18 @@ func fromCells(cells []dataselect.DataCell) []api.Node {
}
return std
}
func getNodeConditions(pod api.Node) []common.Condition {
var conditions []common.Condition
for _, condition := range pod.Status.Conditions {
conditions = append(conditions, common.Condition{
Type: string(condition.Type),
Status: condition.Status,
LastProbeTime: condition.LastHeartbeatTime,
LastTransitionTime: condition.LastTransitionTime,
Reason: condition.Reason,
Message: condition.Message,
})
}
return conditions
}
......@@ -98,7 +98,7 @@ type NodeDetail struct {
NodeInfo api.NodeSystemInfo `json:"nodeInfo"`
// Conditions is an array of current node conditions.
Conditions []api.NodeCondition `json:"conditions"`
Conditions []common.Condition `json:"conditions"`
// Container images of the node.
ContainerImages []string `json:"containerImages"`
......@@ -248,7 +248,7 @@ func toNodeDetail(node api.Node, pods *pod.PodList, eventList *common.EventList,
PodCIDR: node.Spec.PodCIDR,
Unschedulable: node.Spec.Unschedulable,
NodeInfo: node.Status.NodeInfo,
Conditions: node.Status.Conditions,
Conditions: getNodeConditions(node),
ContainerImages: getContainerImages(node),
PodList: *pods,
EventList: *eventList,
......
......@@ -111,3 +111,18 @@ func fromCells(cells []dataselect.DataCell) []api.Pod {
}
return std
}
func getPodConditions(pod api.Pod) []common.Condition {
var conditions []common.Condition
for _, condition := range pod.Status.Conditions {
conditions = append(conditions, common.Condition{
Type: string(condition.Type),
Status: condition.Status,
LastProbeTime: condition.LastProbeTime,
LastTransitionTime: condition.LastTransitionTime,
Reason: condition.Reason,
Message: condition.Message,
})
}
return conditions
}
......@@ -62,6 +62,9 @@ type PodDetail struct {
// Metrics collected for this resource
Metrics []metric.Metric `json:"metrics"`
// Conditions of this pod.
Conditions []common.Condition `json:"conditions"`
}
// Creator is a view of the creator of a given pod, in List for for ease of use
......@@ -303,6 +306,7 @@ func toPodDetail(pod *api.Pod, metrics []metric.Metric, configMaps *api.ConfigMa
Controller: controller,
Containers: containers,
Metrics: metrics,
Conditions: getPodConditions(*pod),
}
return podDetail
......
......@@ -59,13 +59,12 @@ func isHiddenType(secretType api.SecretType) bool {
return secretType == api.SecretTypeBasicAuth || secretType == api.SecretTypeOpaque
}
func getSecretDetail(rawSecret *api.Secret) *SecretDetail {
return &SecretDetail{
ObjectMeta: common.NewObjectMeta(rawSecret.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
Data: rawSecret.Data,
ObjectMeta: common.NewObjectMeta(rawSecret.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
Data: rawSecret.Data,
IsHiddenType: isHiddenType(rawSecret.Type),
Type: rawSecret.Type,
Type: rawSecret.Type,
}
}
......@@ -708,6 +708,25 @@ backendApi.ContainerStateTerminated;
*/
backendApi.ContainerState;
/**
* @typedef {{
* type: string,
* status: string,
* lastProbeTime: ?string,
* lastTransitionTime: ?string,
* reason: string,
* message: string
* }}
*/
backendApi.Condition;
/**
* @typedef {{
* nodes: !Array<!backendApi.Condition>
* }}
*/
backendApi.ConditionList;
/**
* @typedef {{
* podPhase: string,
......@@ -737,7 +756,8 @@ backendApi.Pod;
* podIP: string,
* nodeName: string,
* restartCount: number,
* metrics: backendApi.PodMetrics
* metrics: backendApi.PodMetrics,
* conditions: !backendApi.ConditionList
* }}
*/
backendApi.PodDetail;
......@@ -1050,25 +1070,6 @@ backendApi.Node;
*/
backendApi.NodeInfo;
/**
* @typedef {{
* type: string,
* status: string,
* lastHeartbeatTime: ?string,
* lastTransitionTime: ?string,
* reason: string,
* message: string
* }}
*/
backendApi.NodeCondition;
/**
* @typedef {{
* nodes: !Array<!backendApi.NodeCondition>
* }}
*/
backendApi.NodeConditionList;
/**
* @typedef {{
* cpuRequests: number,
......@@ -1098,7 +1099,7 @@ backendApi.NodeAllocatedResources;
* providerID: string,
* unschedulable: boolean,
* nodeInfo: !backendApi.NodeInfo,
* conditions: !backendApi.NodeConditionList,
* conditions: !backendApi.ConditionList,
* containerImages: !Array<string>,
* podList: !backendApi.PodList,
* eventList: !backendApi.EventList
......
......@@ -20,6 +20,7 @@ import namespaceModule from './../namespace/namespace_module';
import paginationModule from './../pagination/pagination_module';
import actionbarModule from './actionbar/actionbar_module';
import annotationsModule from './annotations/module';
import conditionsModule from './conditions/conditions_module';
import contentCardModule from './contentcard/contentcard_module';
import endpointModule from './endpoint/endpoint_module';
import graphModule from './graph/graph_module';
......@@ -56,6 +57,7 @@ export default angular
namespaceModule.name,
stateModule.name,
graphModule.name,
conditionsModule.name,
serializedReferenceModule.name,
annotationsModule.name,
toggleHiddenTextModule.name,
......
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import {conditionListComponent} from './conditionslist_component';
/**
* Module containing common graph components.
*/
export default angular
.module(
'kubernetesDashboard.common.components.conditions',
[
'ngMaterial',
'ui.router',
])
.component('kdConditionList', conditionListComponent);
......@@ -15,45 +15,56 @@ limitations under the License.
-->
<kd-resource-card-list selectable="false" with-statuses="false">
<kd-resource-card-list-header>
[[Conditions|Label 'Conditions' for the conditions section.]]
</kd-resource-card-list-header>
<kd-resource-card-header-columns>
<kd-resource-card-header-column size="small" grow="2">
[[Type|Label 'Type' for the condition table header on the node details page.]]
[[Type|Label 'Type' for the condition table header.]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="1">
[[Status|Label 'Status' for the condition table header on the node details page.]]
[[Status|Label 'Status' for the condition table header.]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="1">
[[Last heartbeat time|Label 'Last heartbeat time' for the condition table header on the node details page.]]
[[Last heartbeat time|Label 'Last heartbeat time' for the condition table header.]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="1">
[[Last transition time|Label 'Last transition time' for the condition table header on the node details page.]]
[[Last transition time|Label 'Last transition time' for the condition table header.]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="medium" grow="2">
[[Reason|Label 'Reason' for the condition table header on the node details page.]]
[[Reason|Label 'Reason' for the condition table header.]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="medium" grow="4">
[[Message|Label 'Message' for the condition table header on the node details page.]]
[[Message|Label 'Message' for the condition table header.]]
</kd-resource-card-header-column>
</kd-resource-card-header-columns>
<kd-resource-card ng-repeat="condition in $ctrl.conditions" omit-meta="true">
<kd-resource-card-columns>
<kd-resource-card-column>
<div>{{condition.type}}</div>
<div ng-if="::condition.type">{{condition.type}}</div>
<div ng-if="::!condition.type">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div>{{condition.status}}</div>
<div ng-if="::condition.status">{{condition.status}}</div>
<div ng-if="::!condition.status">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div>{{condition.lastHeartbeatTime | relativeTime}}</div>
<div ng-if="::condition.lastProbeTime">{{condition.lastProbeTime | relativeTime}}</div>
<div ng-if="::!condition.lastProbeTime">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div>{{condition.lastTransitionTime | relativeTime}}</div>
<div ng-if="::condition.lastTransitionTime">
{{condition.lastTransitionTime | relativeTime}}
</div>
<div ng-if="::!condition.lastTransitionTime">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div>{{condition.reason}}</div>
<div ng-if="::condition.reason">{{condition.reason}}</div>
<div ng-if="::!condition.reason">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div>{{condition.message}}</div>
<div ng-if="::condition.message">{{condition.message}}</div>
<div ng-if="::!condition.message">[[-|Label when there is no data.]]</div>
</kd-resource-card-column>
</kd-resource-card-columns>
</kd-resource-card>
......
......@@ -15,30 +15,30 @@
/**
* @final
*/
export default class NodeConditionsController {
export default class ConditionListController {
/**
* Constructs node conditions object.
* Constructs ConditionListController object.
* @ngInject
*/
constructor() {
/**
* Node conditions. Initialized from the scope.
* @export {!backendApi.NodeConditionList}
* @export {!backendApi.ConditionList}
*/
this.conditions;
}
}
/**
* Definition object for the component that displays node conditions.
* Definition object for the component that displays conditions list.
*
* @return {!angular.Directive}
*/
export const nodeConditionsComponent = {
controller: NodeConditionsController,
templateUrl: 'nodedetail/nodeconditions.html',
export const conditionListComponent = {
controller: ConditionListController,
templateUrl: 'common/components/conditions/conditionslist.html',
bindings: {
/** {!backendApi.NodeConditionList} */
/** {!backendApi.ConditionList} */
'conditions': '=',
},
};
......@@ -15,6 +15,9 @@ limitations under the License.
-->
<kd-resource-card-list selectable="false" with-statuses="false">
<kd-resource-card-list-header>
[[Allocated resources|Label 'Allocated resources' for the allocated resources section.]]
</kd-resource-card-list-header>
<kd-resource-card-header-columns>
<kd-resource-card-header-column size="large">
[[CPU requests (cores)|Label 'CPU requests (cores)' for the allocated resources table header on the node details page.]]
......
......@@ -18,7 +18,6 @@ import filtersModule from 'common/filters/filters_module';
import eventsModule from 'events/events_module';
import {nodeAllocatedResourcesComponent} from './nodeallocatedresources_component';
import {nodeConditionsComponent} from './nodeconditions_component';
import stateConfig from './nodedetail_stateconfig';
import {nodeInfoComponent} from './nodeinfo_component';
......@@ -42,7 +41,6 @@ export default angular
])
.config(stateConfig)
.component('kdNodeAllocatedResources', nodeAllocatedResourcesComponent)
.component('kdNodeConditions', nodeConditionsComponent)
.component('kdNodeInfo', nodeInfoComponent)
.factory('kdNodeEventsResource', nodeEventsResource)
.factory('kdNodePodsResource', nodePodsResource);
......
......@@ -82,15 +82,13 @@ limitations under the License.
</kd-info-card-section>
</kd-info-card>
<kd-content-card>
<kd-title>[[Allocated resources|Label 'Allocated resources' for the allocated resources section on the node details page.]]</kd-title>
<kd-content>
<kd-node-allocated-resources allocated-resources="::$ctrl.node.allocatedResources">
</kd-node-allocated-resources>
</kd-content>
</kd-content-card>
<kd-content-card ng-if="::$ctrl.node.conditions.length">
<kd-title>[[Conditions|Label 'Conditions' for the conditions section on the node details page.]]</kd-title>
<kd-content>
<kd-node-conditions conditions="::$ctrl.node.conditions"></kd-node-conditions>
<kd-condition-list conditions="::$ctrl.node.conditions"></kd-condition-list>
</kd-content>
</kd-content-card>
......@@ -30,4 +30,10 @@ limitations under the License.
namespace="::ctrl.podDetail.objectMeta.namespace" pod-name="::ctrl.podDetail.objectMeta.name">
</kd-container-info>
<kd-content-card ng-if="::ctrl.podDetail.conditions.length">
<kd-content>
<kd-condition-list conditions="::ctrl.podDetail.conditions"></kd-condition-list>
</kd-content>
</kd-content-card>
<kd-creator-info creator="::ctrl.podDetail.controller"></kd-creator-info>
......@@ -36,11 +36,12 @@ func createDaemonSet(name, namespace string, labelSelector map[string]string) ex
func createService(name, namespace string, labelSelector map[string]string) api.Service {
return api.Service{
ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace, Labels: labelSelector},
Spec: api.ServiceSpec{Selector: labelSelector},
Spec: api.ServiceSpec{Selector: labelSelector},
}
}
const testNamespace = "test-namespace"
var testLabel = map[string]string{"app": "test"}
func TestGetServicesForDeletionforDS(t *testing.T) {
......
......@@ -40,6 +40,7 @@ func createService(name, namespace string, labelSelector map[string]string) api.
}
const testNamespace = "test-namespace"
var testLabel = map[string]string{"app": "test"}
func TestDeleteDaemonSetServices(t *testing.T) {
......
......@@ -86,9 +86,9 @@ func TestGetDeploymentDetail(t *testing.T) {
deployment,
&DeploymentDetail{
ObjectMeta: common.ObjectMeta{
Name: "dp-1",
Name: "dp-1",
Namespace: "ns-1",
Labels: map[string]string{"foo": "bar"},
Labels: map[string]string{"foo": "bar"},
},
TypeMeta: common.TypeMeta{Kind: common.ResourceKindDeployment},
PodList: pod.PodList{
......
......@@ -24,7 +24,6 @@ import (
"k8s.io/kubernetes/pkg/apis/extensions"
)
func TestToReplicaSet(t *testing.T) {
cases := []struct {
replicaSet *extensions.ReplicaSet
......@@ -51,4 +50,3 @@ func TestToReplicaSet(t *testing.T) {
}
}
}
......@@ -26,7 +26,7 @@ func TestUpdateReplicasCount(t *testing.T) {
cases := []struct {
namespace, replicationControllerName string
replicationControllerSpec *ReplicationControllerSpec
replicationController *api.ReplicationController
replicationController *api.ReplicationController
expected int32
expectedActions []string
}{
......
......@@ -44,7 +44,7 @@ func TestGetStatefulSetListFromChannels(t *testing.T) {
&StatefulSetList{
ListMeta: common.ListMeta{},
CumulativeMetrics: make([]metric.Metric, 0),
StatefulSets: []StatefulSet{}},
StatefulSets: []StatefulSet{}},
nil,
},
{
......
......@@ -24,12 +24,12 @@ import (
"github.com/kubernetes/dashboard/src/app/backend/resource/deployment"
"github.com/kubernetes/dashboard/src/app/backend/resource/job/joblist"
"github.com/kubernetes/dashboard/src/app/backend/resource/metric"
"github.com/kubernetes/dashboard/src/app/backend/resource/statefulset/statefulsetlist"
"github.com/kubernetes/dashboard/src/app/backend/resource/pod"
"github.com/kubernetes/dashboard/src/app/backend/resource/replicaset"
"github.com/kubernetes/dashboard/src/app/backend/resource/replicaset/replicasetlist"
"github.com/kubernetes/dashboard/src/app/backend/resource/replicationcontroller"
"github.com/kubernetes/dashboard/src/app/backend/resource/replicationcontroller/replicationcontrollerlist"
"github.com/kubernetes/dashboard/src/app/backend/resource/statefulset/statefulsetlist"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/apps"
......@@ -40,20 +40,20 @@ import (
func TestGetWorkloadsFromChannels(t *testing.T) {
var jobCompletions int32
cases := []struct {
k8sRs extensions.ReplicaSetList
k8sJobs batch.JobList
k8sDaemonSet extensions.DaemonSetList
k8sDeployment extensions.DeploymentList
k8sRc api.ReplicationControllerList
k8sPod api.PodList
k8sStatefulSet apps.StatefulSetList
rcs []replicationcontroller.ReplicationController
rs []replicaset.ReplicaSet
jobs []joblist.Job
daemonset []daemonsetlist.DaemonSet
deployment []deployment.Deployment
pod []pod.Pod
statefulSet []statefulsetlist.StatefulSet
k8sRs extensions.ReplicaSetList
k8sJobs batch.JobList
k8sDaemonSet extensions.DaemonSetList
k8sDeployment extensions.DeploymentList
k8sRc api.ReplicationControllerList
k8sPod api.PodList
k8sStatefulSet apps.StatefulSetList
rcs []replicationcontroller.ReplicationController
rs []replicaset.ReplicaSet
jobs []joblist.Job
daemonset []daemonsetlist.DaemonSet
deployment []deployment.Deployment
pod []pod.Pod
statefulSet []statefulsetlist.StatefulSet
}{
{
extensions.ReplicaSetList{},
......@@ -198,7 +198,7 @@ func TestGetWorkloadsFromChannels(t *testing.T) {
StatefulSetList: statefulsetlist.StatefulSetList{
ListMeta: common.ListMeta{TotalItems: len(c.statefulSet)},
CumulativeMetrics: make([]metric.Metric, 0),
StatefulSets: c.statefulSet,
StatefulSets: c.statefulSet,
},
}
var expectedErr error
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册