本文整理汇总了Golang中github.com/kubernetes/dashboard/src/app/backend/resource/common.NewTypeMeta函数的典型用法代码示例。如果您正苦于以下问题:Golang NewTypeMeta函数的具体用法?Golang NewTypeMeta怎么用?Golang NewTypeMeta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewTypeMeta函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: toNode
func toNode(node api.Node) Node {
return Node{
ObjectMeta: common.NewObjectMeta(node.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNode),
Ready: getNodeConditionStatus(node, api.NodeReady),
}
}
示例2: getLimitRangeDetail
func getLimitRangeDetail(rawLimitRange *api.LimitRange) *LimitRangeDetail {
return &LimitRangeDetail{
ObjectMeta: common.NewObjectMeta(rawLimitRange.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindLimitRange),
LimitRanges: toLimitRanges(rawLimitRange.Spec.Limits),
}
}
示例3: getConfigMapDetail
func getConfigMapDetail(rawConfigMap *api.ConfigMap) *ConfigMapDetail {
return &ConfigMapDetail{
ObjectMeta: common.NewObjectMeta(rawConfigMap.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindConfigMap),
Data: rawConfigMap.Data,
}
}
示例4: toNamespace
func toNamespace(namespace api.Namespace) Namespace {
return Namespace{
ObjectMeta: common.NewObjectMeta(namespace.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNamespace),
Phase: namespace.Status.Phase,
}
}
示例5: getPersistentVolumeList
func getPersistentVolumeList(persistentVolumes []api.PersistentVolume, dsQuery *dataselect.DataSelectQuery) *PersistentVolumeList {
result := &PersistentVolumeList{
Items: make([]PersistentVolume, 0),
ListMeta: common.ListMeta{TotalItems: len(persistentVolumes)},
}
persistentVolumes = fromCells(dataselect.GenericDataSelect(toCells(persistentVolumes), dsQuery))
for _, item := range persistentVolumes {
var claim string
if item.Spec.ClaimRef != nil {
claim = item.Spec.ClaimRef.Name
}
result.Items = append(result.Items,
PersistentVolume{
ObjectMeta: common.NewObjectMeta(item.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPersistentVolume),
Capacity: item.Spec.Capacity,
AccessModes: item.Spec.AccessModes,
Status: item.Status.Phase,
Claim: claim,
Reason: item.Status.Reason,
})
}
return result
}
示例6: getSecretDetail
func getSecretDetail(rawSecret *api.Secret) *SecretDetail {
return &SecretDetail{
ObjectMeta: common.NewObjectMeta(rawSecret.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
Data: rawSecret.Data,
Type: rawSecret.Type,
}
}
示例7: ToReplicaSet
// ToReplicaSet converts replica set api object to replica set model object.
func ToReplicaSet(replicaSet *extensions.ReplicaSet, podInfo *common.PodInfo) ReplicaSet {
return ReplicaSet{
ObjectMeta: common.NewObjectMeta(replicaSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindReplicaSet),
ContainerImages: common.GetContainerImages(&replicaSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
示例8: getIngressDetail
func getIngressDetail(rawIngress *extensions.Ingress) *IngressDetail {
return &IngressDetail{
ObjectMeta: common.NewObjectMeta(rawIngress.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindIngress),
Spec: rawIngress.Spec,
Status: rawIngress.Status,
}
}
示例9: ToPetSet
// ToPetSet transforms pet set into PetSet object returned by API.
func ToPetSet(petSet *apps.PetSet, podInfo *common.PodInfo) PetSet {
return PetSet{
ObjectMeta: common.NewObjectMeta(petSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPetSet),
ContainerImages: common.GetContainerImages(&petSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
示例10: ToStatefulSet
// ToStatefulSet transforms pet set into StatefulSet object returned by API.
func ToStatefulSet(statefulSet *apps.StatefulSet, podInfo *common.PodInfo) StatefulSet {
return StatefulSet{
ObjectMeta: common.NewObjectMeta(statefulSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindStatefulSet),
ContainerImages: common.GetContainerImages(&statefulSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
示例11: ToJob
func ToJob(job *batch.Job, podInfo *common.PodInfo) Job {
return Job{
ObjectMeta: common.NewObjectMeta(job.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindJob),
ContainerImages: common.GetContainerImages(&job.Spec.Template.Spec),
Pods: *podInfo,
}
}
示例12: NewIngress
// NewIngress - creates a new instance of Ingress struct based on K8s Ingress.
func NewIngress(ingress *extensions.Ingress) *Ingress {
modelIngress := &Ingress{
ObjectMeta: common.NewObjectMeta(ingress.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindIngress),
Endpoints: getEndpoints(ingress),
}
return modelIngress
}
示例13: ToReplicationController
// ToReplicationController converts replication controller api object to replication controller
// model object.
func ToReplicationController(replicationController *api.ReplicationController,
podInfo *common.PodInfo) ReplicationController {
return ReplicationController{
ObjectMeta: common.NewObjectMeta(replicationController.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindReplicationController),
Pods: *podInfo,
ContainerImages: common.GetContainerImages(&replicationController.Spec.Template.Spec),
}
}
示例14: toNamespaceDetail
func toNamespaceDetail(namespace api.Namespace, events common.EventList, resourceQuotaList *resourcequota.ResourceQuotaDetailList) NamespaceDetail {
return NamespaceDetail{
ObjectMeta: common.NewObjectMeta(namespace.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNamespace),
Phase: namespace.Status.Phase,
EventList: events,
ResourceQuotaList: resourceQuotaList,
}
}
示例15: getPersistentVolumeClaimDetail
func getPersistentVolumeClaimDetail(persistentVolumeClaim *api.PersistentVolumeClaim) *PersistentVolumeClaimDetail {
return &PersistentVolumeClaimDetail{
ObjectMeta: common.NewObjectMeta(persistentVolumeClaim.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPersistentVolumeClaim),
Status: persistentVolumeClaim.Status.Phase,
Volume: persistentVolumeClaim.Spec.VolumeName,
Capacity: persistentVolumeClaim.Status.Capacity,
AccessModes: persistentVolumeClaim.Spec.AccessModes,
}
}