mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-27 11:53:53 +00:00
add nodestatus package with Setter abstraction for composable node constructors
This commit is contained in:
@@ -273,6 +273,7 @@ filegroup(
|
|||||||
"//pkg/kubelet/metrics:all-srcs",
|
"//pkg/kubelet/metrics:all-srcs",
|
||||||
"//pkg/kubelet/mountpod:all-srcs",
|
"//pkg/kubelet/mountpod:all-srcs",
|
||||||
"//pkg/kubelet/network:all-srcs",
|
"//pkg/kubelet/network:all-srcs",
|
||||||
|
"//pkg/kubelet/nodestatus:all-srcs",
|
||||||
"//pkg/kubelet/pleg:all-srcs",
|
"//pkg/kubelet/pleg:all-srcs",
|
||||||
"//pkg/kubelet/pod:all-srcs",
|
"//pkg/kubelet/pod:all-srcs",
|
||||||
"//pkg/kubelet/preemption:all-srcs",
|
"//pkg/kubelet/preemption:all-srcs",
|
||||||
|
|||||||
23
pkg/kubelet/nodestatus/BUILD
Normal file
23
pkg/kubelet/nodestatus/BUILD
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = ["setters.go"],
|
||||||
|
importpath = "k8s.io/kubernetes/pkg/kubelet/nodestatus",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = ["//vendor/k8s.io/api/core/v1:go_default_library"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
25
pkg/kubelet/nodestatus/setters.go
Normal file
25
pkg/kubelet/nodestatus/setters.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package nodestatus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"k8s.io/api/core/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Setter modifies the node in-place, and returns an error if the modification failed.
|
||||||
|
// Setters may partially mutate the node before returning an error.
|
||||||
|
type Setter func(node *v1.Node) error
|
||||||
Reference in New Issue
Block a user