Skip to content

Docker transfer settings in kOps

 1 min Exposing Docker transfer settings in kOps required carrying them through internal types, versioned APIs, conversions, copies, and the CRD.
Published

Sep 13, 2021

The feature was three Docker settings: concurrent downloads, concurrent uploads, and download attempts. My kOps patch exposed them through the cluster configuration.

One field in the internal Go type carried both its JSON name and its daemon flag:

MaxConcurrentDownloads *int32 `json:"maxConcurrentDownloads,omitempty" flag:"max-concurrent-downloads"`

The pointer preserved a difference between an omitted setting and an explicitly supplied value. Adding it only to that struct would not have completed the feature. The value also had to survive the versioned API used to store and retrieve the configuration.

The patch changed the internal type and both v1alpha2 and v1alpha3, updated conversion code in both directions, regenerated deep-copy handling, and added the integer fields and descriptions to the CRD schema. Each pointer field needed its own allocated copy rather than silently sharing the original pointer.

The command-line option was already understood by Docker; the work was carrying the user’s setting intact to the point where kOps could emit it.

The configuration changes merged.