File tree Expand file tree Collapse file tree 5 files changed +41
-21
lines changed
Expand file tree Collapse file tree 5 files changed +41
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -54,9 +54,19 @@ one = '''Process of watching ManagedKafkaConnection timed out'''
5454[cluster .kubernetes .watchForManagedKafkaStatus .log .info .wait ]
5555one = '''
5656Waiting for status from ManagedKafkaConnection resource.
57- Created ManagedKafkaConnection can be already injected to your application
58- by creating Service Binding (requires ServiceBindingOperator):
57+ Created ManagedKafkaConnection can be already injected to your application:
58+ You can bind credentials to your application using:
59+ - odo cli
60+ - openshift topology view
61+ - manually using kubectl
62+
63+ To bind you need to have Service Binding Operator installed:
64+ https://github.com/redhat-developer/service-binding-operator
65+ '''
5966
67+ [cluster .kubernetes .watchForManagedKafkaStatus .binding ]
68+ one = '''
69+ cat <<EOF | kubectl apply -f -
6070apiVersion: binding.operators.coreos.com/v1alpha1
6171kind: ServiceBinding
6272metadata:
@@ -75,10 +85,11 @@ spec:
7585 version: {{.Version}}
7686 kind: {{.Kind}}
7787 name: {{.Name}}
78-
79- For OpenShift you can also create service binding by using odo cli or directly in the UI topology view.
88+ EOF
8089'''
8190
91+
92+
8293[cluster .kubernetes .serviceaccountsecret .error .createError ]
8394one = ' Could not create Service Account secret'
8495
Original file line number Diff line number Diff line change 22one = ' cluster'
33
44[cluster .cmd .shortDescription ]
5- one = ' View and perform operations on your Kubernetes or OpenShift cluster'
5+ one = ' View and perform operations on your Kubernetes or OpenShift cluster'
6+
7+ [cluster .cmd .example ]
8+ one = '''
9+ # connect with cluster without including currently selected services
10+ $ rhoas cluster connect --ignore-context
11+
12+ # connect with cluster using specified token
13+ $ rhoas cluster connect --token=value
14+
15+ # connect with cluster and save script to create service binding
16+ $ rhoas cluster connect --force > create_service_binding.sh
17+ '''
18+
19+
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ package cluster
66import (
77 "context"
88 "fmt"
9+ "os"
10+ "time"
11+
912 "github.com/bf2fc6cc711aee1a0c2a/cli/internal/localizer"
1013 kasclient "github.com/bf2fc6cc711aee1a0c2a/cli/pkg/api/kas/client"
1114 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -14,7 +17,6 @@ import (
1417 "k8s.io/apimachinery/pkg/runtime"
1518 "k8s.io/apimachinery/pkg/runtime/schema"
1619 "k8s.io/apimachinery/pkg/watch"
17- "time"
1820)
1921
2022var MKCGroup = "rhoas.redhat.com"
@@ -82,6 +84,10 @@ func getKafkaConnectionsAPIURL(namespace string) string {
8284func watchForManagedKafkaStatus (c * KubernetesCluster , crName string , namespace string ) error {
8385 c .logger .Info (localizer .MustLocalize (& localizer.Config {
8486 MessageID : "cluster.kubernetes.watchForManagedKafkaStatus.log.info.wait" ,
87+ }))
88+
89+ fmt .Fprint (os .Stdout , localizer .MustLocalize (& localizer.Config {
90+ MessageID : "cluster.kubernetes.watchForManagedKafkaStatus.binding" ,
8591 TemplateData : map [string ]interface {}{
8692 "Name" : crName ,
8793 "Namespace" : namespace ,
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ import (
1111// NewServiceAccountCommand creates a new command sub-group to manage service accounts
1212func NewClusterCommand (f * factory.Factory ) * cobra.Command {
1313 cmd := & cobra.Command {
14- Use : localizer .MustLocalizeFromID ("cluster.cmd.use" ),
15- Short : localizer .MustLocalizeFromID ("cluster.cmd.shortDescription" ),
16- Args : cobra .ExactArgs (1 ),
14+ Use : localizer .MustLocalizeFromID ("cluster.cmd.use" ),
15+ Short : localizer .MustLocalizeFromID ("cluster.cmd.shortDescription" ),
16+ Example : localizer .MustLocalizeFromID ("cluster.cmd.example" ),
17+ Args : cobra .ExactArgs (1 ),
1718 }
1819
1920 cmd .AddCommand (
You can’t perform that action at this time.
0 commit comments