Skip to content

Commit

Permalink
Merge pull request #5045 from Patryk-Stefanski/OCPBUGS-44221
Browse files Browse the repository at this point in the history
OCPBUGS-44221: remove hard dependcy on kubeconfig for hypershift CLI
  • Loading branch information
openshift-merge-bot[bot] authored Nov 6, 2024
2 parents 3401ccf + 7473dba commit d9ed58b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/cluster/azure/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func DefaultOptions(client crclient.Client, log logr.Logger) (*RawCreateOptions,
NodePoolOpts: azurenodepool.DefaultOptions(),
}

if client == nil {
return rawCreateOptions, nil
}

techPreviewCM := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Namespace: "hypershift", Name: "feature-gate"}}
if err := client.Get(context.Background(), crclient.ObjectKeyFromObject(techPreviewCM), techPreviewCM); err != nil && !apierrors.IsNotFound(err) {
log.Info("Warning: Failed to get feature-gate configmap, proceeding without tech preview", "error", err)
Expand Down Expand Up @@ -472,8 +476,7 @@ func NewCreateCommand(opts *core.RawCreateOptions) *cobra.Command {

client, err := util.GetClient()
if err != nil {
opts.Log.Error(err, "Failed to get client")
return nil
opts.Log.Info(fmt.Sprintf("Failed to get client, proceeding without checking feature gate CM: %s", err.Error()))
}

azureOpts, err := DefaultOptions(client, opts.Log)
Expand Down

0 comments on commit d9ed58b

Please sign in to comment.