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";
38
38
const LATEST_TAG : & str = "latest" ;
39
39
const MANIFEST_FILE : & str = "manifest.json" ;
40
40
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
+
41
44
const MAX_PARALLEL_PULL : usize = 16 ;
42
45
/// Maximum layer count allowed per app, set in accordance to the lowest
43
46
/// known maximum per image in well-known OCI registry implementations.
@@ -159,9 +162,11 @@ impl Client {
159
162
. await
160
163
. context ( "could not assemble layers for locked application" ) ?;
161
164
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
+ {
165
170
locked_app = locked. clone ( ) ;
166
171
layers = self
167
172
. assemble_layers ( & mut locked_app, AssemblyMode :: Archive )
You can’t perform that action at this time.
0 commit comments