Skip to content
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

Merged
merged 2 commits into from
Aug 19, 2021
Merged

feat: display registry status in status cmd #936

merged 2 commits into from
Aug 19, 2021

Conversation

rkpattnaik780
Copy link
Contributor

rhoas status should display the status of registry command if selected.

Closes #902

Screenshot from 2021-08-19 14-07-55

Verification Steps

  1. Select a service registry using the service-registry use command.
./rhoas service-registry use --id 195
  1. Run the rhoas status command, you should be able to see the status of registry along with kafka instance.
  2. To see the status of registry specifically, run ./rhoas status registry

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@craicoverflow craicoverflow self-requested a review August 19, 2021 09:01
@wtrocki
Copy link
Collaborator

wtrocki commented Aug 19, 2021

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).

pkg/cmd/status/status.go Outdated Show resolved Hide resolved
@wtrocki
Copy link
Collaborator

wtrocki commented Aug 19, 2021

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).

Copy link
Collaborator

@wtrocki wtrocki left a 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

)

var validServices = []string{kafkaSvcName}
var validServices = []string{kafkaSvcName, registrySvcName}
Copy link
Collaborator

@wtrocki wtrocki Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var validServices = []string{kafkaSvcName, registrySvcName}
var validServices = []string{kafkaSvcName}
if profile.isDevEnaled() {
validServices = []string{kafkaSvcName, registrySvcName}
}

Copy link
Contributor

@craicoverflow craicoverflow left a 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.

@@ -24,10 +24,11 @@ import (
)

const (
kafkaSvcName = "kafka"
kafkaSvcName = "kafka"
registrySvcName = "registry"
Copy link
Contributor

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"

)

var validServices = []string{kafkaSvcName}
var validServices = []string{kafkaSvcName, registrySvcName}
Copy link
Contributor

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.

@@ -75,6 +85,21 @@ func Get(ctx context.Context, opts *Options) (status *Status, ok bool, err error
}
}

if stringInSlice("registry", opts.Services) {
Copy link
Contributor

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.

)

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"`
Copy link
Contributor

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"?

Suggested change
Registry *RegistryStatus `json:"registry,omitempty" title:"Registry"`
Registry *RegistryStatus `json:"registry,omitempty" title:"Service Registry"`

Copy link
Collaborator

@wtrocki wtrocki left a 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

@wtrocki wtrocki merged commit 0589faa into main Aug 19, 2021
@wtrocki wtrocki deleted the status_registry branch August 19, 2021 16:10
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.

Service registry support in status command
3 participants