litmuschaos / litmusctl

Command-Line tool to manage Litmuschaos's agent plane
Apache License 2.0
24 stars 42 forks source link

litmusctl 1.5.0 connect chaos-infra failed with openshift using namespace installation mode #225

Open dariolstella opened 4 months ago

dariolstella commented 4 months ago

$ litmusctl config use-account

Host endpoint where litmus is installed: https://

Username: admin

✅ Successfully set the current account to 'admin' at 'https://'

$ litmusctl connect chaos-infra Project list:

  1. admin-project

Select a project [Range: 1-1]: 1

Installation Modes:

  1. Cluster
  2. Namespace

Select Mode [Default: cluster] [Range: 1-2]: 2

🏃 Running prerequisites check.... 🔑 role ❌ 🔑 rolebinding ❌ 🚫 You don't have sufficient permissions. 🙄 Please use a service account with sufficient permissions.

Looking at litmus-server-role the following is set -->

And in the ValidateSAPermissions function on ops.go the resources are like -->

if mode == "cluster" { resources = [2]string{"clusterrole", "clusterrolebinding"} } else { resources = [2]string{"role", "rolebinding"}

I guess that should be 'roles' and 'rolesbinding', right?.

Nageshbansal commented 4 months ago

hey @Jonsy13 could you PTAL

Jonsy13 commented 4 months ago

Hi @dariolstella The check is correct as we are checking for verbs. Can you please check if you have the required permissions via below commands -

kubectl auth can-i create role
kubectl auth can-i create rolebindings

both commands should result in yes output

dariolstella commented 4 months ago

Hi @Jonsy13. Here's the output -> % oc auth can-i create role yes

% oc auth can-i create rolebindings yes

Jonsy13 commented 4 months ago

Thanks @dariolstella Will look into it. cc: @SarthakJain26