跳到主要内容

72.dir

PR #1958

Add support for applying set of resources via kubectl

// ApplyItems creates bulk of resources provided by items list. Each item must
// be valid API type. It requires ObjectTyper to parse the Version and Kind and
// RESTMapper to get the resource URI and REST client that knows how to create
// given type
func CreateObjects(typer runtime.ObjectTyper, mapper meta.RESTMapper, clientFor ClientFunc, objects []runtime.Object) errs.ValidationErrorList {
allErrors := errs.ValidationErrorList{}
for i, obj := range objects {
version, kind, err := typer.ObjectVersionAndKind(obj)
if err != nil {
reportError(&allErrors, i, errs.NewFieldInvalid("kind", obj))
continue
}

mapping, err := mapper.RESTMapping(version, kind)
if err != nil {
reportError(&allErrors, i, errs.NewFieldNotSupported("mapping", err))
continue
}

client, err := clientFor(mapping)
if err != nil {
reportError(&allErrors, i, errs.NewFieldNotSupported("client", obj))
continue
}

if err := CreateObject(client, mapping, obj); err != nil {
reportError(&allErrors, i, *err)
}
}

return allErrors.Prefix("Config")
}

PR # 2000

Allow kubectl to handle arbitrary objects

将 kubectl 命令与了解对象的特定细节解耦(通过 RESTMapper 和命令的工厂抽象)

PR #2122

Moar authorization attributes

2086

Refactor internal API for Services to match v1beta3

Service 中区分 Spec 和 Status

2166

Refactor PodFitsPorts

2024

state-based parser for multi-valued set selector syntax

2179

Refactor PodStatus to PodCondition in internal API for v1beta3