Merge pull request #4305 from georgebuckerfield/master

Handle NotFound error when creating instance group
This commit is contained in:
k8s-ci-robot 2018-01-25 07:47:18 -08:00 committed by GitHub
commit 069c36d7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import (
"strings"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kops/cmd/kops/util"
api "k8s.io/kops/pkg/apis/kops"
@ -133,7 +134,10 @@ func RunCreateInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string,
existing, err := clientset.InstanceGroupsFor(cluster).Get(groupName, metav1.GetOptions{})
if err != nil {
return err
// We expect a NotFound error when creating the instance group
if !errors.IsNotFound(err) {
return err
}
}
if existing != nil {