mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
rename to _test.go, update-bazel, comments
This commit is contained in:
parent
7648696c88
commit
42c5bca0c0
@ -101,14 +101,18 @@ go_test(
|
|||||||
"gce_disks_test.go",
|
"gce_disks_test.go",
|
||||||
"gce_healthchecks_test.go",
|
"gce_healthchecks_test.go",
|
||||||
"gce_loadbalancer_external_test.go",
|
"gce_loadbalancer_external_test.go",
|
||||||
|
"gce_loadbalancer_internal_test.go",
|
||||||
|
"gce_loadbalancer_utils_test.go",
|
||||||
"gce_test.go",
|
"gce_test.go",
|
||||||
"gce_util_test.go",
|
"gce_util_test.go",
|
||||||
"metrics_test.go",
|
"metrics_test.go",
|
||||||
],
|
],
|
||||||
embed = [":go_default_library"],
|
embed = [":go_default_library"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//pkg/api/v1/service:go_default_library",
|
||||||
"//pkg/cloudprovider:go_default_library",
|
"//pkg/cloudprovider:go_default_library",
|
||||||
"//pkg/cloudprovider/providers/gce/cloud:go_default_library",
|
"//pkg/cloudprovider/providers/gce/cloud:go_default_library",
|
||||||
|
"//pkg/cloudprovider/providers/gce/cloud/meta:go_default_library",
|
||||||
"//pkg/cloudprovider/providers/gce/cloud/mock:go_default_library",
|
"//pkg/cloudprovider/providers/gce/cloud/mock:go_default_library",
|
||||||
"//pkg/kubelet/apis:go_default_library",
|
"//pkg/kubelet/apis:go_default_library",
|
||||||
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
||||||
|
@ -7,6 +7,7 @@ go_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/cloudprovider/providers/gce/cloud:go_default_library",
|
"//pkg/cloudprovider/providers/gce/cloud:go_default_library",
|
||||||
|
"//pkg/cloudprovider/providers/gce/cloud/filter:go_default_library",
|
||||||
"//pkg/cloudprovider/providers/gce/cloud/meta:go_default_library",
|
"//pkg/cloudprovider/providers/gce/cloud/meta:go_default_library",
|
||||||
"//vendor/google.golang.org/api/compute/v0.alpha:go_default_library",
|
"//vendor/google.golang.org/api/compute/v0.alpha:go_default_library",
|
||||||
"//vendor/google.golang.org/api/compute/v0.beta:go_default_library",
|
"//vendor/google.golang.org/api/compute/v0.beta:go_default_library",
|
||||||
|
@ -233,6 +233,7 @@ type instanceGroupAttributes struct {
|
|||||||
instanceMap map[meta.Key][]*ga.InstanceWithNamedPorts
|
instanceMap map[meta.Key][]*ga.InstanceWithNamedPorts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddInstancesHook mocks adding instances from an InstanceGroup
|
||||||
func AddInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsAddInstancesRequest, m *cloud.MockInstanceGroups) error {
|
func AddInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsAddInstancesRequest, m *cloud.MockInstanceGroups) error {
|
||||||
_, err := m.Get(ctx, key)
|
_, err := m.Get(ctx, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -269,6 +270,7 @@ func AddInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroups
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ListInstancesHook mocks listing instances from an InstanceGroup
|
||||||
func ListInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsListInstancesRequest, filter *filter.F, m *cloud.MockInstanceGroups) ([]*ga.InstanceWithNamedPorts, error) {
|
func ListInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsListInstancesRequest, filter *filter.F, m *cloud.MockInstanceGroups) ([]*ga.InstanceWithNamedPorts, error) {
|
||||||
_, err := m.Get(ctx, key)
|
_, err := m.Get(ctx, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -293,6 +295,7 @@ func ListInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroup
|
|||||||
return instances, nil
|
return instances, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveInstancesHook mocks removing instances from an InstanceGroup
|
||||||
func RemoveInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsRemoveInstancesRequest, m *cloud.MockInstanceGroups) error {
|
func RemoveInstancesHook(ctx context.Context, key *meta.Key, req *ga.InstanceGroupsRemoveInstancesRequest, m *cloud.MockInstanceGroups) error {
|
||||||
_, err := m.Get(ctx, key)
|
_, err := m.Get(ctx, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -347,7 +350,7 @@ func UpdateFirewallHook(ctx context.Context, key *meta.Key, obj *ga.Firewall, m
|
|||||||
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "firewalls")
|
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "firewalls")
|
||||||
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "firewalls", key)
|
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "firewalls", key)
|
||||||
|
|
||||||
m.Objects[*key] = &cloud.MockFirewallsObj{obj}
|
m.Objects[*key] = &cloud.MockFirewallsObj{Obj: obj}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +369,7 @@ func UpdateHealthCheckHook(ctx context.Context, key *meta.Key, obj *ga.HealthChe
|
|||||||
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "healthChecks")
|
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "healthChecks")
|
||||||
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "healthChecks", key)
|
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "healthChecks", key)
|
||||||
|
|
||||||
m.Objects[*key] = &cloud.MockHealthChecksObj{obj}
|
m.Objects[*key] = &cloud.MockHealthChecksObj{Obj: obj}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,6 +389,6 @@ func UpdateRegionBackendServiceHook(ctx context.Context, key *meta.Key, obj *ga.
|
|||||||
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "backendServices")
|
projectID := m.ProjectRouter.ProjectID(ctx, "ga", "backendServices")
|
||||||
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "backendServices", key)
|
obj.SelfLink = cloud.SelfLink(meta.VersionGA, projectID, "backendServices", key)
|
||||||
|
|
||||||
m.Objects[*key] = &cloud.MockRegionBackendServicesObj{obj}
|
m.Objects[*key] = &cloud.MockRegionBackendServicesObj{Obj: obj}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,12 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
This file contains shared functions and variables to set up for tests for
|
|
||||||
ExternalLoadBalancer and InternalLoadBalancers. It currently cannot live in a
|
|
||||||
separate package from GCE because then it would cause a circular import.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// This file contains shared functions and variables to set up for tests for
|
||||||
|
// ExternalLoadBalancer and InternalLoadBalancers. It currently cannot live in a
|
||||||
|
// separate package from GCE because then it would cause a circular import.
|
||||||
|
|
||||||
package gce
|
package gce
|
||||||
|
|
||||||
import (
|
import (
|
Loading…
Reference in New Issue
Block a user