mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-19 16:05:11 +00:00
Add the functionality to support `CreateOrMutateConfigMap` and `MutateConfigMap`. * `CreateOrMutateConfigMap` will try to create a given ConfigMap object; if this ConfigMap already exists, a new version of the resource will be retrieved from the server and a mutator callback will be called on it. Then, an `Update` of the mutated object will be performed. If there's a conflict during this `Update` operation, retry until no conflict happens. On every retry the object is refreshed from the server to the latest version. * `MutateConfigMap` will try to get the latest version of the ConfigMap from the server, call the mutator callback and then try to `Update` the mutated object. If there's a conflict during this `Update` operation, retry until no conflict happens. On every retry the object is refreshed from the server to the latest version. Add unit tests for `MutateConfigMap` * One test checks that in case of no conflicts, the update of the given ConfigMap happens without any issues. * Another test mimics 5 consecutive CONFLICT responses when updating the given ConfigMap, whereas the sixth try it will work.
81 lines
3.2 KiB
Python
81 lines
3.2 KiB
Python
package(default_visibility = ["//visibility:public"])
|
|
|
|
load(
|
|
"@io_bazel_rules_go//go:def.bzl",
|
|
"go_library",
|
|
"go_test",
|
|
)
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
srcs = [
|
|
"clientbacked_dryrun.go",
|
|
"dryrunclient.go",
|
|
"idempotency.go",
|
|
"init_dryrun.go",
|
|
"wait.go",
|
|
],
|
|
importpath = "k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient",
|
|
deps = [
|
|
"//cmd/kubeadm/app/constants:go_default_library",
|
|
"//cmd/kubeadm/app/util:go_default_library",
|
|
"//pkg/kubelet/types:go_default_library",
|
|
"//pkg/registry/core/service/ipallocator:go_default_library",
|
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
|
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
|
"//staging/src/k8s.io/api/rbac/v1:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
|
|
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
|
|
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
|
|
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",
|
|
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
|
|
"//staging/src/k8s.io/client-go/rest:go_default_library",
|
|
"//staging/src/k8s.io/client-go/testing:go_default_library",
|
|
"//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library",
|
|
"//staging/src/k8s.io/client-go/util/retry:go_default_library",
|
|
"//vendor/github.com/pkg/errors:go_default_library",
|
|
],
|
|
)
|
|
|
|
filegroup(
|
|
name = "package-srcs",
|
|
srcs = glob(["**"]),
|
|
tags = ["automanaged"],
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "all-srcs",
|
|
srcs = [":package-srcs"],
|
|
tags = ["automanaged"],
|
|
)
|
|
|
|
go_test(
|
|
name = "go_default_test",
|
|
srcs = [
|
|
"dryrunclient_test.go",
|
|
"idempotency_test.go",
|
|
"init_dryrun_test.go",
|
|
],
|
|
embed = [":go_default_library"],
|
|
deps = [
|
|
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
|
"//staging/src/k8s.io/api/rbac/v1:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
|
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",
|
|
"//staging/src/k8s.io/client-go/testing:go_default_library",
|
|
"//vendor/github.com/pkg/errors:go_default_library",
|
|
],
|
|
)
|