File tree Expand file tree Collapse file tree
main/java/land/oras/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -460,4 +460,24 @@ public static String currentTimestamp() {
460460 * Metric name for token refresh duration
461461 */
462462 public static final String METRIC_TAG_REALM = "realm" ;
463+
464+ /**
465+ * Flux CD config media type
466+ */
467+ public static final String FLUX_CD_CONFIG_MEDIA_TYPE = "application/vnd.cncf.flux.config.v1+json" ;
468+
469+ /**
470+ * Flux CD content media type
471+ */
472+ public static final String FLUX_CD_CONTENT_MEDIA_TYPE = "application/vnd.cncf.flux.content.v1.tar+gzip" ;
473+
474+ /**
475+ * Helm config media type
476+ */
477+ public static final String HELM_CONFIG_MEDIA_TYPE = "application/vnd.cncf.helm.config.v1+json" ;
478+
479+ /**
480+ * Helm content media type
481+ */
482+ public static final String HELM_CONTENT_MEDIA_TYPE = "application/vnd.cncf.helm.chart.content.v1.tar+gzip" ;
463483}
Original file line number Diff line number Diff line change @@ -49,17 +49,15 @@ void shouldAssembleArtifact() {
4949
5050 // The compressed manifests
5151 Path archive = Paths .get ("src/test/resources/archives" ).resolve ("flux-manifests.tgz" );
52- String configMediaType = "application/vnd.cncf.flux.config.v1+json" ;
53- String contentMediaType = "application/vnd.cncf.flux.content.v1.tar+gzip" ;
5452
5553 Map <String , String > annotations = Map .of (
5654 Const .ANNOTATION_REVISION , "@sha1:6d63912ed9a9443dd01fbfd2991173a246050079" ,
5755 Const .ANNOTATION_SOURCE , "git@github.com:jonesbusy/oras-java.git" ,
5856 Const .ANNOTATION_CREATED , Const .currentTimestamp ());
5957
6058 // Create objects
61- Config config = Config .empty ().withMediaType (configMediaType );
62- Layer layer = Layer .fromFile (archive ).withMediaType (contentMediaType );
59+ Config config = Config .empty ().withMediaType (Const . FLUX_CD_CONFIG_MEDIA_TYPE );
60+ Layer layer = Layer .fromFile (archive ).withMediaType (Const . FLUX_CD_CONTENT_MEDIA_TYPE );
6361 Manifest manifest =
6462 Manifest .empty ().withConfig (config ).withLayers (List .of (layer )).withAnnotations (annotations );
6563
Original file line number Diff line number Diff line change @@ -49,17 +49,15 @@ void shouldAssembleArtifact() {
4949
5050 // The compressed manifests
5151 Path archive = Paths .get ("src/test/resources/archives" ).resolve ("jenkins-chart.tgz" );
52- String configMediaType = "application/vnd.cncf.helm.config.v1+json" ;
53- String contentMediaType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip" ;
5452
5553 Map <String , String > annotations = Map .of (
5654 Const .ANNOTATION_DESCRIPTION , "Test helm chart" ,
5755 Const .ANNOTATION_SOURCE , "git@github.com:jonesbusy/oras-java.git" ,
5856 Const .ANNOTATION_CREATED , Const .currentTimestamp ());
5957
6058 // Create objects
61- Config config = Config .empty ().withMediaType (configMediaType );
62- Layer layer = Layer .fromFile (archive ).withMediaType (contentMediaType );
59+ Config config = Config .empty ().withMediaType (Const . HELM_CONFIG_MEDIA_TYPE );
60+ Layer layer = Layer .fromFile (archive ).withMediaType (Const . HELM_CONTENT_MEDIA_TYPE );
6361 Manifest manifest =
6462 Manifest .empty ().withConfig (config ).withLayers (List .of (layer )).withAnnotations (annotations );
6563
You can’t perform that action at this time.
0 commit comments