本文整理匯總了Golang中k8s/io/kubernetes/test/e2e/framework.SkipUnlessFederated函數的典型用法代碼示例。如果您正苦於以下問題:Golang SkipUnlessFederated函數的具體用法?Golang SkipUnlessFederated怎麽用?Golang SkipUnlessFederated使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SkipUnlessFederated函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
package e2e
import (
"fmt"
. "github.com/onsi/ginkgo"
federationapi "k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/test/e2e/framework"
)
// Create/delete cluster api objects
var _ = framework.KubeDescribe("Federation apiserver [Feature:Federation]", func() {
f := framework.NewDefaultFederatedFramework("federated-cluster")
It("should allow creation of cluster api objects", func() {
framework.SkipUnlessFederated(f.Client)
contexts := f.GetUnderlyingFederatedContexts()
for _, context := range contexts {
framework.Logf("Creating cluster object: %s (%s)", context.Name, context.Cluster.Cluster.Server)
cluster := federationapi.Cluster{
ObjectMeta: api.ObjectMeta{
Name: context.Name,
},
Spec: federationapi.ClusterSpec{
ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{
{
ClientCIDR: "0.0.0.0/0",
ServerAddress: context.Cluster.Cluster.Server,
},
示例2:
package e2e
import (
"fmt"
. "github.com/onsi/ginkgo"
federationapi "k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/test/e2e/framework"
)
// Create/delete cluster api objects
var _ = framework.KubeDescribe("Federation apiserver [Feature:Federation]", func() {
f := framework.NewDefaultFederatedFramework("federated-cluster")
It("should allow creation of cluster api objects", func() {
framework.SkipUnlessFederated()
contexts := f.GetUnderlyingFederatedContexts()
for _, context := range contexts {
framework.Logf("Creating cluster object: %s (%s)", context.Name, context.Cluster.Cluster.Server)
cluster := federationapi.Cluster{
ObjectMeta: api.ObjectMeta{
Name: context.Name,
},
Spec: federationapi.ClusterSpec{
ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{
{
ClientCIDR: "0.0.0.0/0",
ServerAddress: context.Cluster.Cluster.Server,
},