Skip to content

Conversation

@gianarb
Copy link

@gianarb gianarb commented Dec 22, 2025

What

This commit replaces the datumctl get command that currently supports
organizations only with the kubectl get command.

DATUMCTL_EXPERIMENTAL=true go run main.go get projects --organization-id personal-org-f9a87347
NAME                   READY   AGE
shippingbytes-jh601e   True    87d
DATUMCTL_EXPERIMENTAL=true go run main.go get domains --project-id shippingbytes-jh601e
NAME       DOMAIN NAME   AGE   VERIFIED
hello-it   hello.it      46h   False
DATUMCTL_EXPERIMENTAL=true go run main.go get organizationmemberships --all-namespaces
NAME                   READY   AGE
shippingbytes-jh601e   True    87d

It also adds support for -v the same used by the kubectl and for two
new commands: api-resources and api-versions

Why

We want to offer a fimilar environment to interact with for users coming from
Kubernetes. No better way to achive that than using the kubectl code itself.

For Reviewer

I decied to open this PR now becuase I am working at it from a couple of days
and the features are there, I want other people to look at it.

The implementation is pretty rusty I am still not sure about how to properly
combine clientcmd.ConfigFlags an the Factory. I wrote Datum implementation to
see if I was able to get somewhere but I feel we can do better. Primarly
because I had to modify the clientcmd to support --all-namespaces and it
sounds pretty wrong!

I am open for suggesitions

@scotwells
Copy link
Contributor

scotwells commented Dec 22, 2025

@gianarb FYI I had to run go mod tidy to get this to build on a fresh checkout.

$ go build -o datumctl .
go: updates to go.mod needed; to update it:
        go mod tidy
$ go mod tidy
$ go build -o datumctl .
$ ./datumctl --help
A CLI for interacting with the Datum platform
...

This commit replaces the datumctl `get` command that currently supports
`organizations` only with the kubectl get command.

```
DATUMCTL_EXPERIMENTAL=true go run main.go get projects --organization-id personal-org-f9a87347
NAME                   READY   AGE
shippingbytes-jh601e   True    87d
```

```
DATUMCTL_EXPERIMENTAL=true go run main.go get domains --project-id shippingbytes-jh601e
NAME       DOMAIN NAME   AGE   VERIFIED
hello-it   hello.it      46h   False
```

```
DATUMCTL_EXPERIMENTAL=true go run main.go get organizationmemberships --all-namespaces
NAME                   READY   AGE
shippingbytes-jh601e   True    87d
```

It also adds support for `-v` the same used by the kubectl and for two
new commands: `api-resources` and `api-versions`

Signed-off-by: Gianluca Arbezzano <ciao@gianarb.it>
@gianarb gianarb force-pushed the feat/experimental-kubectl-get branch from 292e9f3 to 2dfabc0 Compare December 22, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants