Kubernetes/Resource/Pod.pm

filter: Statementstmt 100% 17 / 17 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 89.6% 26 / 29 CC 4 SCAR 12.3
CC
4
Cov
92%
logs
4.0
BEGIN
1.0
CRAP 3.4
« Kubernetes/Resource/Secret.pm ↑ Summary Kubernetes/Role/ResourceFetcher.pm »
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
BranchTrueFalseTotal
if (scalar @{$self->spec->{"containers"};} > 1 and not exists $options{"container"}) 1 2 3
Condition66%2/3
scalar @{$self->spec->{"containers"};} > 1 and not exists $options{"container"}
!ll&&!rl&&r
201
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"}
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if ($res->is_success) 2 0 2
22 2 return $res->content;
23 }
24 }
25  
26 4 return 42;
27  
28 __END__
« Kubernetes/Resource/Secret.pm ↑ Summary Kubernetes/Role/ResourceFetcher.pm »