Skip to content

Instantly share code, notes, and snippets.

@crmaxx
Last active August 29, 2015 14:20
Show Gist options
  • Save crmaxx/81776d103cebc5a50d33 to your computer and use it in GitHub Desktop.
Save crmaxx/81776d103cebc5a50d33 to your computer and use it in GitHub Desktop.
code review
let(:pod) do
pod = Kubeclient::Pod.new
pod.metadata = {}
pod.kind = 'Pod'
pod.apiVersion = 'v1beta1'
pod.id = @id
pod.desiredState = {}
pod.desiredState.manifest = {}
pod.desiredState.manifest.version = 'v1beta1'
pod.desiredState.manifest.containers = [{
'name' => @id,
'image' => 'library/nginx',
'ports' => [{
'containerPort' => 80,
'name' => 'http'
}]
}]
pod.labels = {}
pod.labels.name = @id
pod
end
# эквивалетно
let(:pod) do
Kubeclient::Pod.new.tap |pod|
pod.metadata = {}
pod.kind = 'Pod'
pod.apiVersion = 'v1beta1'
pod.id = @id
pod.desiredState = {}
pod.desiredState.manifest = {}
pod.desiredState.manifest.version = 'v1beta1'
pod.desiredState.manifest.containers = [{
'name' => @id,
'image' => 'library/nginx',
'ports' => [{
'containerPort' => 80,
'name' => 'http'
}]
}]
pod.labels = {}
pod.labels.name = @id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment