- .github
- applyconfigurations
- discovery
- dynamic
- examples
- features
- gentype
- informers
- kubernetes
- kubernetes_test
- listers
- metadata
- openapi
- openapi3
- pkg
- plugin
-
rest
-
fake
-
testdata
-
watch
- OWNERS
- client.go
- client_test.go
- config.go
- config_test.go
- connection_test.go
- exec.go
- exec_test.go
- plugin.go
- plugin_test.go
- request.go
- request_test.go
- request_watchlist_test.go
- transport.go
- transport_test.go
- url_utils.go
- url_utils_test.go
- urlbackoff.go
- urlbackoff_test.go
- warnings.go
- with_retry.go
- with_retry_test.go
- zz_generated.deepcopy.go
-
fake
- restmapper
- scale
- testing
- third_party
- tools
- transport
- util
- CHANGELOG.md
- CONTRIBUTING.md
- INSTALL.md
- LICENSE
- OWNERS
- README.md
- SECURITY_CONTACTS
- code-of-conduct.md
- doc.go
- go.mod
- go.sum
Explanation
This code defines a ResourceMetricStatusApplyConfiguration
struct in the v2
package of k8s.io/api/core/v1
. This struct is designed to represent a declarative configuration of a ResourceMetricStatus
object, used for applying configurations to Kubernetes resources.
The struct has two fields:
Name
: A pointer to av1.ResourceName
, representing the name of the resource being monitored.Current
: A pointer to aMetricValueStatusApplyConfiguration
, representing the current value of the resource metric.
The code also includes two functions:
ResourceMetricStatus()
: This function returns a new, emptyResourceMetricStatusApplyConfiguration
object.WithName()
: This function sets theName
field of theResourceMetricStatusApplyConfiguration
object to the given value and returns the object itself. This allows for chaining calls to build the configuration object.WithCurrent()
: This function sets theCurrent
field of theResourceMetricStatusApplyConfiguration
object to the given value and returns the object itself, also allowing for chaining.
This code serves as a foundation for applying configurations related to resource metrics in Kubernetes, ensuring consistency and clarity in managing resource usage within the cluster.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph