12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/docker_swarm/concerns/updatable.rb', line 12
def update(new_attributes = {}, **opts)
registry_auth = opts.delete(:registry_auth)
registry_auth_from = opts.delete(:registry_auth_from)
, auth_query = RegistryAuth.resolve(registry_auth: registry_auth, registry_auth_from: registry_auth_from)
current_version = self.Version&.dig("Index")
attributes = new_attributes.merge(opts)
assign_attributes(attributes) if attributes.present?
return false unless valid?
Api.request(
action: self.class.routes[:update],
arguments: { id: self.ID },
query_params: { version: current_version }.merge(auth_query),
payload: payload_for_docker,
headers:
)
true
end
|