Skip to content

Commit

Permalink
Allow cluster maintenance when channel is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed May 6, 2020
1 parent f5093e4 commit ad62725
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 @@ -27,6 +27,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"
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/validation"
Expand Down Expand Up @@ -130,7 +131,7 @@ func RunCreateInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string,

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

existing, err := clientset.InstanceGroupsFor(cluster).Get(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 @@ -25,6 +25,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 @@ -96,7 +97,7 @@ func RunEditInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string, ou

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 @@ -171,7 +171,7 @@ func (c *ApplyClusterCmd) Run() 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 @@ -116,6 +116,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 ad62725

Please sign in to comment.