本文整理汇总了Golang中github.com/openshift/origin/pkg/client.Interface.Builds方法的典型用法代码示例。如果您正苦于以下问题:Golang Interface.Builds方法的具体用法?Golang Interface.Builds怎么用?Golang Interface.Builds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/openshift/origin/pkg/client.Interface
的用法示例。
在下文中一共展示了Interface.Builds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: deleteBuilds
func deleteBuilds(client osclient.Interface, ns string) error {
items, err := client.Builds(ns).List(labels.Everything(), fields.Everything())
if err != nil {
return err
}
for i := range items.Items {
err := client.Builds(ns).Delete(items.Items[i].Name)
if err != nil && !errors.IsNotFound(err) {
return err
}
}
return nil
}
示例2: unloadBuildLabel
func unloadBuildLabel(client osclient.Interface, application *api.Application, labelSelector labels.Selector) error {
resourceList, _ := client.Builds(application.Namespace).List(kapi.ListOptions{LabelSelector: labelSelector, FieldSelector: fields.Everything()})
errs := []error{}
for _, resource := range resourceList.Items {
if !hasItem(application.Spec.Items, api.Item{Kind: "Build", Name: resource.Name}) {
delete(resource.Labels, fmt.Sprintf("%s.application.%s", application.Namespace, application.Name))
if _, err := client.Builds(application.Namespace).Update(&resource); err != nil {
errs = append(errs, err)
}
}
}
return nil
}
示例3: deleteBuilds
func deleteBuilds(client osclient.Interface, ns string) error {
items, err := client.Builds(ns).List(kapi.ListOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil
}
return err
}
for i := range items.Items {
err := client.Builds(ns).Delete(items.Items[i].Name)
if err != nil && !errors.IsNotFound(err) {
return err
}
}
return nil
}
示例4: loadBuilds
func loadBuilds(g osgraph.Graph, graphLock sync.Mutex, namespace string, kclient kclient.Interface, client client.Interface) error {
builds, err := client.Builds(namespace).List(labels.Everything(), fields.Everything())
if err != nil {
return err
}
graphLock.Lock()
defer graphLock.Unlock()
for i := range builds.Items {
buildgraph.EnsureBuildNode(g, &builds.Items[i])
}
return nil
}