-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: odigos describe remote flag to run the cluster (#1541)
This can be used to run `odigos describe` in machines where `kubectl` may lacks permissions for some of the resources. It runs the describe in the ui deployment which can access the relevant resources, and return it with http to the cli
- Loading branch information
Showing
10 changed files
with
587 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ui/node_modules | ||
frontend/node_modules | ||
.git/ | ||
Dockerfile | ||
odiglet/Dockerfile | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package endpoints | ||
|
||
import ( | ||
"github.com/gin-gonic/gin" | ||
"github.com/odigos-io/odigos/frontend/kube" | ||
"github.com/odigos-io/odigos/k8sutils/pkg/describe" | ||
) | ||
|
||
func DescribeSource(c *gin.Context, ns string, kind string, name string) { | ||
ctx := c.Request.Context() | ||
switch kind { | ||
case "deployment": | ||
describeText := describe.DescribeDeployment(ctx, kube.DefaultClient.Interface, kube.DefaultClient.OdigosClient, ns, name) | ||
c.Writer.WriteString(describeText) | ||
case "daemonset": | ||
describeText := describe.DescribeDaemonSet(ctx, kube.DefaultClient.Interface, kube.DefaultClient.OdigosClient, ns, name) | ||
c.Writer.WriteString(describeText) | ||
case "statefulset": | ||
describeText := describe.DescribeStatefulSet(ctx, kube.DefaultClient.Interface, kube.DefaultClient.OdigosClient, ns, name) | ||
c.Writer.WriteString(describeText) | ||
default: | ||
c.JSON(404, gin.H{ | ||
"message": "kind not supported", | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.