當前位置: 首頁>>代碼示例>>Golang>>正文


Golang common.NewObjectMeta函數代碼示例

本文整理匯總了Golang中github.com/kubernetes/dashboard/src/app/backend/resource/common.NewObjectMeta函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewObjectMeta函數的具體用法?Golang NewObjectMeta怎麽用?Golang NewObjectMeta使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewObjectMeta函數的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),
	}
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:7,代碼來源:nodelist.go

示例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),
	}
}
開發者ID:bryk,項目名稱:dashboard,代碼行數:7,代碼來源:limitrangedetail.go

示例3: getConfigMapDetail

func getConfigMapDetail(rawConfigMap *api.ConfigMap) *ConfigMapDetail {
	return &ConfigMapDetail{
		ObjectMeta: common.NewObjectMeta(rawConfigMap.ObjectMeta),
		TypeMeta:   common.NewTypeMeta(common.ResourceKindConfigMap),
		Data:       rawConfigMap.Data,
	}
}
開發者ID:kubernetes,項目名稱:dashboard,代碼行數:7,代碼來源:configmapdetail.go

示例4: toNamespace

func toNamespace(namespace api.Namespace) Namespace {
	return Namespace{
		ObjectMeta: common.NewObjectMeta(namespace.ObjectMeta),
		TypeMeta:   common.NewTypeMeta(common.ResourceKindNamespace),
		Phase:      namespace.Status.Phase,
	}
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:7,代碼來源:namespacelist.go

示例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
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:29,代碼來源:persistentvolumelist.go

示例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,
	}
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:8,代碼來源:secretdetail.go

示例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,
	}
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:9,代碼來源:replicasetcommon.go

示例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,
	}
}
開發者ID:kubernetes,項目名稱:dashboard,代碼行數:8,代碼來源:ingressdetail.go

示例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,
	}
}
開發者ID:cheld,項目名稱:dashboard,代碼行數:9,代碼來源:petsetlist.go

示例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,
	}
}
開發者ID:kubernetes,項目名稱:dashboard,代碼行數:9,代碼來源:statefulsetlist.go

示例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,
	}
}
開發者ID:cheld,項目名稱:dashboard,代碼行數:8,代碼來源:joblist.go

示例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
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:10,代碼來源:ingresslist.go

示例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),
	}
}
開發者ID:kubernetes,項目名稱:dashboard,代碼行數:12,代碼來源:replicationcontrollercommon.go

示例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,
	}
}
開發者ID:digitalfishpond,項目名稱:dashboard,代碼行數:10,代碼來源:namespacedetail.go

示例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,
	}
}
開發者ID:kubernetes,項目名稱:dashboard,代碼行數:11,代碼來源:persistentvolumeclaimdetail.go


注:本文中的github.com/kubernetes/dashboard/src/app/backend/resource/common.NewObjectMeta函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。