File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ func main() {
8686 Usage : "use path style for bucket paths" ,
8787 EnvVar : "PLUGIN_PATH_STYLE" ,
8888 },
89+ cli.StringFlag {
90+ Name : "cache-control" ,
91+ Usage : "set cache-control header for uploaded objects" ,
92+ EnvVar : "PLUGIN_CACHE_CONTROL" ,
93+ },
8994 cli.BoolTFlag {
9095 Name : "yaml-verified" ,
9196 Usage : "Ensure the yaml was signed" ,
@@ -119,6 +124,7 @@ func run(c *cli.Context) error {
119124 StripPrefix : c .String ("strip-prefix" ),
120125 Exclude : c .StringSlice ("exclude" ),
121126 Encryption : c .String ("encryption" ),
127+ CacheControl : c .String ("cache-control" ),
122128 PathStyle : c .Bool ("path-style" ),
123129 DryRun : c .Bool ("dry-run" ),
124130 YamlVerified : c .BoolT ("yaml-verified" ),
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ type Plugin struct {
4848 // bucket-owner-full-control
4949 Access string
5050
51+ // Sets the Cache-Control header on each uploaded object
52+ CacheControl string
53+
5154 // Copies the files from the specified directory.
5255 // Regexp matching will apply to match multiple
5356 // files
@@ -171,6 +174,10 @@ func (p *Plugin) Exec() error {
171174 putObjectInput .ServerSideEncryption = & (p .Encryption )
172175 }
173176
177+ if p .CacheControl != "" {
178+ putObjectInput .CacheControl = & (p .CacheControl )
179+ }
180+
174181 _ , err = client .PutObject (putObjectInput )
175182
176183 if err != nil {
You can’t perform that action at this time.
0 commit comments