-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: display registry status in status cmd #936
Conversation
Verified. Do we need to use dev mode for status? It feels like the only side effect in production would be to see debug message (in else statement). |
Verified. Do we need to use dev mode for status? It feels like the only side effect in production would be to see debug message (in else statement). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - minor questions asked but no need to address those
pkg/cmd/status/status.go
Outdated
) | ||
|
||
var validServices = []string{kafkaSvcName} | ||
var validServices = []string{kafkaSvcName, registrySvcName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var validServices = []string{kafkaSvcName, registrySvcName} | |
var validServices = []string{kafkaSvcName} | |
if profile.isDevEnaled() { | |
validServices = []string{kafkaSvcName, registrySvcName} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but I think the most important one is that this should only be visible with RHOAS_DEV
.
pkg/cmd/status/status.go
Outdated
@@ -24,10 +24,11 @@ import ( | |||
) | |||
|
|||
const ( | |||
kafkaSvcName = "kafka" | |||
kafkaSvcName = "kafka" | |||
registrySvcName = "registry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the service will be known to the user as "service-registry"
pkg/cmd/status/status.go
Outdated
) | ||
|
||
var validServices = []string{kafkaSvcName} | ||
var validServices = []string{kafkaSvcName, registrySvcName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The registry service features should currently only be visible/accessible when the RHOAS_DEV
flag is enabled.
pkg/status/status.go
Outdated
@@ -75,6 +85,21 @@ func Get(ctx context.Context, opts *Options) (status *Status, ok bool, err error | |||
} | |||
} | |||
|
|||
if stringInSlice("registry", opts.Services) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be wrapped in a RHOAS_DEV=true
conditional.
pkg/status/status.go
Outdated
) | ||
|
||
const tagTitle = "title" | ||
|
||
type Status struct { | ||
Kafka *KafkaStatus `json:"kafka,omitempty" title:"Kafka"` | ||
Kafka *KafkaStatus `json:"kafka,omitempty" title:"Kafka"` | ||
Registry *RegistryStatus `json:"registry,omitempty" title:"Registry"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this "Service Registry"?
Registry *RegistryStatus `json:"registry,omitempty" title:"Registry"` | |
Registry *RegistryStatus `json:"registry,omitempty" title:"Service Registry"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified with and without dev preview
rhoas status
should display the status of registry command if selected.Closes #902
Verification Steps
service-registry
use command.rhoas status
command, you should be able to see the status of registry along with kafka instance../rhoas status registry
Type of change
Checklist