- .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 struct ResourceMetricStatusApplyConfiguration
which represents a declarative configuration for the ResourceMetricStatus
type used in Kubernetes. It provides a mechanism to construct ResourceMetricStatus
objects using a fluent builder pattern.
Here’s a breakdown:
ResourceMetricStatusApplyConfiguration
: This struct holds fields corresponding to theResourceMetricStatus
type, but as pointers. This allows for optional field setting.Name
: This field holds a pointer to av1.ResourceName
value, which represents the name of the resource being tracked.Current
: This field holds a pointer to aMetricValueStatusApplyConfiguration
struct, which provides a declarative configuration for the current resource usage.ResourceMetricStatus()
: This function creates a newResourceMetricStatusApplyConfiguration
instance, acting as a constructor.WithName(value v1.ResourceName)
: This method sets theName
field of the configuration to the givenv1.ResourceName
value. It returns the receiver (*ResourceMetricStatusApplyConfiguration
) to enable chaining.WithCurrent(value *MetricValueStatusApplyConfiguration)
: This method sets theCurrent
field to the givenMetricValueStatusApplyConfiguration
value. It also returns the receiver for chaining.
In essence, this code facilitates a flexible and convenient way to define ResourceMetricStatus
configurations by allowing developers to selectively set fields through chained method calls. This approach promotes code readability and conciseness.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph