Skip to content

Commit

Permalink
Merge pull request #9053 from johngmyers/channels-dependency
Browse files Browse the repository at this point in the history
Allow cluster maintenance when channel is unavailable
  • Loading branch information
k8s-ci-robot authored May 6, 2020
2 parents 4f6496c + 126c4c8 commit 486c20f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/kops/create_ig.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/validation"
Expand Down Expand Up @@ -132,7 +133,7 @@ func RunCreateInstanceGroup(ctx context.Context, f *util.Factory, cmd *cobra.Com

channel, err := cloudup.ChannelForCluster(cluster)
if err != nil {
return err
klog.Warningf("%v", err)
}

existing, err := clientset.InstanceGroupsFor(cluster).Get(ctx, groupName, metav1.GetOptions{})
Expand Down
3 changes: 2 additions & 1 deletion cmd/kops/edit_instancegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/validation"
Expand Down Expand Up @@ -98,7 +99,7 @@ func RunEditInstanceGroup(ctx context.Context, f *util.Factory, cmd *cobra.Comma

channel, err := cloudup.ChannelForCluster(cluster)
if err != nil {
return err
klog.Warningf("%v", err)
}

clientset, err := rootCommand.Clientset()
Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/apply_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error {

channel, err := ChannelForCluster(c.Cluster)
if err != nil {
return err
klog.Warningf("%v", err)
}
c.channel = channel

Expand Down
3 changes: 3 additions & 0 deletions upup/pkg/fi/cloudup/populate_instancegroup_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ func PopulateInstanceGroupSpec(cluster *kops.Cluster, input *kops.InstanceGroup,

if ig.Spec.Image == "" {
ig.Spec.Image = defaultImage(cluster, channel)
if ig.Spec.Image == "" {
return nil, fmt.Errorf("unable to determine default image for InstanceGroup %s", ig.ObjectMeta.Name)
}
}

if ig.Spec.Tenancy != "" && ig.Spec.Tenancy != "default" {
Expand Down

0 comments on commit 486c20f

Please sign in to comment.