File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ const CONFIG_FILE: &str = "config.json";
3838const LATEST_TAG : & str = "latest" ;
3939const MANIFEST_FILE : & str = "manifest.json" ;
4040
41+ /// Env var to force use of archive layers when publishing a Spin app
42+ const SPIN_OCI_ARCHIVE_LAYERS_OPT : & str = "SPIN_OCI_ARCHIVE_LAYERS" ;
43+
4144const MAX_PARALLEL_PULL : usize = 16 ;
4245/// Maximum layer count allowed per app, set in accordance to the lowest
4346/// known maximum per image in well-known OCI registry implementations.
@@ -159,9 +162,11 @@ impl Client {
159162 . await
160163 . context ( "could not assemble layers for locked application" ) ?;
161164
162- // If layer count exceeds MAX_LAYER_COUNT-1, assemble archive layers instead.
163- // (We'll be adding one more layer to represent the locked application config.)
164- if layers. len ( ) > MAX_LAYER_COUNT - 1 {
165+ // If SPIN_OCI_ARCHIVE_LAYERS_OPT is set *or* if layer count exceeds MAX_LAYER_COUNT-1,
166+ // assemble archive layers instead. (An additional layer to represent the locked
167+ // application config is added.)
168+ if std:: env:: var ( SPIN_OCI_ARCHIVE_LAYERS_OPT ) . is_ok ( ) || layers. len ( ) > MAX_LAYER_COUNT - 1
169+ {
165170 locked_app = locked. clone ( ) ;
166171 layers = self
167172 . assemble_layers ( & mut locked_app, AssemblyMode :: Archive )
You can’t perform that action at this time.
0 commit comments