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

Add crictl [create,runp,run,pull] jsonschema subcommands #1449

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

saschagrunert
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

The jsonschema / js subcommands will print the pod and/or container config JSON schemas for end users to understand where the data is coming from.

Which issue(s) this PR fixes:

Refers to kubernetes/website#40360

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Added `crictl [create,runp,run,pull] jsonschema` subcommands to display the pod and/or container config JSON schema.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 11, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 11, 2024
@saschagrunert saschagrunert force-pushed the json-schema branch 2 times, most recently from 79ef7af to 63e11d5 Compare June 11, 2024 10:27
@saschagrunert
Copy link
Member Author

@kubernetes-sigs/cri-tools-maintainers PTAL

cmd/crictl/util.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2024
@saschagrunert
Copy link
Member Author

@kubernetes-sigs/cri-tools-maintainers PTAL

Subcommands: []*cli.Command{{
Name: "jsonschema",
Aliases: []string{"js"},
Usage: "Display the JSON schema for the pod-config.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

why this for the image subcommand?

Copy link
Contributor

@haircommander haircommander Jun 27, 2024

Choose a reason for hiding this comment

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

pedantically: seems like a bleeding of the runtime service into the image client (not like they're actually separated in practice)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's added here because of crictl pull --pod-config pod-config.[json|yam].

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I understand the logic of using it in pull. What is the output of a command will be?

Copy link
Member Author

Choose a reason for hiding this comment

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

@SergeyKanzhelev the sandbox config provides additional context during the image pull. For example CRI-O uses it to separate pulls into dedicated cgroups:

https://github.com/cri-o/cri-o/blob/88fe8766ede790f465e1e86b0eccba0818736b32/server/image_pull.go#L47

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2024
The `jsonschema` / `js` subcommands will print the pod and/or container
config JSON schemas for end users to understand where the data is coming
from.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2024
@k8s-ci-robot k8s-ci-robot merged commit 254cea5 into kubernetes-sigs:master Jun 29, 2024
23 checks passed
@saschagrunert saschagrunert deleted the json-schema branch July 1, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants