Merge pull request #64654 from atlassian/missing-error-handling

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add missing error handling in schema-related code

**What this PR does / why we need it**:
Adds missing error handling to a few places.

**Which issue(s) this PR fixes**
Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664).

**Release note**:
```release-note
NONE
```

/kind bug
/sig api-machinery
This commit is contained in:
Kubernetes Submit Queue
2018-07-02 07:14:34 -07:00
committed by GitHub
73 changed files with 208 additions and 119 deletions

View File

@@ -208,8 +208,12 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
// NewDefaultComponentConfig returns kube-controller manager configuration object.
func NewDefaultComponentConfig(insecurePort int32) (componentconfig.KubeControllerManagerConfiguration, error) {
scheme := runtime.NewScheme()
componentconfigv1alpha1.AddToScheme(scheme)
componentconfig.AddToScheme(scheme)
if err := componentconfigv1alpha1.AddToScheme(scheme); err != nil {
return componentconfig.KubeControllerManagerConfiguration{}, err
}
if err := componentconfig.AddToScheme(scheme); err != nil {
return componentconfig.KubeControllerManagerConfiguration{}, err
}
versioned := componentconfigv1alpha1.KubeControllerManagerConfiguration{}
scheme.Default(&versioned)