Skip to content

Commit

Permalink
[PLAT-15432] remove status,sizeInBytes from manifest.json file
Browse files Browse the repository at this point in the history
Summary:
`Manifest.json` file is created before any of the support bundle components are collected so the size is always 0 and status is always running.
This is the case for all support bundles and so doesn't make sense to include them in the manifest.

Test Plan: created support bundle and verified that the fields are not present in manifest.json file.

Reviewers: #yba-api-review!, skurapati

Reviewed By: skurapati

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D38390
  • Loading branch information
asharma-yb committed Sep 26, 2024
1 parent 3ffe5a7 commit 254e164
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.yugabyte.yw.commissioner.tasks;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Throwables;
import com.google.inject.Inject;
import com.typesafe.config.Config;
Expand Down Expand Up @@ -121,11 +123,11 @@ public Path generateBundle(SupportBundle supportBundle)

// add the supportBundle metadata into the bundle
try {
JsonNode sbJson = Json.toJson(supportBundle);
((ObjectNode) sbJson).remove("status");
((ObjectNode) sbJson).remove("sizeInBytes");
supportBundleUtil.saveMetadata(
customer,
bundlePath.toAbsolutePath().toString(),
Json.toJson(supportBundle),
"manifest.json");
customer, bundlePath.toAbsolutePath().toString(), sbJson, "manifest.json");
} catch (Exception e) {
// Log the error and continue with the rest of support bundle collection.
log.error("Error occurred while collecting support bundle manifest json", e);
Expand Down

0 comments on commit 254e164

Please sign in to comment.