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

Update kpt live init documentation. #1397

Merged
merged 1 commit into from
Feb 1, 2021
Merged

Conversation

runewake2
Copy link
Contributor

This updates the kpt live init cli help. This changes the text that is selected from online documentation via mdtogo. Flags are documented via the Cobra command config:

Initialize a package with a object to track previously applied resources

The init command initializes a package with a template resource which will
be used to track previously applied resources so that they can be pruned
when they are deleted.

The template resource is required by other live commands
such as apply, preview and destroy.

Usage:
  kpt live init DIRECTORY

Examples:

  # initialize a package
  kpt live init my-dir/

  # initialize a package with a specific name for the group of resources
  kpt live init --namespace=test my-dir/


Flags:
  -h, --help                  help for init
  -i, --inventory-id string   Identifier for group of applied resources. Must be composed of valid label characters.

This removes the duplicated Flag values and provides additional context for the command.

Note: other commands which have similar behavior to the original kpt live init --help have not been updated (for example kpt pkg init --help).

Fixes #1362

@mortent
Copy link
Contributor

mortent commented Jan 28, 2021

So there are two things here.

First, the documentation is out-of-date which is why the flags listed in the website docs and in the cli is not correct. We should update the flags listed in the website docs, and by running mdtogo the flags listed in the cli will also be updated.

Second, the format we use when we combine the docs taken from the site (with mdtogo) and the standard output from cobra, the flags are listed twice. This is something we could consider changing and I created an issue for this a while back: #439.

So I suggest we fix the incorrect documentation for the kpt live init command, and we can consider if we should prioritize updating the format of the cobra output and do that consistently for all commands.

@mikebz

@runewake2
Copy link
Contributor Author

The docs in this case are not necessarily out of date as much as they are confusing. Our website (and original mdtogo generated content) uses inventory-id and namespace as flags. Cobra uses the inventory-id flag and has a global flag for namespace. Because we have two Flags headers that are different reading it isn't clear which is the source of truth.

I'm not sure that the website docs are incorrect here. Calling out that you can specify the namespace of an inventory seems like relevant and useful information. We just render that information differently on the kpt cli.

There are a few other issues with mdtogo that may need to be fixed first before we try to redo the rest of the docs.

@mortent
Copy link
Contributor

mortent commented Feb 1, 2021

Yeah, the --namespace flag is a bit tricky here. Adding the additional explanation here does make sense, but it isn't quite aligned with the other commands. But I think this is an improvement, so let's merge this and we can revisit the bigger question on how we should structure the output from commands later.

@runewake2 runewake2 merged commit 8af1eae into kptdev:master Feb 1, 2021
@runewake2 runewake2 deleted the live-docs branch February 1, 2021 18:45
phanimarupaka pushed a commit to phanimarupaka/kpt that referenced this pull request Feb 5, 2021
phanimarupaka pushed a commit to phanimarupaka/kpt that referenced this pull request Feb 5, 2021
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.

kpt live init --help Displays Two Different Sets of Flags
3 participants