| 1 | package Net::Kubernetes::Resource::Pod; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Object representatioon of a Kubernetes Pod | ||||||||||||||||||||||||||||
| 3 | 4 | $Net::Kubernetes::Resource::Pod::VERSION = '1.03'; | |||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | extends 'Net::Kubernetes::Resource'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | with 'Net::Kubernetes::Resource::Role::State'; | |||||||||||||||||||||||||||
| 9 | 4 | with 'Net::Kubernetes::Resource::Role::Spec'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 3 | ▶ | sub logs { | ||||||||||||||||||||||||||
|
Subroutine
logs: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 3 | my($self, %options) = @_; | |||||||||||||||||||||||||||
| 14 | 3 | ▶ | if (scalar(@{ $self->spec->{containers} }) > 1 && ! exists($options{container})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
scalar @{$self->spec->{"containers"};} > 1 and not exists $options{"container"}
MC/DC50%1/2
scalar @{$self->spec->{"containers"};} > 1 and not exists $options{"container"}
scalar @{$self->spec->{"containers"};} > 1
not exists $options{"container"}
Truth table66%2/3
A and not(B)
A= scalar @{$self->spec->{"containers"};} > 1B= not exists $options{"container"}
| |||||||||||||||||||||||||||||
| 15 | 1 | Net::Kunbernetes::Exception::ClientException->throw(code=>499, message=>'Must provide container to get logs from a multi-container pod'); | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | my $uri = URI->new($self->path.'/log'); | |||||||||||||||||||||||||||
| 19 | 2 | $uri->query_form(\%options); | |||||||||||||||||||||||||||
| 20 | 2 | my $res = $self->ua->request($self->create_request(GET => $uri)); | |||||||||||||||||||||||||||
| 21 | 2 | ▶ | if ($res->is_success) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 2 | return $res->content; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 4 | return 42; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||||||||||