1
1
//! Spin's client for distributing applications via OCI registries
2
2
3
- use std:: collections:: HashMap ;
3
+ use std:: collections:: { BTreeMap , HashMap } ;
4
4
use std:: path:: { Path , PathBuf } ;
5
5
6
6
use anyhow:: { bail, Context , Result } ;
@@ -97,6 +97,7 @@ impl Client {
97
97
& mut self ,
98
98
manifest_path : & Path ,
99
99
reference : impl AsRef < str > ,
100
+ annotations : Option < BTreeMap < String , String > > ,
100
101
) -> Result < Option < String > > {
101
102
let reference: Reference = reference
102
103
. as_ref ( )
@@ -115,7 +116,8 @@ impl Client {
115
116
)
116
117
. await ?;
117
118
118
- self . push_locked_core ( locked, auth, reference) . await
119
+ self . push_locked_core ( locked, auth, reference, annotations)
120
+ . await
119
121
}
120
122
121
123
/// Push a Spin application to an OCI registry and return the digest (or None
@@ -124,14 +126,16 @@ impl Client {
124
126
& mut self ,
125
127
locked : LockedApp ,
126
128
reference : impl AsRef < str > ,
129
+ annotations : Option < BTreeMap < String , String > > ,
127
130
) -> Result < Option < String > > {
128
131
let reference: Reference = reference
129
132
. as_ref ( )
130
133
. parse ( )
131
134
. with_context ( || format ! ( "cannot parse reference {}" , reference. as_ref( ) ) ) ?;
132
135
let auth = Self :: auth ( & reference) . await ?;
133
136
134
- self . push_locked_core ( locked, auth, reference) . await
137
+ self . push_locked_core ( locked, auth, reference, annotations)
138
+ . await
135
139
}
136
140
137
141
/// Push a Spin application to an OCI registry and return the digest (or None
@@ -141,6 +145,7 @@ impl Client {
141
145
locked : LockedApp ,
142
146
auth : RegistryAuth ,
143
147
reference : Reference ,
148
+ annotations : Option < BTreeMap < String , String > > ,
144
149
) -> Result < Option < String > > {
145
150
let mut locked_app = locked. clone ( ) ;
146
151
let mut layers = self
@@ -193,7 +198,7 @@ impl Client {
193
198
} ;
194
199
let oci_config =
195
200
oci_distribution:: client:: Config :: oci_v1_from_config_file ( oci_config_file, None ) ?;
196
- let manifest = OciImageManifest :: build ( & layers, & oci_config, None ) ;
201
+ let manifest = OciImageManifest :: build ( & layers, & oci_config, annotations ) ;
197
202
198
203
let response = self
199
204
. oci
0 commit comments