Documentation ¶
Index ¶
Constants ¶
View Source
const ( // the patch metadata is capped at 2kb of data, for more see https://github.com/solo-io/solo-kit/issues/523 // 2147483647 bytes max k8s get from etcd / 2kb per status patch ~= 1 million resources MaxStatusBytes = 2048 )
Variables ¶
View Source
var ( // only public for unit tests! DisableMaxStatusSize = false NoNamespacedStatusesError = func(inputResource resources.InputResource) error { return errors.Errorf("no namespaced statuses found on input resource %s.%s (%T)", inputResource.GetMetadata().GetNamespace(), inputResource.GetMetadata().GetName(), inputResource) } StatusReporterNamespaceError = func(err error) error { return errors.Wrapf(err, "getting status reporter namespace") } NamespacedStatusNotFoundError = func(inputResource resources.InputResource, namespace string) error { return errors.Errorf("input resource %s.%s (%T) does not contain status for namespace %s", inputResource.GetMetadata().GetNamespace(), inputResource.GetMetadata().GetName(), inputResource, namespace) } ResourceMarshalError = func(err error, inputResource resources.InputResource) error { return errors.Wrapf(err, "marshalling input resource %s.%s (%T)", inputResource.GetMetadata().GetNamespace(), inputResource.GetMetadata().GetName(), inputResource) } PatchTooLargeError = func(data []byte) error { return errors.Errorf("patch is too large (%v bytes), max is %v bytes", len(data), MaxStatusBytes) } )
Functions ¶
func ApplyStatus ¶
func ApplyStatus(rc clients.ResourceClient, statusClient resources.StatusClient, inputResource resources.InputResource, opts clients.ApplyStatusOpts) (resources.Resource, error)
ApplyStatus is used by clients that don't support patch updates to resource statuses (e.g. consul, files, in-memory)
func GetJsonPatchData ¶
GetJsonPatchData returns the status json patch data for the input resource. Prefer using json patch for single api call status updates when supported (e.g. k8s) to avoid ratelimiting to the k8s apiserver (e.g. https://github.com/solo-io/gloo/blob/a083522af0a4ce22f4d2adf3a02470f782d5a865/projects/gloo/api/v1/settings.proto#L337-L350)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.