本文整理匯總了Golang中github.com/GoogleCloudPlatform/kubernetes/pkg/api.BoundPod.SelfLink方法的典型用法代碼示例。如果您正苦於以下問題:Golang BoundPod.SelfLink方法的具體用法?Golang BoundPod.SelfLink怎麽用?Golang BoundPod.SelfLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/GoogleCloudPlatform/kubernetes/pkg/api.BoundPod
的用法示例。
在下文中一共展示了BoundPod.SelfLink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newSourceApiserverFromLW
// newSourceApiserverFromLW holds creates a config source that watches an pulls from the apiserver.
func newSourceApiserverFromLW(lw cache.ListerWatcher, updates chan<- interface{}) {
send := func(objs []interface{}) {
var bpods []api.BoundPod
for _, o := range objs {
pod := o.(*api.Pod)
bpod := api.BoundPod{}
if err := api.Scheme.Convert(pod, &bpod); err != nil {
glog.Errorf("Unable to interpret Pod from apiserver as a BoundPod: %v: %+v", err, pod)
continue
}
// Make a dummy self link so that references to this bound pod will work.
bpod.SelfLink = "/api/v1beta1/boundPods/" + bpod.Name
bpods = append(bpods, bpod)
}
updates <- kubelet.PodUpdate{bpods, kubelet.SET, kubelet.ApiserverSource}
}
cache.NewReflector(lw, &api.Pod{}, cache.NewUndeltaStore(send)).Run()
}