Apache Mesos
registry_puller.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __PROVISIONER_DOCKER_REGISTRY_PULLER_HPP__
18 #define __PROVISIONER_DOCKER_REGISTRY_PULLER_HPP__
19 
20 #include <process/owned.hpp>
21 #include <process/shared.hpp>
22 
23 #include <stout/try.hpp>
24 
25 #include <mesos/uri/fetcher.hpp>
26 
28 
30 
31 #include "slave/flags.hpp"
32 
33 namespace mesos {
34 namespace internal {
35 namespace slave {
36 namespace docker {
37 
38 // Forward declarations.
39 class RegistryPullerProcess;
40 
41 /*
42  * Pulls an image from docker registry.
43  */
44 class RegistryPuller : public Puller
45 {
46 public:
48  const Flags& flags,
49  const process::Shared<uri::Fetcher>& fetcher,
50  SecretResolver* secretResolver);
51 
52  ~RegistryPuller() override;
53 
62  const ::docker::spec::ImageReference& reference,
63  const std::string& directory,
64  const std::string& backend,
65  const Option<Secret>& config = None()) override;
66 
67 private:
69 
70  RegistryPuller(const RegistryPuller&) = delete;
71  RegistryPuller& operator=(const RegistryPuller&) = delete;
72 
74 };
75 
76 } // namespace docker {
77 } // namespace slave {
78 } // namespace internal {
79 } // namespace mesos {
80 
81 #endif // __PROVISIONER_DOCKER_REGISTRY_PULLER_HPP__
Definition: option.hpp:28
process::Future< std::vector< std::string > > pull(const ::docker::spec::ImageReference &reference, const std::string &directory, const std::string &backend, const Option< Secret > &config=None()) override
Pulls an image into a download directory.
Definition: registry_puller.hpp:44
Definition: check.hpp:33
Definition: flags.hpp:39
Definition: owned.hpp:26
Definition: spec.hpp:26
Definition: none.hpp:27
Definition: attributes.hpp:24
Definition: executor.hpp:48
Definition: resolver.hpp:34
Definition: spec.hpp:35
Definition: parse.hpp:33
static Try< process::Owned< Puller > > create(const Flags &flags, const process::Shared< uri::Fetcher > &fetcher, SecretResolver *secretResolver)
Definition: future.hpp:58