-
-
Save crmaxx/81776d103cebc5a50d33 to your computer and use it in GitHub Desktop.
code review
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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