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

minify manifest json #29

Closed
wants to merge 3 commits into from
Closed

minify manifest json #29

wants to merge 3 commits into from

Conversation

Gsealy
Copy link
Contributor

@Gsealy Gsealy commented Nov 27, 2020

fix: #28

Signed-off-by: Gsealy <jiaojingwei1001@hotmail.com>
@@ -317,7 +317,7 @@ func cryptChildren(ctx context.Context, cs content.Store, desc ocispec.Descripto
Layers: newLayers,
}

mb, err := json.MarshalIndent(newManifest, "", " ")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there are couple other instances of this, could you change them at the same time? Thanks!

cmd/ctr/commands/commands.go:181:	b, err := json.MarshalIndent(x, "", "    ")
images/encryption/encryption.go:320:		mb, err := json.MarshalIndent(newManifest, "", "   ")
images/encryption/encryption.go:400:		mb, err := json.MarshalIndent(newIndex, "", "   ")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Signed-off-by: Gsealy <jiaojingwei1001@hotmail.com>
@Gsealy Gsealy requested a review from lumjjb December 11, 2020 01:44
@@ -178,7 +178,7 @@ func LabelArgs(labelStrings []string) map[string]string {

// PrintAsJSON prints input in JSON format
func PrintAsJSON(x interface{}) {
b, err := json.MarshalIndent(x, "", " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just leave it as is. This whole file is an extended copy of the corresponding file from containerd: https://github.com/containerd/containerd/blob/v1.5.0-beta.0/cmd/ctr/commands/commands.go#L206

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can compress it when save or output OCI image tar? not affect input json

@Gsealy
Copy link
Contributor Author

Gsealy commented Jun 22, 2022

closed.

@Gsealy Gsealy closed this Jun 22, 2022
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.

minify/compress manifest json
3 participants