-
Notifications
You must be signed in to change notification settings - Fork 589
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
rpk profile: more #11296
rpk profile: more #11296
Conversation
6aa1dee
to
6f9c31d
Compare
6f9c31d
to
2759ae4
Compare
Force-push change: ducktape test modification for the |
04cd087
to
2759ae4
Compare
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!
func (c *Config) ensureBrokerAddrs() { | ||
{ | ||
dst := &c.redpandaYaml | ||
if len(dst.Rpk.KafkaAPI.Brokers) == 0 { | ||
dst.Rpk.KafkaAPI.Brokers = []string{net.JoinHostPort("127.0.0.1", strconv.Itoa(DefaultKafkaPort))} | ||
} | ||
if len(dst.Rpk.AdminAPI.Addresses) == 0 { | ||
dst.Rpk.AdminAPI.Addresses = []string{net.JoinHostPort("127.0.0.1", strconv.Itoa(DefaultAdminPort))} | ||
} | ||
} | ||
{ | ||
dst := c.rpkYaml.Profile(c.rpkYaml.CurrentProfile) // must exist by this function | ||
if len(dst.KafkaAPI.Brokers) == 0 { | ||
dst.KafkaAPI.Brokers = []string{net.JoinHostPort("127.0.0.1", strconv.Itoa(DefaultKafkaPort))} | ||
} | ||
if len(dst.AdminAPI.Addresses) == 0 { | ||
dst.AdminAPI.Addresses = []string{net.JoinHostPort("127.0.0.1", strconv.Itoa(DefaultAdminPort))} | ||
} | ||
} | ||
} | ||
|
||
// We merge redpanda.yaml's rpk section back into rpk.yaml's profile. This |
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.
does this do what i think it does? i dont have to add the broker address at the end of brokers anymore? because if so... 🥂
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.
Looks good overall, I like the idea of clarifying and improving the experience of profiles.
Exits without additional formatting, if the input string is already formatted.
This might belong in rpk profile prompt; it's a bit niche.
* clear unsets any current profile * current prints the current profile name
This allows cloning profiles or easily transferring a profile between laptops.
This allows putting `$(rpk profile prompt)` in your PS1
This finally allows for modifying settings of rpk itself. This will be wired through in a future commit.
…stable The stable column is different from the HWM in two cases: 1, and far more common: Records were produced between the HWM and LSO. 2, less common: Transactions are being used. We always requested the stable offset after HWM, so frequently, the stable offset would look higher than the HWM (which is wrong!), and it would actually be equal behind the scenes but only look different due to time. Hiding it by default is less confusing, and requesting the stable offsets second rather than third prevents stable appearing higher.
If $HOME is unset, we will not load nor write an rpk.yaml. Trying to write will fail, but loading will just use defaults or just use values from redpanda.yaml or env or flags.
-v=info by default was confusing and as it turns out, when you want logs, you almost always want debug logs (for now). We can switch back later if need be.
* We always want to show all defaults -- showing everything makes it easier for the user to know what is possible for modify * We always want to show the profile name since it is always useful
This will let user pick an specific profile while running any command. Useful when you want to run the same across multiple profiles.
This PRs adds some missing features of rpk profile:
--stable
torpk topic describe
to only print thestable
column if the flag is used.-v
change to default to DEBUG level instead of INFO.brokers
,api-urls
,admin-api-tls
, etc...)--profile
that let users pick profiles while running a single rpk command.Backports Required
Release Notes