| 1 | package Langertha::Holmgang::Sim::Linux::Kubernetes; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Kubernetes cluster behind kubectl on a simulated Linux server — stored resources, derived status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use Digest::SHA (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use Encode (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use JSON::PP (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use JSON::MaybeXS (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use MIME::Base64 (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use YAML::XS (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | our $VERSION = '0.001'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 5 | our @GAPS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | my $J = JSON::MaybeXS->new( canonical => 1, utf8 => 0, pretty => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # Ausgabe von -o json wie kubectl (Go encoding/json): "key": value, vier | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # Leerzeichen. $J bleibt fuer Hashes und Vergleiche (Namen der Pods haengen daran). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 5 | my $OUT_JSON = JSON::PP->new->canonical->indent->indent_length(4)->space_after; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 5 | our %KIND = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | pod => 'pods', pods => 'pods', po => 'pods', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | deployment => 'deployments', deployments => 'deployments', deploy => 'deployments', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | service => 'services', services => 'services', svc => 'services', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | secret => 'secrets', secrets => 'secrets', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | configmap => 'configmaps', configmaps => 'configmaps', cm => 'configmaps', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | persistentvolumeclaim => 'pvcs', persistentvolumeclaims => 'pvcs', pvc => 'pvcs', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | networkpolicy => 'networkpolicies', networkpolicies => 'networkpolicies', netpol => 'networkpolicies', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | endpoints => 'endpoints', ep => 'endpoints', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | storageclass => 'storageclasses', storageclasses => 'storageclasses', sc => 'storageclasses', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | namespace => 'namespaces', namespaces => 'namespaces', ns => 'namespaces', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | node => 'nodes', nodes => 'nodes', no => 'nodes', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | event => 'events', events => 'events', ev => 'events', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | replicaset => 'replicasets', replicasets => 'replicasets', rs => 'replicasets', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | ingress => 'ingresses', ingresses => 'ingresses', ing => 'ingresses', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ingressclass => 'ingressclasses', ingressclasses => 'ingressclasses', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | serviceaccount => 'serviceaccounts', serviceaccounts => 'serviceaccounts', sa => 'serviceaccounts', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | role => 'roles', roles => 'roles', rolebinding => 'rolebindings', rolebindings => 'rolebindings', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | clusterrole => 'clusterroles', clusterroles => 'clusterroles', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | clusterrolebinding => 'clusterrolebindings', clusterrolebindings => 'clusterrolebindings', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | certificate => 'certificates', certificates => 'certificates', cert => 'certificates', certs => 'certificates', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | issuer => 'issuers', issuers => 'issuers', clusterissuer => 'clusterissuers', clusterissuers => 'clusterissuers', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | certificaterequest => 'certificaterequests', certificaterequests => 'certificaterequests', cr => 'certificaterequests', crs => 'certificaterequests', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | challenge => 'challenges', challenges => 'challenges', order => 'orders', orders => 'orders', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | # Arten, die im Zustand in API-Form stehen (ohne apiVersion, kind, Name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | # Namespace und Status): [ apiVersion, kind, ohne Namespace, Name fuer Meldungen ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 5 | our %GEN = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | ingresses => [ 'networking.k8s.io/v1', 'Ingress', 0, 'ingress.networking.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | ingressclasses => [ 'networking.k8s.io/v1', 'IngressClass', 1, 'ingressclass.networking.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | serviceaccounts => [ 'v1', 'ServiceAccount', 0, 'serviceaccount' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | roles => [ 'rbac.authorization.k8s.io/v1', 'Role', 0, 'role.rbac.authorization.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | rolebindings => [ 'rbac.authorization.k8s.io/v1', 'RoleBinding', 0, 'rolebinding.rbac.authorization.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | clusterroles => [ 'rbac.authorization.k8s.io/v1', 'ClusterRole', 1, 'clusterrole.rbac.authorization.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | clusterrolebindings => [ 'rbac.authorization.k8s.io/v1', 'ClusterRoleBinding', 1, 'clusterrolebinding.rbac.authorization.k8s.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | certificates => [ 'cert-manager.io/v1', 'Certificate', 0, 'certificate.cert-manager.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | issuers => [ 'cert-manager.io/v1', 'Issuer', 0, 'issuer.cert-manager.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | clusterissuers => [ 'cert-manager.io/v1', 'ClusterIssuer', 1, 'clusterissuer.cert-manager.io' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # abgeleitet, nur zum Lesen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 5 | our %DERIVED = map { $_ => 1 } qw( certificaterequests challenges orders ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 5 | our %CLUSTER = ( ( map { $_ => 1 } qw( namespaces storageclasses nodes ) ), map { $_ => 1 } grep { $GEN{$_}[2] } keys %GEN ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | our %SINGULAR = ( pods => 'pod', deployments => 'deployment.apps', services => 'service', secrets => 'secret', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | configmaps => 'configmap', pvcs => 'persistentvolumeclaim', networkpolicies => 'networkpolicy.networking.k8s.io', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | storageclasses => 'storageclass.storage.k8s.io', namespaces => 'namespace', endpoints => 'endpoints', nodes => 'node', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 5 | replicasets => 'replicaset.apps', ( map { $_ => $GEN{$_}[3] } keys %GEN ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | certificaterequests => 'certificaterequest.cert-manager.io', challenges => 'challenge.acme.cert-manager.io', orders => 'order.acme.cert-manager.io' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | my %APIKIND = ( deployments => 'Deployment', services => 'Service', secrets => 'Secret', configmaps => 'ConfigMap', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | pvcs => 'PersistentVolumeClaim', networkpolicies => 'NetworkPolicy', storageclasses => 'StorageClass', namespaces => 'Namespace', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 5 | map { $_ => $GEN{$_}[1] } keys %GEN ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 5 | my %FROM_APIKIND = reverse %APIKIND; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 516 | ▶ | sub _hash { my ($t) = @_; my $h = Digest::SHA::sha1_hex( $J->encode($t) ); $h =~ tr/0-9a-f/bcdfghjklmnpqrst/; return substr( $h, 0, 10 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_hash: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 67 | ▶ | sub _sel_match { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_sel_match: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 67 | my ( $sel, $labels ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 67 | ▶ | for my $k ( keys %{ $sel || {} } ) { return 0 unless defined $labels->{$k} && $labels->{$k} eq $sel->{$k} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
$sel || {}
defined $$labels{$k} and $$labels{$k} eq $$sel{$k}
MC/DC0%0/1
$sel || {}
$sel
MC/DC100%2/2
defined $$labels{$k} and $$labels{$k} eq $$sel{$k}
defined $$labels{$k}
$$labels{$k} eq $$sel{$k}
Truth table50%1/2
A
A= $sel
Truth table100%3/3
A and B
A= defined $$labels{$k}B= $$labels{$k} eq $$sel{$k}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 33 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | # --- abgeleiteter Zustand ------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 5 | ▶ | sub _pvc_phase { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pvc_phase: called CC=5 SCAR=17.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 5 | my ( $k, $ns, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 5 | ▶ | my $p = $k->{namespaces}{$ns}{pvcs}{$name} or return 'Missing'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 5 | my $sc = $p->{storage_class}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 5 | ▶ | my $scs = $k->{storageclasses} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'storageclasses'} || {}
MC/DC0%0/1
$$k{'storageclasses'} || {}
$$k{'storageclasses'}
Truth table50%1/2
A
A= $$k{'storageclasses'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | return 'Bound' if defined $sc ? $scs->{$sc} : grep { $scs->{$_}{default} } keys %$scs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 4 | return 'Pending'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | # Status eines Containers bzw. Pods einer Vorlage: ( phase, ready(0/1), reason, message ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 204 | ▶ | sub _pod_state { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pod_state: called CC=34 SCAR=41.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 204 | my ( $k, $ns, $tpl ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 204 | my $o = $k->{namespaces}{$ns}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 204 | ▶ | for my $c ( @{ $tpl->{containers} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$tpl{'containers'} || []
MC/DC0%0/1
$$tpl{'containers'} || []
$$tpl{'containers'}
Truth table50%1/2
A
A= $$tpl{'containers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 204 | ▶ | for my $v ( @{ $c->{volumes} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$c{'volumes'} || []
MC/DC0%0/1
$$c{'volumes'} || []
$$c{'volumes'}
Truth table50%1/2
A
A= $$c{'volumes'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $ph = _pvc_phase( $k, $ns, $v->{claim} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | return ( 'Pending', 0, 'Unschedulable', $ph eq 'Missing' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ? qq{persistentvolumeclaim "$v->{claim}" not found} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | : '0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | if $ph ne 'Bound'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 204 | ▶ | for my $c ( @{ $tpl->{containers} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$tpl{'containers'} || []
MC/DC0%0/1
$$tpl{'containers'} || []
$$tpl{'containers'}
Truth table50%1/2
A
A= $$tpl{'containers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 204 | ▶ | my %reg = map { $_ => 1 } @{ $k->{registry} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'registry'} || []
MC/DC0%0/1
$$k{'registry'} || []
$$k{'registry'}
Truth table50%1/2
A
A= $$k{'registry'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 204 | ▶ | return ( 'Pending', 0, 'ImagePullBackOff', qq{Back-off pulling image "$c->{image}"}, $c ) unless $reg{ $c->{image} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 202 | my %env; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 202 | ▶ | for my $e ( @{ $c->{env} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$c{'env'} || []
MC/DC100%1/1
$$c{'env'} || []
$$c{'env'}
Truth table100%2/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 60 | ▶ | if ( defined $e->{secret} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 25 | my $s = $o->{secrets}{ $e->{secret} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 25 | ▶ | return ( 'Pending', 0, 'CreateContainerConfigError', qq{secret "$e->{secret}" not found}, $c ) if !$s && !$e->{optional}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$s or $$e{"optional"}
MC/DC0%0/2
$s or $$e{"optional"}
$s
$$e{"optional"}
Truth table66%2/3
A or B
A= $sB= $$e{"optional"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 25 | ▶ | if ( $s && exists $s->{ $e->{key} } ) { $env{ $e->{name} } = 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$s and exists $$s{$$e{"key"}}
MC/DC100%2/2
$s and exists $$s{$$e{"key"}}
$s
exists $$s{$$e{"key"}}
Truth table100%3/3
A and B
A= $sB= exists $$s{$$e{"key"}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | elsif ( !$e->{optional} ) { return ( 'Pending', 0, 'CreateContainerConfigError', qq{couldn't find key $e->{key} in Secret $ns/$e->{secret}}, $c ) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | elsif ( defined $e->{configmap} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | my $m = $o->{configmaps}{ $e->{configmap} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | $env{ $e->{name} } = 1 if $m && exists $m->{ $e->{key} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$m and exists $$m{$$e{"key"}}
MC/DC0%0/2
$m and exists $$m{$$e{"key"}}
$m
exists $$m{$$e{"key"}}
Truth table0%0/3
A and B
A= $mB= exists $$m{$$e{"key"}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 35 | else { $env{ $e->{name} } = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 202 | ▶ | return ( 'Running', 0, 'CrashLoopBackOff', 'back-off 5m0s restarting failed container', $c ) if grep { !$env{$_} } @{ $c->{needs_env} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$$c{'needs_env'} || []
MC/DC100%1/1
$$c{'needs_env'} || []
$$c{'needs_env'}
Truth table100%2/2
A
A= $$c{'needs_env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 199 | ▶ | if ( my $deny = _rbac_denied( $k, $ns, $tpl, $c ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | return ( 'Running', 0, 'CrashLoopBackOff', 'back-off 5m0s restarting failed container', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 33 | ▶ | { %$c, crash_log => [ @{ $c->{rbac_log} || [] }, defined $c->{rbac_prefix} ? $c->{rbac_prefix} . $deny : 'level=fatal msg="' . ( $deny =~ s/"/\\"/gr ) . '"' ] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$c{'rbac_log'} || []
MC/DC0%0/1
$$c{'rbac_log'} || []
$$c{'rbac_log'}
Truth table50%1/2
A
A= $$c{'rbac_log'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 166 | ▶ | for my $c ( @{ $tpl->{containers} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$tpl{'containers'} || []
MC/DC0%0/1
$$tpl{'containers'} || []
$$tpl{'containers'}
Truth table50%1/2
A
A= $$tpl{'containers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 166 | ▶ | my $r = $c->{readiness} or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | return ( 'Running', 0, 'NotReady', "Readiness probe failed: Get \"http://10.42.1.17:$r->{port}" . ( $r->{path} // '/' ) . "\": dial tcp 10.42.1.17:$r->{port}: connect: connection refused", $c ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 22 | ▶ | unless grep { $_ == $r->{port} } @{ $c->{listens} || $c->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition42%3/7
$$c{'listens'} || $$c{'ports'} || []
$$c{"listens"} or $$c{"ports"}
$$r{"path"} // "/"
MC/DC0%0/2
$$c{'listens'} || $$c{'ports'} || []
$$c{"listens"}
$$c{"ports"}
MC/DC0%0/1
$$r{"path"} // "/"
$$r{"path"}
Truth table33%1/3
A or B
A= $$c{"listens"}B= $$c{"ports"}
Truth table50%1/2
A
A= $$r{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 165 | return ( 'Running', 1, '', '' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # Pods aller Deployments eines Namespace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 68 | ▶ | sub _pods { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pods: called CC=10 SCAR=23.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 68 | my ( $k, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 68 | my @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 68 | ▶ | my $o = $k->{namespaces}{$ns} or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 67 | ▶ | for my $d ( sort keys %{ $o->{deployments} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$o{'deployments'} || {}
MC/DC0%0/1
$$o{'deployments'} || {}
$$o{'deployments'}
Truth table50%1/2
A
A= $$o{'deployments'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 208 | my $dep = $o->{deployments}{$d}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 208 | ▶ | next unless _sa_exists( $k, $ns, $dep->{template}{service_account} ); # ReplicaSet kann keine Pods anlegen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 204 | ▶ | my $h = _hash( [ $dep->{template}, $dep->{restarted_at} // '' ] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dep{"restarted_at"} // ""
MC/DC0%0/1
$$dep{"restarted_at"} // ""
$$dep{"restarted_at"}
Truth table50%1/2
A
A= $$dep{"restarted_at"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 204 | my ( $phase, $ready, $reason, $msg, $c ) = _pod_state( $k, $ns, $dep->{template} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 204 | ▶ | for my $i ( 1 .. ( $dep->{replicas} // 1 ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dep{"replicas"} // 1
MC/DC0%0/1
$$dep{"replicas"} // 1
$$dep{"replicas"}
Truth table50%1/2
A
A= $$dep{"replicas"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 301 | my $suffix = substr( _hash( [ $h, $i ] ), 0, 5 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 301 | ▶ | push @p, { name => "$d-$h-$suffix", deployment => $d, labels => { %{ $dep->{template}{labels} || {} }, 'pod-template-hash' => $h }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$dep{'template'}{'labels'} || {}
MC/DC0%0/1
$$dep{'template'}{'labels'} || {}
$$dep{'template'}{'labels'}
Truth table50%1/2
A
A= $$dep{'template'}{'labels'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | phase => $phase, ready => $ready, reason => $reason, message => $msg, container => $c, template => $dep->{template}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 301 | restarts => $reason eq 'CrashLoopBackOff' ? 7 : 0, ip => "10.42." . ( $i % 3 + 1 ) . '.' . ( 10 + ( hex( substr( Digest::SHA::sha1_hex($d), 0, 4 ) ) % 200 ) + $i ) }; # je Deployment eigene Adressen | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 67 | return @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 13 | ▶ | sub _endpoints { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_endpoints: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 13 | my ( $k, $ns, $svc ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 13 | ▶ | my $s = $k->{namespaces}{$ns}{services}{$svc} or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 13 | ▶ | return grep { $_->{ready} && _sel_match( $s->{selector}, $_->{labels} ) } _pods( $k, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$$_{'ready'} && _sel_match($$s{'selector'}, $$_{'labels'})
MC/DC100%2/2
$$_{'ready'} && _sel_match($$s{'selector'}, $$_{'labels'})
$$_{'ready'}
_sel_match($$s{'selector'}, $$_{'labels'})
Truth table100%3/3
A && B
A= $$_{'ready'}B= _sel_match($$s{'selector'}, $$_{'labels'})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | # --- Ausgabe ------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 34 | ▶ | sub _cols { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cols: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 34 | my (@rows) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 34 | my @w; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 34 | ▶ | for my $r (@rows) { for ( 0 .. $#$r ) { $w[$_] = length $r->[$_] if !defined $w[$_] || length $r->[$_] > $w[$_] } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $w[$_] or length $$r[$_] > $w[$_]
MC/DC100%2/2
not defined $w[$_] or length $$r[$_] > $w[$_]
not defined $w[$_]
length $$r[$_] > $w[$_]
Truth table100%3/3
not(A) or B
A= not defined $w[$_]B= length $$r[$_] > $w[$_]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 34 | ▶ | return join "\n", map { my $r = $_; join( ' ', map { $_ == $#$r ? $r->[$_] : sprintf( "%-$w[$_]s", $r->[$_] ) } 0 .. $#$r ) =~ s/\s+\z//r } @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | sub _age { return $_[0] // '3d' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_age: not called CC=2 SCAR=17.9
Condition0%0/2
$_[0] // "3d"
MC/DC0%0/1
$_[0] // "3d"
$_[0]
Truth table0%0/2
A
A= $_[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | sub _labels_text { my ($l) = @_; return join( ',', map {"$_=$l->{$_}"} sort keys %{ $l || {} } ) || '<none>' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_labels_text: not called CC=3 SCAR=24.8
Condition0%0/4
join(',', map({"$_=$$l{$_}";} sort(keys %{$l or {};}))) || '<none>'
$l || {}
MC/DC0%0/1
join(',', map({"$_=$$l{$_}";} sort(keys %{$l or {};}))) || '<none>'
join(',', map({"$_=$$l{$_}";} sort(keys %{$l or {};})))
MC/DC0%0/1
$l || {}
$l
Truth table0%0/2
A
A= join(',', map({"$_=$$l{$_}";} sort(keys %{$l or {};})))
Truth table0%0/2
A
A= $l
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | # --- Kommandozeile ------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 133 | ▶ | sub kubectl { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kubectl: called CC=85 SCAR=55.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 133 | my ( $dev, $av, $ctx, $stdin ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 133 | ▶ | my $k = $dev->{kubernetes} or return ( 'error: no configuration has been provided, try setting KUBERNETES_MASTER environment variable', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 133 | ▶ | my %o = ( ns => $k->{default_namespace} // 'default' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{"default_namespace"} // "default"
MC/DC0%0/1
$$k{"default_namespace"} // "default"
$$k{"default_namespace"}
Truth table50%1/2
A
A= $$k{"default_namespace"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 133 | my @a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 133 | my @in = @$av; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 133 | ▶ | while (@in) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 600 | my $x = shift @in; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 600 | ▶ | if ( $x eq '-n' || $x eq '--namespace' ) { $o{ns} = shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 33 branches
Condition66%2/3
$x eq "-n" or $x eq "--namespace"
MC/DC50%1/2
$x eq "-n" or $x eq "--namespace"
$x eq "-n"
$x eq "--namespace"
Truth table66%2/3
A or B
A= $x eq "-n"B= $x eq "--namespace"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | elsif ( $x =~ /\A(?:-n|--namespace=)(.+)\z/ ) { $o{ns} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 1 | ▶ | elsif ( $x eq '-A' || $x eq '--all-namespaces' ) { $o{all} = 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-A" or $x eq "--all-namespaces"
MC/DC50%1/2
$x eq "-A" or $x eq "--all-namespaces"
$x eq "-A"
$x eq "--all-namespaces"
Truth table66%2/3
A or B
A= $x eq "-A"B= $x eq "--all-namespaces"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 22 | ▶ | elsif ( $x eq '-o' || $x eq '--output' ) { $o{out} = shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-o" or $x eq "--output"
MC/DC50%1/2
$x eq "-o" or $x eq "--output"
$x eq "-o"
$x eq "--output"
Truth table66%2/3
A or B
A= $x eq "-o"B= $x eq "--output"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | elsif ( $x =~ /\A(?:-o|--output=)(.+)\z/ ) { $o{out} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 6 | ▶ | elsif ( $x eq '-l' || $x eq '--selector' ) { $o{sel} = shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-l" or $x eq "--selector"
MC/DC50%1/2
$x eq "-l" or $x eq "--selector"
$x eq "-l"
$x eq "--selector"
Truth table66%2/3
A or B
A= $x eq "-l"B= $x eq "--selector"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | elsif ( $x =~ /\A(?:-l|--selector=)(.+)\z/ ) { $o{sel} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 5 | ▶ | elsif ( $x eq '-f' || $x eq '--filename' ) { push @{ $o{files} }, shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-f" or $x eq "--filename"
MC/DC50%1/2
$x eq "-f" or $x eq "--filename"
$x eq "-f"
$x eq "--filename"
Truth table66%2/3
A or B
A= $x eq "-f"B= $x eq "--filename"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | elsif ( $x =~ /\A--filename=(.+)\z/ ) { push @{ $o{files} }, $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 12 | ▶ | elsif ( $x eq '-p' || $x eq '--patch' ) { $o{patch} = shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-p" or $x eq "--patch"
MC/DC50%1/2
$x eq "-p" or $x eq "--patch"
$x eq "-p"
$x eq "--patch"
Truth table66%2/3
A or B
A= $x eq "-p"B= $x eq "--patch"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | elsif ( $x =~ /\A(?:--patch|-p)=(.+)\z/s ) { $o{patch} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | elsif ( $x =~ /\A--type=(.+)\z/ ) { $o{type} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 8 | elsif ( $x eq '--type' ) { $o{type} = shift @in } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | elsif ( $x =~ /\A--replicas=(\d+)\z/ ) { $o{replicas} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 2 | elsif ( $x =~ /\A--from-literal=([^=]+)=(.*)\z/s ) { push @{ $o{literal} }, [ $1, $2 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 2 | elsif ( $x =~ /\A--from-file=(?:([^=]+)=)?(.+)\z/s ) { push @{ $o{from_file} }, [ $1, $2 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | elsif ( $x eq '--show-labels' ) { $o{show_labels} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | elsif ( $x eq '--previous' || $x eq '-p' && 0 ) { $o{previous} = 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
$x eq "--previous" or $x eq "-p" and 0
$x eq "-p" and 0
MC/DC0%0/2
$x eq "--previous" or $x eq "-p" and 0
$x eq "--previous"
$x eq "-p"
Truth table33%1/3
A or B
A= $x eq "--previous"B= $x eq "-p"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | elsif ( $x =~ /\A--tail(?:=(\d+))?\z/ ) { $o{tail} = $1 // shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$1 // shift @in
MC/DC0%0/2
$1 // shift @in
$1
shift @in
Truth table0%0/3
A // B
A= $1B= shift @in
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 6 | ▶ | elsif ( $x eq '-c' || $x eq '--container' ) { $o{container} = shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$x eq "-c" or $x eq "--container"
MC/DC50%1/2
$x eq "-c" or $x eq "--container"
$x eq "-c"
$x eq "--container"
Truth table66%2/3
A or B
A= $x eq "-c"B= $x eq "--container"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | # set env: --containers, --from=secret/x, --keys, --prefix | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 2 | elsif ( $x =~ /\A(?:-c|--containers?)=(.+)\z/ ) { $o{container} = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 1 | elsif ( $x eq '--containers' ) { $o{container} = shift @in } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 9 | elsif ( $x =~ /\A--(from|keys|prefix)=(.*)\z/s ) { $o{"env_$1"} = $2 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 1 | elsif ( $x =~ /\A--(from|keys|prefix)\z/ ) { $o{"env_$1"} = shift @in } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 1 | elsif ( $x eq '--list' ) { $o{env_list} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 18 | elsif ( $x eq '--' ) { $o{rest} = [@in]; last } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | # create role|rolebinding|secret tls …, auth can-i, annotate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 23 | ▶ | elsif ( $x =~ /\A--(verb|resource-name|resource|role|clusterrole|serviceaccount|user|group|cert|key|as-group|as)(?:=(.*))?\z/s ) { push @{ $o{f}{$1} }, defined $2 ? $2 : shift @in } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | elsif ( $x eq '--list' ) { $o{list} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | # Reihenfolge der Zeilen spielt hier keine Rolle; Feldfilter sind nicht nachgebildet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 2 | ▶ | elsif ( $x =~ /\A--sort-by(?:=.+)?\z/ ) { shift @in if $x eq '--sort-by' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | ▶ | elsif ( $x =~ /\A--field-selector(?:=(.+))?\z/ ) { push @GAPS, 'kubectl --field-selector ' . ( $1 // shift(@in) // '' ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
($1 // shift @in) // ""
$1 // shift @in
MC/DC0%0/2
($1 // shift @in) // ""
$1
shift @in
Truth table33%1/3
A // B
A= $1B= shift @in
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 4 | elsif ( $x =~ /\A--(?:overwrite|wait|now|force|all|dry-run=\w+|record|grace-period=\d+|timeout=\S+|watch=false)\z/ ) { $o{flags}{$x} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 1 | ▶ | elsif ( $x eq '-w' || $x eq '--watch' || $x eq '-it' || $x eq '-i' || $x eq '-t' || $x eq '--stdin' || $x eq '--tty' ) { $o{interactive} = $x } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition61%11/18
$x eq "-w" or $x eq "--watch" or $x eq "-it" or $x eq "-i" or $x eq "-t" or $x eq "--stdin" or $x eq "--tty"
$x eq "-w" or $x eq "--watch" or $x eq "-it" or $x eq "-i" or $x eq "-t" or $x eq "--stdin"
$x eq "-w" or $x eq "--watch" or $x eq "-it" or $x eq "-i" or $x eq "-t"
$x eq "-w" or $x eq "--watch" or $x eq "-it" or $x eq "-i"
$x eq "-w" or $x eq "--watch" or $x eq "-it"
$x eq "-w" or $x eq "--watch"
MC/DC14%1/7
$x eq "-w" or $x eq "--watch" or $x eq "-it" or $x eq "-i" or $x eq "-t" or $x eq "--stdin" or $x eq "--tty"
$x eq "-w"
$x eq "--watch"
$x eq "-it"
$x eq "-i"
$x eq "-t"
$x eq "--stdin"
$x eq "--tty"
Truth table25%2/8
A or B or C or D or E or F or G
A= $x eq "-w"B= $x eq "--watch"C= $x eq "-it"D= $x eq "-i"E= $x eq "-t"F= $x eq "--stdin"G= $x eq "--tty"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | elsif ( $x =~ /\A-/ ) { return ( "error: unknown flag: $x\nSee 'kubectl --help' for usage.", 0 ) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 351 | else { push @a, $x } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 133 | ▶ | if ( ( $o{out} // '' ) =~ /\A(jsonpath|custom-columns)(?:-as-json)?=(.*)\z/s && ( $a[0] // '' ) eq 'get' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition71%5/7
($o{"out"} // "") =~ /\A(jsonpath|custom-columns)(?:-as-json)?=(.*)\z/s and ($a[0] // "") eq "get"
$o{"out"} // ""
$a[0] // ""
MC/DC50%1/2
($o{"out"} // "") =~ /\A(jsonpath|custom-columns)(?:-as-json)?=(.*)\z/s and ($a[0] // "") eq "get"
$o{"out"}
$a[0]
Truth table66%2/3
A and B
A= $o{"out"}B= $a[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 10 | my ( $how, $expr ) = ( $1, $2 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 10 | my $copy = JSON::MaybeXS->new( canonical => 1 )->decode( JSON::MaybeXS->new( canonical => 1 )->encode($k) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 10 | my ( $j, $ok ) = _v_get( $copy, [ @a[ 1 .. $#a ] ], { %o, out => 'json' } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 10 | ▶ | return ( $j, 0 ) unless $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 10 | my $data = eval { JSON::MaybeXS->new->decode($j) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | unless ( ref $data ) { push @GAPS, "kubectl -o $how"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | # ohne Namen ist es immer eine Liste (auch mit einem Eintrag) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 10 | ▶ | $data = { apiVersion => 'v1', kind => 'List', items => [$data] } if ( $data->{kind} // '' ) ne 'List' && !defined $a[2] && ( $a[1] // '' ) !~ m{/}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition70%7/10
($$data{"kind"} // "") ne "List" and not defined $a[2] and not +($a[1] // "") =~ m[/]
($$data{"kind"} // "") ne "List" and not defined $a[2]
$$data{"kind"} // ""
$a[1] // ""
MC/DC0%0/3
($$data{"kind"} // "") ne "List" and not defined $a[2] and not +($a[1] // "") =~ m[/]
$$data{"kind"}
not defined $a[2]
$a[1]
Truth table50%2/4
A and not(B) and not(C)
A= $$data{"kind"}B= not defined $a[2]C= $a[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 10 | ▶ | my ( $out, $err ) = $how eq 'jsonpath' ? jsonpath( $data, $expr ) : _custom_columns( $data, $expr ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 10 | ▶ | return defined $err ? ( $err, 0 ) : ( $out, 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | if ( ( $o{out} // '' ) =~ /\A(jsonpath|custom-columns|go-template|template)/ ) { push @GAPS, "kubectl -o $1"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$o{"out"} // ""
MC/DC100%1/1
$o{"out"} // ""
$o{"out"}
Truth table100%2/2
A
A= $o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 123 | ▶ | my $verb = shift(@a) // return ( "kubectl controls the Kubernetes cluster manager.\n\nUse \"kubectl <command> --help\" for more information about a given command.", 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
shift @a // (return "kubectl controls the Kubernetes cluster manager.\n\nUse \"kubectl <command> --help\" for more information about a given command.", 1)
MC/DC0%0/1
shift @a // (return "kubectl controls the Kubernetes cluster manager.\n\nUse \"kubectl <command> --help\" for more information about a given command.", 1)
shift @a
Truth table50%1/2
A
A= shift @a
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 123 | ( my $sub = "_v_$verb" ) =~ s/-/_/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | my $f = $verb =~ /\A[a-z-]+\z/ && __PACKAGE__->can($sub) or do { push @GAPS, "kubectl $verb"; return ( '', 0 ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$verb =~ /\A[a-z-]+\z/ && __PACKAGE__->can($sub)
MC/DC0%0/2
$verb =~ /\A[a-z-]+\z/ && __PACKAGE__->can($sub)
$verb =~ /\A[a-z-]+\z/
__PACKAGE__->can($sub)
Truth table33%1/3
A && B
A= $verb =~ /\A[a-z-]+\z/B= __PACKAGE__->can($sub)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | # Lesen auf einer Kopie (kein Nebeneffekt durch Zugriffe); Aendern nur in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | # einem vorhandenen Namespace (ausser Ressourcen ohne Namespace) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 123 | ▶ | my $read = $verb =~ /\A(?:get|describe|logs|exec|version|config|cluster-info|top|explain|auth|api-resources|api-versions)\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition62%5/8
$verb =~ /\A(?:get|describe|logs|exec|version|config|cluster-info|top|explain|auth|api-resources|api-versions)\z/ || $verb eq 'rollout' && ($a[0] // '') =~ /\A(?:status|history)\z/
$verb eq "rollout" and ($a[0] // "") =~ /\A(?:status|history)\z/
$a[0] // ""
MC/DC66%2/3
$verb =~ /\A(?:get|describe|logs|exec|version|config|cluster-info|top|explain|auth|api-resources|api-versions)\z/ || $verb eq 'rollout' && ($a[0] // '') =~ /\A(?:status|history)\z/
$verb =~ /\A(?:get|describe|logs|exec|version|config|cluster-info|top|explain|auth|api-resources|api-versions)\z/
$verb eq "rollout"
$a[0]
Truth table75%3/4
A || B and C
A= $verb =~ /\A(?:get|describe|logs|exec|version|config|cluster-info|top|explain|auth|api-resources|api-versions)\z/B= $verb eq "rollout"C= $a[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | || $verb eq 'rollout' && ( $a[0] // '' ) =~ /\A(?:status|history)\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 123 | ▶ | if ($read) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 76 | my $copy = JSON::MaybeXS->new( canonical => 1 )->decode( JSON::MaybeXS->new( canonical => 1 )->encode($k) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 76 | return $f->( $copy, \@a, \%o, $dev, $stdin ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 47 | ▶ | my ($kind) = $verb =~ /\A(?:delete|patch|label|annotate)\z/ ? _kind_name( \@a ) : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | return ( qq{Error from server (NotFound): namespaces "$o{ns}" not found}, 0 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 47 | ▶ | if !$k->{namespaces}{ $o{ns} } && $verb !~ /\A(?:apply|create)\z/ && !( $kind && $CLUSTER{$kind} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%6/9
$$k{"namespaces"}{$o{"ns"}} or $verb =~ /\A(?:apply|create)\z/ or $kind and $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
$$k{"namespaces"}{$o{"ns"}} or $verb =~ /\A(?:apply|create)\z/
$kind and $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
MC/DC0%0/4
$$k{"namespaces"}{$o{"ns"}} or $verb =~ /\A(?:apply|create)\z/ or $kind and $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
$$k{"namespaces"}{$o{"ns"}}
$verb =~ /\A(?:apply|create)\z/
$kind
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
Truth table60%3/5
A or B or C and D
A= $$k{"namespaces"}{$o{"ns"}}B= $verb =~ /\A(?:apply|create)\z/C= $kindD= $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | # gescheiterte Aenderungen hinterlassen nichts (auch keine angelegten leeren Abschnitte) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 47 | my $copy = JSON::MaybeXS->new( canonical => 1 )->decode( JSON::MaybeXS->new( canonical => 1 )->encode($k) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 47 | my ( $out, $ok ) = $f->( $copy, \@a, \%o, $dev, $stdin ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 47 | ▶ | $dev->{kubernetes} = $copy if $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 47 | return ( $out, $ok ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 48 | ▶ | sub _ns_list { my ( $k, $o ) = @_; return $o->{all} ? sort keys %{ $k->{namespaces} || {} } : ( $o->{ns} ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ns_list: called CC=3 SCAR=11.1
Branch: 1 branch
Condition50%1/2
$$k{'namespaces'} || {}
MC/DC0%0/1
$$k{'namespaces'} || {}
$$k{'namespaces'}
Truth table50%1/2
A
A= $$k{'namespaces'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 101 | ▶ | sub _kind_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_kind_name: called CC=4 SCAR=15.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 101 | my ( $a ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 101 | my ( $kind, $name ) = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 101 | ▶ | ( $kind, $name ) = split m{/}, $kind, 2 if defined $kind && $kind =~ m{/}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $kind and $kind =~ m[/]
MC/DC0%0/2
defined $kind and $kind =~ m[/]
defined $kind
$kind =~ m[/]
Truth table33%1/3
A and B
A= defined $kindB= $kind =~ m[/]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 101 | ▶ | ( my $base = lc( $kind // '' ) ) =~ s/\.(?:apps|networking\.k8s\.io|storage\.k8s\.io|rbac\.authorization\.k8s\.io|cert-manager\.io|acme\.cert-manager\.io)\z//; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$kind // ""
MC/DC0%0/1
$kind // ""
$kind
Truth table50%1/2
A
A= $kind
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 101 | return ( $KIND{$base}, $name, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | sub _v_version { return ( "Client Version: v1.30.4\nKustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3\nServer Version: v1.30.4+k3s1", 1 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_version: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | sub _v_config { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_config: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | my ( $k, $a ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | ▶ | return ( $k->{context} // 'default', 1 ) if ( $a->[0] // '' ) eq 'current-context'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
$$a[0] // ""
$$k{"context"} // "default"
MC/DC0%0/1
$$a[0] // ""
$$a[0]
MC/DC0%0/1
$$k{"context"} // "default"
$$k{"context"}
Truth table0%0/2
A
A= $$a[0]
Truth table0%0/2
A
A= $$k{"context"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | push @GAPS, "kubectl config @$a"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | return ( '', 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | sub _v_cluster_info { return ( "Kubernetes control plane is running at https://10.30.0.10:6443\nCoreDNS is running at https://10.30.0.10:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy", 1 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_cluster_info: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 49 | ▶ | sub _v_get { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_get: called CC=214 SCAR=84.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 49 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | # mehrere Arten (pods,svc): je Art ein Block, Namen mit Art davor wie kubectl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 49 | ▶ | if ( ( $a->[0] // '' ) =~ /,/ && $a->[0] !~ m{/} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
($$a[0] // "") =~ /,/ and not $$a[0] =~ m[/]
$$a[0] // ""
MC/DC0%0/2
($$a[0] // "") =~ /,/ and not $$a[0] =~ m[/]
$$a[0]
not $$a[0] =~ m[/]
Truth table0%0/3
A and not(B)
A= $$a[0]B= not $$a[0] =~ m[/]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | for my $kind ( split /,/, $a->[0] ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | my ( $t, $ok ) = _v_get( $k, [ $kind, @$a[ 1 .. $#$a ] ], $o ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | return ( $t, 0 ) unless $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | ▶ | my $pre = ( $SINGULAR{ $KIND{ lc $kind } // '' } // $kind ) . '/'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$Langertha::Holmgang::Sim::Linux::Kubernetes::SINGULAR{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""} // $kind
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""
MC/DC0%0/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::SINGULAR{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""} // $kind
$Langertha::Holmgang::Sim::Linux::Kubernetes::SINGULAR{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""}
$kind
MC/DC0%0/1
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind}
Truth table0%0/3
A // B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::SINGULAR{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind} // ""}B= $kind
Truth table0%0/2
A
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{lc $kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | $t =~ s/^(?!NAME\b|NAMESPACE\b|No resources)(\S)/$pre$1/mg unless $o->{all}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | push @out, $t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | return ( join( "\n\n", @out ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | # mehrere Namen einer Art (get svc a b): eine Tabelle, ein Kopf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | if ( @$a > 2 && $a->[0] !~ m{/} && !grep {m{/}} @$a ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
@$a > 2 and not $$a[0] =~ m[/] and not grep({m[/];} @$a)
@$a > 2 and not $$a[0] =~ m[/]
MC/DC0%0/3
@$a > 2 and not $$a[0] =~ m[/] and not grep({m[/];} @$a)
@$a > 2
not $$a[0] =~ m[/]
not grep({m[/];} @$a)
Truth table25%1/4
A and not(B) and not(C)
A= @$a > 2B= not $$a[0] =~ m[/]C= not grep({m[/];} @$a)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | for my $n ( @$a[ 1 .. $#$a ] ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my ( $t, $ok ) = _v_get( $k, [ $a->[0], $n ], $o ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | return ( $t, 0 ) unless $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | $t =~ s/\A[^\n]*\n?// if @out && $t =~ /\A(?:NAME|NAMESPACE)\b/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@out and $t =~ /\A(?:NAME|NAMESPACE)\b/
MC/DC0%0/2
@out and $t =~ /\A(?:NAME|NAMESPACE)\b/
@out
$t =~ /\A(?:NAME|NAMESPACE)\b/
Truth table0%0/3
A and B
A= @outB= $t =~ /\A(?:NAME|NAMESPACE)\b/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | push @out, $t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | return ( join( "\n", @out ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 49 | my ( $kind, $name, $raw ) = _kind_name($a); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 49 | ▶ | return ( qq{error: the server doesn't have a resource type "} . ( $raw // '' ) . '"', 0 ) unless $kind; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$raw // ""
MC/DC0%0/1
$raw // ""
$raw
Truth table0%0/2
A
A= $raw
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 49 | ▶ | if ( $kind eq 'namespaces' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %{ $k->{namespaces} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table0%0/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | return ( qq{Error from server (NotFound): namespaces "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table0%0/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | return ( _cols( [qw( NAME STATUS AGE )], map { [ $_, 'Active', '41d' ] } @n ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 49 | ▶ | if ( $kind eq 'nodes' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | return ( _cols( [qw( NAME STATUS ROLES AGE VERSION )], map { [ $_, $k->{nodes}{$_}{ready} ? 'Ready' : 'NotReady', $k->{nodes}{$_}{roles} // '<none>', '41d', 'v1.30.4+k3s1' ] } sort keys %{ $k->{nodes} || {} } ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
$$k{"nodes"}{$_}{"roles"} // "<none>"
$$k{'nodes'} || {}
MC/DC0%0/1
$$k{"nodes"}{$_}{"roles"} // "<none>"
$$k{"nodes"}{$_}{"roles"}
MC/DC0%0/1
$$k{'nodes'} || {}
$$k{'nodes'}
Truth table0%0/2
A
A= $$k{"nodes"}{$_}{"roles"}
Truth table0%0/2
A
A= $$k{'nodes'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 49 | ▶ | if ( $kind eq 'storageclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 1 | ▶ | my $s = $k->{storageclasses} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'storageclasses'} || {}
MC/DC0%0/1
$$k{'storageclasses'} || {}
$$k{'storageclasses'}
Truth table50%1/2
A
A= $$k{'storageclasses'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 1 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table33%1/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 1 | ▶ | return ( qq{Error from server (NotFound): storageclasses.storage.k8s.io "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table33%1/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | return _structured( $o, 'storageclasses', { map { $_ => $s->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC0%0/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table33%1/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | return ( _cols( [qw( NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 1 | ▶ | map { [ $_ . ( $s->{$_}{default} ? ' (default)' : '' ), $s->{$_}{provisioner} // 'kubernetes.io/no-provisioner', 'Delete', 'Immediate', 'false', '41d' ] } @n ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$s{$_}{"provisioner"} // "kubernetes.io/no-provisioner"
MC/DC0%0/1
$$s{$_}{"provisioner"} // "kubernetes.io/no-provisioner"
$$s{$_}{"provisioner"}
Truth table50%1/2
A
A= $$s{$_}{"provisioner"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 48 | ▶ | if ( $GEN{$kind} || $DERIVED{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
MC/DC100%2/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
Truth table100%3/3
A or B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}B= $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 8 | ▶ | my $cluster = $GEN{$kind} && $GEN{$kind}[2]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} && $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}[2]
MC/DC0%0/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} && $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}[2]
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}[2]
Truth table66%2/3
A && B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}B= $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}[2]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 8 | ▶ | my $multi = $o->{all} && !$cluster; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$$o{'all'} && !$cluster
MC/DC0%0/2
$$o{'all'} && !$cluster
$$o{'all'}
!$cluster
Truth table33%1/3
A && not(B)
A= $$o{'all'}B= !$cluster
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 8 | my @rows; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 8 | ▶ | for my $ns ( $cluster ? (undef) : _ns_list( $k, $o ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 8 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 8 | ▶ | if ( $DERIVED{$kind} && $o->{out} && $o->{out} =~ /\A(yaml|json)/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind} and $$o{"out"} and $$o{"out"} =~ /\A(yaml|json)/
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind} and $$o{"out"}
MC/DC66%2/3
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind} and $$o{"out"} and $$o{"out"} =~ /\A(yaml|json)/
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
$$o{"out"}
$$o{"out"} =~ /\A(yaml|json)/
Truth table75%3/4
A and B and C
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}B= $$o{"out"}C= $$o{"out"} =~ /\A(yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 1 | my $objs = _derived_objs( $k, $kind, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 1 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$objs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table33%1/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 1 | ▶ | return ( qq{Error from server (NotFound): $SINGULAR{$kind} "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table33%1/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 1 | ▶ | my $data = @n == 1 && defined $name ? $objs->{ $n[0] } : { apiVersion => 'v1', kind => 'List', items => [ @{$objs}{@n} ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@n == 1 and defined $name
MC/DC0%0/2
@n == 1 and defined $name
@n == 1
defined $name
Truth table33%1/3
A and B
A= @n == 1B= defined $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | return ( $1 eq 'json' ? $OUT_JSON->encode($data) =~ s/\s+\z//r : do { local $YAML::XS::Boolean = 'JSON::PP'; YAML::XS::Dump($data) =~ s/\A---\n//r =~ s/\s+\z//r }, 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 7 | ▶ | if ( $DERIVED{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 2 | ( undef, @r ) = _derived_rows( $k, $kind, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | @r = grep { $_->[0] eq $name } @r if defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 5 | my ( $res, $err ) = _gen_rows( $k, $kind, $ns, $o, $name ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | if ( !$res ) { next if $multi; return ( $err, 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 5 | ▶ | return _structured( { %$o, ns => $ns }, $kind, $res ) if ref $res eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 3 | ( undef, @r ) = @$res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | ▶ | return ( join( "\n", map { "$SINGULAR{$kind}/$_->[0]" } @r ), 1 ) if ( $o->{out} // '' ) eq 'name'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 5 | ▶ | push @rows, map { [ ( $multi ? $ns : () ), @$_ ] } @r; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 5 | ▶ | return ( qq{Error from server (NotFound): $SINGULAR{$kind} "$name" not found}, 0 ) if defined $name && !@rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and not @rows
MC/DC0%0/2
defined $name and not @rows
defined $name
not @rows
Truth table66%2/3
A and not(B)
A= defined $nameB= not @rows
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 5 | ▶ | return ( $multi || $cluster ? 'No resources found' : "No resources found in $o->{ns} namespace.", 1 ) unless @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$multi or $cluster
MC/DC0%0/2
$multi or $cluster
$multi
$cluster
Truth table0%0/3
A or B
A= $multiB= $cluster
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 5 | ▶ | my ($head) = $DERIVED{$kind} ? _derived_rows( $k, $kind, $o->{ns} ) : @{ ( _gen_rows( $k, $kind, $o->{ns}, { %$o, out => $o->{out} && $o->{out} eq 'wide' ? 'wide' : undef }, undef ) )[0] || [ [] ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition40%2/5
(_gen_rows($k, $kind, $$o{'ns'}, {%$o, 'out', $$o{'out'} && $$o{'out'} eq 'wide' ? 'wide' : undef}, undef))[0] || [[]]
$$o{"out"} and $$o{"out"} eq "wide"
MC/DC0%0/1
(_gen_rows($k, $kind, $$o{'ns'}, {%$o, 'out', $$o{'out'} && $$o{'out'} eq 'wide' ? 'wide' : undef}, undef))[0] || [[]]
(_gen_rows($k, $kind, $$o{'ns'}, {%$o, 'out', $$o{'out'} && $$o{'out'} eq 'wide' ? 'wide' : undef}, undef))[0]
MC/DC0%0/2
$$o{"out"} and $$o{"out"} eq "wide"
$$o{"out"}
$$o{"out"} eq "wide"
Truth table50%1/2
A
A= (_gen_rows($k, $kind, $$o{'ns'}, {%$o, 'out', $$o{'out'} && $$o{'out'} eq 'wide' ? 'wide' : undef}, undef))[0]
Truth table33%1/3
A and B
A= $$o{"out"}B= $$o{"out"} eq "wide"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 5 | ▶ | return ( _cols( [ ( $multi ? 'NAMESPACE' : () ), @$head ], @rows ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 40 | my ( @out, @all ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 40 | my $multi = $o->{all}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 40 | for my $ns ( _ns_list( $k, $o ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 41 | ▶ | my $obj = $k->{namespaces}{$ns} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$k{'namespaces'}{$ns} || {}
MC/DC100%1/1
$$k{'namespaces'}{$ns} || {}
$$k{'namespaces'}{$ns}
Truth table100%2/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 41 | my @rows; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 41 | ▶ | if ( $kind eq 'pods' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 16 | ▶ | my @p = grep { ( !defined $name || $_->{name} eq $name ) && _label_sel( $o->{sel}, $_->{labels} ) } _pods( $k, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%3/6
(!defined($name) || $$_{'name'} eq $name) && _label_sel($$o{'sel'}, $$_{'labels'})
not defined $name or $$_{"name"} eq $name
MC/DC33%1/3
(!defined($name) || $$_{'name'} eq $name) && _label_sel($$o{'sel'}, $$_{'labels'})
not defined $name
$$_{"name"} eq $name
_label_sel($$o{'sel'}, $$_{'labels'})
Truth table40%2/5
not(A) or B && C
A= not defined $nameB= $$_{"name"} eq $nameC= _label_sel($$o{'sel'}, $$_{'labels'})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 16 | ▶ | return ( qq{Error from server (NotFound): pods "$name" not found}, 0 ) if defined $name && !@p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @p
MC/DC0%0/2
defined $name and not @p
defined $name
not @p
Truth table33%1/3
A and not(B)
A= defined $nameB= not @p
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 16 | ▶ | return ( join( "\n", map {"pod/$_->{name}"} @p ), 1 ) if ( $o->{out} // '' ) eq 'name'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$$o{"out"} // ""
MC/DC100%1/1
$$o{"out"} // ""
$$o{"out"}
Truth table100%2/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | return _structured( $o, 'pods', { map { $_->{name} => _pod_obj($_) } @p } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC0%0/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table33%1/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 12 | push @rows, map { [ ( $multi ? $ns : () ), $_->{name}, ( $_->{ready} ? '1/1' : '0/1' ), ( $_->{reason} && $_->{reason} ne 'NotReady' && $_->{reason} ne 'Unschedulable' ? $_->{reason} : $_->{phase} ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | $_->{restarts} . ( $_->{restarts} ? ' (2m ago)' : '' ), '12m', ( ( $o->{out} // '' ) eq 'wide' ? ( $_->{phase} eq 'Pending' && $_->{reason} eq 'Unschedulable' ? ( '<none>', '<none>' ) : ( $_->{ip}, 'node1' ) ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 39 | ▶ | ( $o->{show_labels} ? _labels_text( $_->{labels} ) : () ) ] } @p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
Condition45%5/11
$$_{"reason"} and $$_{"reason"} ne "NotReady" and $$_{"reason"} ne "Unschedulable"
$$_{"reason"} and $$_{"reason"} ne "NotReady"
$$o{"out"} // ""
$$_{"phase"} eq "Pending" and $$_{"reason"} eq "Unschedulable"
MC/DC33%1/3
$$_{"reason"} and $$_{"reason"} ne "NotReady" and $$_{"reason"} ne "Unschedulable"
$$_{"reason"}
$$_{"reason"} ne "NotReady"
$$_{"reason"} ne "Unschedulable"
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
MC/DC0%0/2
$$_{"phase"} eq "Pending" and $$_{"reason"} eq "Unschedulable"
$$_{"phase"} eq "Pending"
$$_{"reason"} eq "Unschedulable"
Truth table50%2/4
A and B and C
A= $$_{"reason"}B= $$_{"reason"} ne "NotReady"C= $$_{"reason"} ne "Unschedulable"
Truth table50%1/2
A
A= $$o{"out"}
Truth table0%0/3
A and B
A= $$_{"phase"} eq "Pending"B= $$_{"reason"} eq "Unschedulable"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 12 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME READY STATUS RESTARTS AGE ), ( ( $o->{out} // '' ) eq 'wide' ? qw( IP NODE ) : () ), ( $o->{show_labels} ? 'LABELS' : () ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | elsif ( $kind eq 'deployments' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 8 | ▶ | my $d = $obj->{deployments} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$obj{'deployments'} || {}
MC/DC0%0/1
$$obj{'deployments'} || {}
$$obj{'deployments'}
Truth table50%1/2
A
A= $$obj{'deployments'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 8 | ▶ | my @n = grep { ( !defined $name || $_ eq $name ) } sort keys %$d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
!defined($name) || $_ eq $name
MC/DC100%2/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table100%3/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 8 | ▶ | return ( qq{Error from server (NotFound): deployments.apps "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table66%2/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 8 | ▶ | return _structured( $o, 'deployments', { map { $_ => $d->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC50%1/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table66%2/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | push @rows, map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 1 | my $n = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 2 | my @p = grep { $_->{deployment} eq $n } _pods( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 2 | my $r = grep { $_->{ready} } @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | [ ( $multi ? $ns : () ), $n, "$r/" . scalar(@p), scalar(@p), $r, '41d', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | ▶ | ( ( $o->{out} // '' ) eq 'wide' ? ( join( ',', map { $_->{name} } @{ $d->{$n}{template}{containers} } ), join( ',', map { $_->{image} } @{ $d->{$n}{template}{containers} } ), _labels_text( $d->{$n}{selector} ) ) : () ) ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 1 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME READY UP-TO-DATE AVAILABLE AGE ), ( ( $o->{out} // '' ) eq 'wide' ? qw( CONTAINERS IMAGES SELECTOR ) : () ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | elsif ( $kind eq 'services' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 1 | ▶ | my $s = $obj->{services} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$obj{'services'} || {}
MC/DC0%0/1
$$obj{'services'} || {}
$$obj{'services'}
Truth table50%1/2
A
A= $$obj{'services'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 1 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table33%1/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 1 | ▶ | return ( qq{Error from server (NotFound): services "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table33%1/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 1 | ▶ | return _structured( $o, 'services', { map { $_ => $s->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC0%0/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table33%1/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | push @rows, map { [ ( $multi ? $ns : () ), $_, $s->{$_}{type} // 'ClusterIP', $s->{$_}{cluster_ip} // '10.43.' . ( 10 + hex( substr( Digest::SHA::sha1_hex($_), 0, 2 ) ) % 200 ) . '.' . ( 10 + hex( substr( Digest::SHA::sha1_hex($_), 2, 2 ) ) % 240 ), '<none>', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | ▶ | join( ',', map { "$_->{port}/TCP" } @{ $s->{$_}{ports} || [] } ), '41d', ( ( $o->{out} // '' ) eq 'wide' ? _labels_text( $s->{$_}{selector} ) : () ) ] } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/8
$$s{$_}{"type"} // "ClusterIP"
$$s{$_}{"cluster_ip"} // '10.43.' . (10 + hex(substr &Digest::SHA::sha1_hex($_), 0, 2) % 200) . '.' . (10 + hex(substr &Digest::SHA::sha1_hex($_), 2, 2) % 240)
$$s{$_}{'ports'} || []
$$o{"out"} // ""
MC/DC0%0/1
$$s{$_}{"type"} // "ClusterIP"
$$s{$_}{"type"}
MC/DC0%0/1
$$s{$_}{"cluster_ip"} // '10.43.' . (10 + hex(substr &Digest::SHA::sha1_hex($_), 0, 2) % 200) . '.' . (10 + hex(substr &Digest::SHA::sha1_hex($_), 2, 2) % 240)
$$s{$_}{"cluster_ip"}
MC/DC0%0/1
$$s{$_}{'ports'} || []
$$s{$_}{'ports'}
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table0%0/2
A
A= $$s{$_}{"type"}
Truth table0%0/2
A
A= $$s{$_}{"cluster_ip"}
Truth table0%0/2
A
A= $$s{$_}{'ports'}
Truth table0%0/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ), ( ( $o->{out} // '' ) eq 'wide' ? 'SELECTOR' : () ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table0%0/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | elsif ( $kind eq 'endpoints' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 3 | ▶ | my $s = $obj->{services} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$obj{'services'} || {}
MC/DC0%0/1
$$obj{'services'} || {}
$$obj{'services'}
Truth table50%1/2
A
A= $$obj{'services'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 3 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table33%1/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 3 | ▶ | return ( qq{Error from server (NotFound): endpoints "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table33%1/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | push @rows, map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 3 | my $svc = $s->{$_}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 3 | my @e = _endpoints( $k, $ns, $_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 3 | ▶ | my @t = map { my $p = $_; map {"$_->{ip}:$p->{target}"} @e } @{ $svc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$svc{'ports'} || []
MC/DC0%0/1
$$svc{'ports'} || []
$$svc{'ports'}
Truth table50%1/2
A
A= $$svc{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 3 | ▶ | [ ( $multi ? $ns : () ), $_, @t ? join( ',', @t ) : '<none>', '41d' ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 3 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME ENDPOINTS AGE ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | elsif ( $kind eq 'pvcs' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 2 | ▶ | my $p = $obj->{pvcs} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$obj{'pvcs'} || {}
MC/DC0%0/1
$$obj{'pvcs'} || {}
$$obj{'pvcs'}
Truth table50%1/2
A
A= $$obj{'pvcs'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 2 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table66%2/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 2 | ▶ | return ( qq{Error from server (NotFound): persistentvolumeclaims "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table66%2/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | return _structured( $o, 'pvcs', { map { $_ => $p->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC0%0/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table33%1/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | push @rows, map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 2 | my $ph = _pvc_phase( $k, $ns, $_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | my $sc = $p->{$_}{storage_class} // ( grep { $k->{storageclasses}{$_}{default} } sort keys %{ $k->{storageclasses} || {} } )[0] // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition28%2/7
($$p{$_}{"storage_class"} // (grep {$$k{"storageclasses"}{$_}{"default"};} sort(keys %{$$k{"storageclasses"} or {};}))[0]) // ""
$$p{$_}{"storage_class"} // (grep {$$k{"storageclasses"}{$_}{"default"};} sort(keys %{$$k{"storageclasses"} or {};}))[0]
$$k{'storageclasses'} || {}
MC/DC0%0/2
($$p{$_}{"storage_class"} // (grep {$$k{"storageclasses"}{$_}{"default"};} sort(keys %{$$k{"storageclasses"} or {};}))[0]) // ""
$$p{$_}{"storage_class"}
(grep {$$k{"storageclasses"}{$_}{"default"};} sort(keys %{$$k{"storageclasses"} or {};}))[0]
MC/DC0%0/1
$$k{'storageclasses'} || {}
$$k{'storageclasses'}
Truth table33%1/3
A // B
A= $$p{$_}{"storage_class"}B= (grep {$$k{"storageclasses"}{$_}{"default"};} sort(keys %{$$k{"storageclasses"} or {};}))[0]
Truth table0%0/2
A
A= $$k{'storageclasses'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 2 | ▶ | [ ( $multi ? $ns : () ), $_, $ph, $ph eq 'Bound' ? 'pvc-' . substr( _hash( [ $ns, $_ ] ), 0, 8 ) : '', $ph eq 'Bound' ? $p->{$_}{size} : '', $ph eq 'Bound' ? 'RWO' : '', $sc, '<unset>', '2d' ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 2 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 2 | ▶ | $_ = [ @$_[ 0 .. ( $multi ? 4 : 3 ) ], 'ACCESS MODES', @$_[ ( $multi ? 7 : 6 ) .. $#$_ ] ] for grep { $_->[ $multi ? 5 : 4 ] eq 'ACCESS' } @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | elsif ( $kind eq 'networkpolicies' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | ▶ | my $p = $obj->{networkpolicies} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$obj{'networkpolicies'} || {}
MC/DC0%0/1
$$obj{'networkpolicies'} || {}
$$obj{'networkpolicies'}
Truth table0%0/2
A
A= $$obj{'networkpolicies'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
!defined($name) || $_ eq $name
MC/DC0%0/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table0%0/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | return ( qq{Error from server (NotFound): networkpolicies.networking.k8s.io "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table0%0/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 0 | ▶ | return _structured( $o, 'networkpolicies', { map { $_ => $p->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC0%0/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table0%0/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | push @rows, map { [ ( $multi ? $ns : () ), $_, _labels_text( $p->{$_}{pod_selector} ) =~ s/\A<none>\z/<none>/r, '41d' ] } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME POD-SELECTOR AGE ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | ▶ | elsif ( $kind eq 'secrets' || $kind eq 'configmaps' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$kind eq "secrets" or $kind eq "configmaps"
MC/DC50%1/2
$kind eq "secrets" or $kind eq "configmaps"
$kind eq "secrets"
$kind eq "configmaps"
Truth table66%2/3
A or B
A= $kind eq "secrets"B= $kind eq "configmaps"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 6 | ▶ | my $p = $kind eq 'secrets' ? _secrets_all( $k, $ns ) : $obj->{$kind} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$obj{$kind} or {}
MC/DC0%0/1
$$obj{$kind} or {}
$$obj{$kind}
Truth table0%0/2
A
A= $$obj{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 6 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
!defined($name) || $_ eq $name
MC/DC100%2/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table100%3/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 6 | ▶ | return ( qq{Error from server (NotFound): $kind "$name" not found}, 0 ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table66%2/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 6 | ▶ | return _structured( $o, $kind, { map { $_ => $p->{$_} } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC50%1/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table66%2/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 2 | ▶ | push @rows, map { [ ( $multi ? $ns : () ), $_, ( $kind eq 'secrets' ? _secret_type( $p->{$_} ) : () ), scalar( grep { !/\A_/ } keys %{ $p->{$_} } ), '41d' ] } @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 2 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), 'NAME', ( $kind eq 'secrets' ? 'TYPE' : () ), 'DATA', 'AGE' ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | elsif ( $kind eq 'events' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 4 | my @e = map { my $p = $_; $p->{reason} ? [ '2m', $p->{reason} eq 'NotReady' || $p->{reason} eq 'CrashLoopBackOff' || $p->{reason} eq 'ImagePullBackOff' || $p->{reason} eq 'Unschedulable' ? 'Warning' : 'Normal', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | { NotReady => 'Unhealthy', CrashLoopBackOff => 'BackOff', ImagePullBackOff => 'Failed', Unschedulable => 'FailedScheduling', CreateContainerConfigError => 'Failed' }->{ $p->{reason} } // $p->{reason}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 14 | ▶ | "pod/$p->{name}", $p->{reason} eq 'ImagePullBackOff' ? qq{Failed to pull image "$p->{container}{image}": rpc error: code = NotFound desc = failed to pull and unpack image "$p->{container}{image}": failed to resolve reference "$p->{container}{image}": $p->{container}{image}: not found} : $p->{message} ] : () } _pods( $k, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/12
$$p{"reason"} eq "NotReady" or $$p{"reason"} eq "CrashLoopBackOff" or $$p{"reason"} eq "ImagePullBackOff" or $$p{"reason"} eq "Unschedulable"
$$p{"reason"} eq "NotReady" or $$p{"reason"} eq "CrashLoopBackOff" or $$p{"reason"} eq "ImagePullBackOff"
$$p{"reason"} eq "NotReady" or $$p{"reason"} eq "CrashLoopBackOff"
{"NotReady", "Unhealthy", "CrashLoopBackOff", "BackOff", "ImagePullBackOff", "Failed", "Unschedulable", "FailedScheduling", "CreateContainerConfigError", "Failed"}->{$$p{"reason"}} // $$p{"reason"}
MC/DC0%0/4
$$p{"reason"} eq "NotReady" or $$p{"reason"} eq "CrashLoopBackOff" or $$p{"reason"} eq "ImagePullBackOff" or $$p{"reason"} eq "Unschedulable"
$$p{"reason"} eq "NotReady"
$$p{"reason"} eq "CrashLoopBackOff"
$$p{"reason"} eq "ImagePullBackOff"
$$p{"reason"} eq "Unschedulable"
MC/DC0%0/2
{"NotReady", "Unhealthy", "CrashLoopBackOff", "BackOff", "ImagePullBackOff", "Failed", "Unschedulable", "FailedScheduling", "CreateContainerConfigError", "Failed"}->{$$p{"reason"}} // $$p{"reason"}
{"NotReady", "Unhealthy", "CrashLoopBackOff", "BackOff", "ImagePullBackOff", "Failed", "Unschedulable", "FailedScheduling", "CreateContainerConfigError", "Failed"}->{$$p{"reason"}}
$$p{"reason"}
Truth table0%0/5
A or B or C or D
A= $$p{"reason"} eq "NotReady"B= $$p{"reason"} eq "CrashLoopBackOff"C= $$p{"reason"} eq "ImagePullBackOff"D= $$p{"reason"} eq "Unschedulable"
Truth table0%0/3
A // B
A= {"NotReady", "Unhealthy", "CrashLoopBackOff", "BackOff", "ImagePullBackOff", "Failed", "Unschedulable", "FailedScheduling", "CreateContainerConfigError", "Failed"}->{$$p{"reason"}}B= $$p{"reason"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 10 | push @e, map { my $t = $obj->{deployments}{$_}{template}; _sa_exists( $k, $ns, $t->{service_account} ) ? () | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | : [ '2m', 'Warning', 'FailedCreate', "replicaset/$_-" . _hash( [ $t, $obj->{deployments}{$_}{restarted_at} // '' ] ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 10 | ▶ | qq{Error creating: pods "$_-} . _hash( [ $t, $obj->{deployments}{$_}{restarted_at} // '' ] ) . qq{-" is forbidden: error looking up service account $ns/$t->{service_account}: serviceaccount "$t->{service_account}" not found} ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$obj{"deployments"}{$_}{"restarted_at"} // ""
$$obj{"deployments"}{$_}{"restarted_at"} // ""
MC/DC0%0/1
$$obj{"deployments"}{$_}{"restarted_at"} // ""
$$obj{"deployments"}{$_}{"restarted_at"}
MC/DC0%0/1
$$obj{"deployments"}{$_}{"restarted_at"} // ""
$$obj{"deployments"}{$_}{"restarted_at"}
Truth table50%1/2
A
A= $$obj{"deployments"}{$_}{"restarted_at"}
Truth table50%1/2
A
A= $$obj{"deployments"}{$_}{"restarted_at"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 4 | ▶ | sort keys %{ $obj->{deployments} || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$obj{'deployments'} || {}
MC/DC0%0/1
$$obj{'deployments'} || {}
$$obj{'deployments'}
Truth table50%1/2
A
A= $$obj{'deployments'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 4 | ▶ | push @e, map { _pvc_phase( $k, $ns, $_ ) eq 'Pending' ? [ '2m', 'Warning', 'ProvisioningFailed', "persistentvolumeclaim/$_", 'storageclass.storage.k8s.io "' . ( $obj->{pvcs}{$_}{storage_class} // '' ) . '" not found' ] : () } sort keys %{ $obj->{pvcs} || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition75%3/4
$$obj{"pvcs"}{$_}{"storage_class"} // ""
$$obj{'pvcs'} || {}
MC/DC0%0/1
$$obj{"pvcs"}{$_}{"storage_class"} // ""
$$obj{"pvcs"}{$_}{"storage_class"}
MC/DC100%1/1
$$obj{'pvcs'} || {}
$$obj{'pvcs'}
Truth table50%1/2
A
A= $$obj{"pvcs"}{$_}{"storage_class"}
Truth table100%2/2
A
A= $$obj{'pvcs'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 4 | ▶ | push @rows, map { [ ( $multi ? $ns : () ), @$_ ] } @e; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 4 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( LAST SEEN TYPE REASON OBJECT MESSAGE ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 4 | ▶ | $_ = [ @$_[ 0 .. ( $multi ? 0 : -1 ) ], 'LAST SEEN', @$_[ ( $multi ? 3 : 2 ) .. $#$_ ] ] for grep { $_->[ $multi ? 1 : 0 ] eq 'LAST' } @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | elsif ( $kind eq 'replicasets' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 1 | my @rs = _replicasets( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | ▶ | @rs = grep { $_->{name} eq $name } @rs if defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 1 | ▶ | return ( qq{Error from server (NotFound): replicasets.apps "$name" not found}, 0 ) if defined $name && !@rs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and not @rs
MC/DC0%0/2
defined $name and not @rs
defined $name
not @rs
Truth table33%1/3
A and not(B)
A= defined $nameB= not @rs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 1 | ▶ | push @rows, map { [ ( $multi ? $ns : () ), $_->{name}, $_->{desired}, $_->{current}, $_->{ready}, '12m' ] } @rs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 1 | ▶ | unshift @rows, [ ( $multi ? 'NAMESPACE' : () ), qw( NAME DESIRED CURRENT READY AGE ) ] if @rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 25 | ▶ | if (@rows) { shift @rows if @all; push @all, @rows } # -A: eine Tabelle, ein Kopf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 24 | ▶ | push @out, _cols(@all) if @all; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 24 | ▶ | return ( @out ? join( "\n", @out ) : ( $o->{all} ? 'No resources found' : "No resources found in $o->{ns} namespace." ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 64 | ▶ | sub _label_sel { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_label_sel: called CC=6 SCAR=18.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 64 | my ( $sel, $l ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 64 | ▶ | return 1 unless defined $sel; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 21 | for my $part ( split /,/, $sel ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 21 | my ( $k, $v ) = split /=/, $part, 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 21 | ▶ | return 0 unless defined $l->{$k} && ( !defined $v || $l->{$k} eq $v ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
defined $$l{$k} and !defined($v) || $$l{$k} eq $v
not defined $v or $$l{$k} eq $v
MC/DC33%1/3
defined $$l{$k} and !defined($v) || $$l{$k} eq $v
defined $$l{$k}
not defined $v
$$l{$k} eq $v
Truth table50%2/4
A and not(B) or C
A= defined $$l{$k}B= not defined $vC= $$l{$k} eq $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 10 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | sub _pod_obj { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pod_obj: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | my ($p) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | return { labels => $p->{labels}, containers => $p->{template}{containers}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | ▶ | status => { phase => $p->{phase}, ready => $p->{ready} ? JSON::MaybeXS::true() : JSON::MaybeXS::false(), ( $p->{reason} ? ( reason => $p->{reason} ) : () ) } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 17 | ▶ | sub _structured { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_structured: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 17 | my ( $o, $kind, $objs ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 17 | my @items = map { _api_obj( $kind, $_, $objs->{$_}, $o->{ns} ) } sort keys %$objs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 17 | ▶ | my $data = @items == 1 ? $items[0] : { apiVersion => 'v1', kind => 'List', items => \@items }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 17 | ▶ | return ( $o->{out} =~ /\Ajson/ ? $OUT_JSON->encode($data) =~ s/\s+\z//r : do { local $YAML::XS::Boolean = q{JSON::PP}; YAML::XS::Dump($data) } =~ s/\A---\n//r =~ s/\s+\z//r, 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | # Objekt des Zustands -> Form der API (fuer -o yaml|json); vereinfacht | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | 51 | ▶ | sub _api_obj { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_api_obj: called CC=28 SCAR=40.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 51 | my ( $kind, $name, $x, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 51 | ▶ | my $meta = { name => $name, ( !$CLUSTER{$kind} ? ( namespace => $ns ) : () ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | 51 | ▶ | if ( $GEN{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | # tiefe Kopie: ein JSON-Patch aendert das Ergebnis an Ort und Stelle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 7 | my %x = %{ JSON::MaybeXS->new( canonical => 1 )->decode( JSON::MaybeXS->new( canonical => 1 )->encode($x) ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 7 | ▶ | my $m = delete $x{metadata} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $x{'metadata'} || {}
MC/DC100%1/1
delete $x{'metadata'} || {}
delete $x{'metadata'}
Truth table100%2/2
A
A= delete $x{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 7 | my $st = delete $x{_status}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 7 | delete @x{ grep {/\A_/} keys %x }; # nur fuer die Simulation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 7 | ▶ | return { apiVersion => $GEN{$kind}[0], kind => $GEN{$kind}[1], metadata => { %$meta, %$m }, %x, ( $st ? ( status => $st ) : () ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 44 | ▶ | if ( $kind eq 'deployments' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | return { apiVersion => 'apps/v1', kind => 'Deployment', metadata => { %$meta, generation => $x->{generation} // 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | spec => { replicas => $x->{replicas}, selector => { matchLabels => $x->{selector} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | template => { metadata => { labels => $x->{template}{labels}, ( $x->{template}{annotations} ? ( annotations => $x->{template}{annotations} ) : () ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 31 | ▶ | spec => { ( defined $x->{template}{service_account} ? ( serviceAccountName => $x->{template}{service_account} ) : () ), containers => [ map { _api_container($_) } @{ $x->{template}{containers} } ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 31 | ▶ | ( grep { @{ $_->{volumes} || [] } } @{ $x->{template}{containers} } ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$_{'volumes'} || []
MC/DC0%0/1
$$_{'volumes'} || []
$$_{'volumes'}
Truth table50%1/2
A
A= $$_{'volumes'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | ▶ | ? ( volumes => [ map { { name => $_->{claim}, persistentVolumeClaim => { claimName => $_->{claim} } } } map { @{ $_->{volumes} || [] } } @{ $x->{template}{containers} } ] ) : () } } } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%2/4
$$x{"generation"} // 1
$$_{'volumes'} || []
MC/DC100%1/1
$$x{"generation"} // 1
$$x{"generation"}
MC/DC0%0/1
$$_{'volumes'} || []
$$_{'volumes'}
Truth table100%2/2
A
A= $$x{"generation"}
Truth table0%0/2
A
A= $$_{'volumes'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 13 | ▶ | if ( $kind eq 'services' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | return { apiVersion => 'v1', kind => 'Service', metadata => $meta, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 4 | ▶ | spec => { type => $x->{type} // 'ClusterIP', selector => $x->{selector}, ports => [ map { { port => $_->{port}, targetPort => $_->{target}, protocol => 'TCP', ( $_->{name} ? ( name => $_->{name} ) : () ) } } @{ $x->{ports} || [] } ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$x{"type"} // "ClusterIP"
$$x{'ports'} || []
MC/DC0%0/1
$$x{"type"} // "ClusterIP"
$$x{"type"}
MC/DC0%0/1
$$x{'ports'} || []
$$x{'ports'}
Truth table50%1/2
A
A= $$x{"type"}
Truth table50%1/2
A
A= $$x{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 9 | ▶ | if ( $kind eq 'secrets' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 8 | return { apiVersion => 'v1', kind => 'Secret', metadata => $meta, type => _secret_type($x), data => { map { $_ => MIME::Base64::encode_base64( $x->{$_}, '' ) } grep { !/\A_/ } keys %$x } }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 1 | ▶ | return { apiVersion => 'v1', kind => 'ConfigMap', metadata => $meta, data => $x } if $kind eq 'configmaps'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 1 | ▶ | if ( $kind eq 'pvcs' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | return { apiVersion => 'v1', kind => 'PersistentVolumeClaim', metadata => $meta, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | ▶ | spec => { accessModes => ['ReadWriteOnce'], resources => { requests => { storage => $x->{size} } }, ( defined $x->{storage_class} ? ( storageClassName => $x->{storage_class} ) : () ) } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | 1 | ▶ | if ( $kind eq 'networkpolicies' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | return { apiVersion => 'networking.k8s.io/v1', kind => 'NetworkPolicy', metadata => $meta, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | spec => { podSelector => { matchLabels => $x->{pod_selector} || {} }, policyTypes => ['Ingress'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 1 | ▶ | ingress => [ map { my $r = $_; +{ ( $r->{from} ? ( from => [ map { { podSelector => { matchLabels => $_ } } } @{ $r->{from} } ] ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 1 | ▶ | ( $r->{ports} ? ( ports => [ map { { protocol => 'TCP', port => $_ } } @{ $r->{ports} } ] ) : () ) } } @{ $x->{ingress} || [] } ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$x{'pod_selector'} || {}
$$x{'ingress'} || []
MC/DC0%0/1
$$x{'pod_selector'} || {}
$$x{'pod_selector'}
MC/DC0%0/1
$$x{'ingress'} || []
$$x{'ingress'}
Truth table50%1/2
A
A= $$x{'pod_selector'}
Truth table50%1/2
A
A= $$x{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 0 | ▶ | if ( $kind eq 'storageclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | return { apiVersion => 'storage.k8s.io/v1', kind => 'StorageClass', metadata => { %$meta, ( $x->{default} ? ( annotations => { 'storageclass.kubernetes.io/is-default-class' => 'true' } ) : () ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | ▶ | provisioner => $x->{provisioner}, reclaimPolicy => 'Delete', volumeBindingMode => 'Immediate' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | ▶ | if ( $kind eq 'pods' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | return { apiVersion => 'v1', kind => 'Pod', metadata => { %$meta, labels => $x->{labels} }, spec => { containers => [ map { _api_container($_) } @{ $x->{containers} } ] }, status => $x->{status} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | return $x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 31 | ▶ | sub _api_container { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_api_container: called CC=11 SCAR=28.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | 31 | my ($c) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | name => $c->{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | image => $c->{image}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 31 | ▶ | ( $c->{ports} ? ( ports => [ map { { containerPort => $_, protocol => 'TCP' } } @{ $c->{ports} } ] ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | ( $c->{env} ? ( env => [ map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | defined $_->{secret} ? { name => $_->{name}, valueFrom => { secretKeyRef => { name => $_->{secret}, key => $_->{key}, ( $_->{optional} ? ( optional => JSON::MaybeXS::true() ) : () ) } } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | : defined $_->{configmap} ? { name => $_->{name}, valueFrom => { configMapKeyRef => { name => $_->{configmap}, key => $_->{key} } } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 17 | ▶ | : { name => $_->{name}, value => $_->{value} } } @{ $c->{env} } ] ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition50%1/2
$$c{"readiness"}{"path"} // "/"
MC/DC0%0/1
$$c{"readiness"}{"path"} // "/"
$$c{"readiness"}{"path"}
Truth table50%1/2
A
A= $$c{"readiness"}{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | ( $c->{readiness} ? ( readinessProbe => { httpGet => { path => $c->{readiness}{path} // '/', port => $c->{readiness}{port} }, periodSeconds => 10 } ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | 0 | ▶ | ( $c->{volumes} ? ( volumeMounts => [ map { { name => $_->{claim}, mountPath => $_->{mount} // '/data' } } @{ $c->{volumes} } ] ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$_{"mount"} // "/data"
MC/DC0%0/1
$$_{"mount"} // "/data"
$$_{"mount"}
Truth table0%0/2
A
A= $$_{"mount"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 31 | ▶ | ( $c->{privileged} ? ( securityContext => { privileged => JSON::MaybeXS::true() } ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | # API-Form -> Zustand (fuer apply/create/patch) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 17 | ▶ | sub _from_api { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_from_api: called CC=58 SCAR=52.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 17 | my ( $kind, $doc, $old ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | 17 | ▶ | my $s = $doc->{spec} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$doc{'spec'} || {}
MC/DC100%1/1
$$doc{'spec'} || {}
$$doc{'spec'}
Truth table100%2/2
A
A= $$doc{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 17 | ▶ | if ( $GEN{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 5 | my %d = %$doc; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 5 | delete @d{qw( apiVersion kind status )}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 5 | ▶ | my $m = delete $d{metadata} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
delete $d{'metadata'} || {}
MC/DC0%0/1
delete $d{'metadata'} || {}
delete $d{'metadata'}
Truth table50%1/2
A
A= delete $d{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 5 | ▶ | my %m = map { $_ => { %{ $m->{$_} } } } grep { ref $m->{$_} eq 'HASH' && %{ $m->{$_} } } qw( labels annotations ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
ref $$m{$_} eq 'HASH' && %{$$m{$_};}
MC/DC50%1/2
ref $$m{$_} eq 'HASH' && %{$$m{$_};}
ref $$m{$_} eq 'HASH'
%{$$m{$_};}
Truth table66%2/3
A && B
A= ref $$m{$_} eq 'HASH'B= %{$$m{$_};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 5 | ▶ | delete $m{annotations}{'kubectl.kubernetes.io/last-applied-configuration'} if $m{annotations}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | 5 | ▶ | delete $m{annotations} if $m{annotations} && !%{ $m{annotations} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$m{"annotations"} and not %{$m{"annotations"};}
MC/DC0%0/2
$m{"annotations"} and not %{$m{"annotations"};}
$m{"annotations"}
not %{$m{"annotations"};}
Truth table66%2/3
A and not(B)
A= $m{"annotations"}B= not %{$m{"annotations"};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 5 | ▶ | $d{metadata} = \%m if %m; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 5 | return \%d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 12 | ▶ | if ( $kind eq 'deployments' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | 3 | ▶ | my $t = $s->{template} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{'template'} || {}
MC/DC0%0/1
$$s{'template'} || {}
$$s{'template'}
Truth table50%1/2
A
A= $$s{'template'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 3 | ▶ | my %olds = map { $_->{name} => $_ } @{ ( $old || {} )->{template}{containers} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($old || {})->{'template'}{'containers'} || []
$old || {}
MC/DC0%0/1
($old || {})->{'template'}{'containers'} || []
$old
Truth table50%1/2
A
A= $old
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 3 | ▶ | %{ $old || {} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%6/12
$old || {}
$$s{"replicas"} // 1
($$s{"selector"} || {})->{"matchLabels"} // {}
$$s{'selector'} || {}
($$t{"metadata"} || {})->{"labels"} // {}
$$t{'metadata'} || {}
MC/DC0%0/1
$old || {}
$old
MC/DC0%0/1
$$s{"replicas"} // 1
$$s{"replicas"}
MC/DC0%0/1
($$s{"selector"} || {})->{"matchLabels"} // {}
$$s{'selector'}
MC/DC0%0/1
($$t{"metadata"} || {})->{"labels"} // {}
$$t{'metadata'}
Truth table50%1/2
A
A= $old
Truth table50%1/2
A
A= $$s{"replicas"}
Truth table50%1/2
A
A= $$s{'selector'}
Truth table50%1/2
A
A= $$t{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | replicas => $s->{replicas} // 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | selector => ( $s->{selector} || {} )->{matchLabels} // {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | template => { labels => ( $t->{metadata} || {} )->{labels} // {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 3 | ▶ | ( %{ ( $t->{metadata} || {} )->{annotations} || {} } ? ( annotations => $t->{metadata}{annotations} ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
($$t{'metadata'} || {})->{'annotations'} || {}
$$t{'metadata'} || {}
$$t{'spec'} || {}
MC/DC0%0/1
($$t{'metadata'} || {})->{'annotations'} || {}
$$t{'metadata'}
MC/DC0%0/1
$$t{'spec'} || {}
$$t{'spec'}
Truth table50%1/2
A
A= $$t{'metadata'}
Truth table50%1/2
A
A= $$t{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | ( defined( ( $t->{spec} || {} )->{serviceAccountName} ) ? ( service_account => $t->{spec}{serviceAccountName} ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 3 | ▶ | containers => [ map { _container_from_api( $_, $olds{ $_->{name} }, $t->{spec}{volumes} ) } @{ ( $t->{spec} || {} )->{containers} || [] } ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$t{'spec'} || {})->{'containers'} || []
$$t{'spec'} || {}
MC/DC0%0/1
($$t{'spec'} || {})->{'containers'} || []
$$t{'spec'}
Truth table50%1/2
A
A= $$t{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 9 | ▶ | if ( $kind eq 'services' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 2 | ▶ | return { %{ $old || {} }, selector => $s->{selector} // {}, ( $s->{type} && ( $s->{type} ne 'ClusterIP' || ( $old || {} )->{type} ) ? ( type => $s->{type} ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition41%5/12
$old || {}
$$s{"selector"} // {}
$$s{"type"} and $$s{"type"} ne "ClusterIP" || ($old || {})->{"type"}
$$s{"type"} ne "ClusterIP" or ($old || {})->{"type"}
$old || {}
MC/DC0%0/1
$$s{"selector"} // {}
$$s{"selector"}
MC/DC0%0/3
$$s{"type"} and $$s{"type"} ne "ClusterIP" || ($old || {})->{"type"}
$$s{"type"}
$$s{"type"} ne "ClusterIP"
$old
Truth table50%1/2
A
A= $$s{"selector"}
Truth table25%1/4
A and B or C
A= $$s{"type"}B= $$s{"type"} ne "ClusterIP"C= $old
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 2 | ▶ | ports => [ map { { port => $_->{port}, target => $_->{targetPort} // $_->{port}, ( $_->{name} ? ( name => $_->{name} ) : () ) } } @{ $s->{ports} || [] } ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
$$_{"targetPort"} // $$_{"port"}
$$s{'ports'} || []
MC/DC0%0/2
$$_{"targetPort"} // $$_{"port"}
$$_{"targetPort"}
$$_{"port"}
MC/DC0%0/1
$$s{'ports'} || []
$$s{'ports'}
Truth table33%1/3
A // B
A= $$_{"targetPort"}B= $$_{"port"}
Truth table50%1/2
A
A= $$s{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 7 | ▶ | if ( $kind eq 'secrets' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 3 | ▶ | return { ( map { $_ => MIME::Base64::decode_base64( $doc->{data}{$_} ) } keys %{ $doc->{data} || {} } ), %{ $doc->{stringData} || {} } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%3/4
$$doc{'data'} || {}
$$doc{'stringData'} || {}
MC/DC0%0/1
$$doc{'data'} || {}
$$doc{'data'}
MC/DC100%1/1
$$doc{'stringData'} || {}
$$doc{'stringData'}
Truth table50%1/2
A
A= $$doc{'data'}
Truth table100%2/2
A
A= $$doc{'stringData'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 0 | ▶ | return { %{ $doc->{data} || {} } } if $kind eq 'configmaps'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$doc{'data'} || {}
MC/DC0%0/1
$$doc{'data'} || {}
$$doc{'data'}
Truth table0%0/2
A
A= $$doc{'data'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 4 | ▶ | if ( $kind eq 'pvcs' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 3 | ▶ | return { size => ( ( $s->{resources} || {} )->{requests} || {} )->{storage}, ( defined $s->{storageClassName} ? ( storage_class => $s->{storageClassName} ) : () ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
($$s{'resources'} || {})->{'requests'} || {}
$$s{'resources'} || {}
MC/DC0%0/1
($$s{'resources'} || {})->{'requests'} || {}
$$s{'resources'}
Truth table50%1/2
A
A= $$s{'resources'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 1 | ▶ | if ( $kind eq 'networkpolicies' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | return { pod_selector => ( $s->{podSelector} || {} )->{matchLabels} // {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 1 | ▶ | ingress => [ map { my $r = $_; +{ ( $r->{from} ? ( from => [ map { ( $_->{podSelector} || {} )->{matchLabels} // {} } @{ $r->{from} } ] ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
($$_{"podSelector"} || {})->{"matchLabels"} // {}
$$_{'podSelector'} || {}
MC/DC0%0/1
($$_{"podSelector"} || {})->{"matchLabels"} // {}
$$_{'podSelector'}
Truth table50%1/2
A
A= $$_{'podSelector'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | 1 | ▶ | ( $r->{ports} ? ( ports => [ map { $_->{port} } @{ $r->{ports} } ] ) : () ) } } @{ $s->{ingress} || [] } ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
($$s{"podSelector"} || {})->{"matchLabels"} // {}
$$s{'podSelector'} || {}
$$s{'ingress'} || []
MC/DC0%0/1
($$s{"podSelector"} || {})->{"matchLabels"} // {}
$$s{'podSelector'}
MC/DC0%0/1
$$s{'ingress'} || []
$$s{'ingress'}
Truth table50%1/2
A
A= $$s{'podSelector'}
Truth table50%1/2
A
A= $$s{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 0 | ▶ | if ( $kind eq 'storageclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 0 | ▶ | my $a = ( $doc->{metadata} || {} )->{annotations} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
($$doc{'metadata'} || {})->{'annotations'} || {}
$$doc{'metadata'} || {}
MC/DC0%0/1
($$doc{'metadata'} || {})->{'annotations'} || {}
$$doc{'metadata'}
Truth table0%0/2
A
A= $$doc{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 0 | ▶ | return { provisioner => $doc->{provisioner}, ( ( $a->{'storageclass.kubernetes.io/is-default-class'} // '' ) eq 'true' ? ( default => JSON::MaybeXS::true() ) : () ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$a{"storageclass.kubernetes.io/is-default-class"} // ""
MC/DC0%0/1
$$a{"storageclass.kubernetes.io/is-default-class"} // ""
$$a{"storageclass.kubernetes.io/is-default-class"}
Truth table0%0/2
A
A= $$a{"storageclass.kubernetes.io/is-default-class"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | 0 | return {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | 3 | ▶ | sub _container_from_api { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_container_from_api: called CC=17 SCAR=36.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 3 | my ( $c, $old, $vols ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 3 | ▶ | $old ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$old ||= {}
MC/DC0%0/1
$old ||= {}
$old
Truth table50%1/2
A
A= $old
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | 0 | ▶ | my %claim = map { $_->{name} => ( $_->{persistentVolumeClaim} || {} )->{claimName} } @{ $vols || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$$_{'persistentVolumeClaim'} || {}
$vols || []
MC/DC0%0/1
$$_{'persistentVolumeClaim'} || {}
$$_{'persistentVolumeClaim'}
MC/DC0%0/1
$vols || []
$vols
Truth table0%0/2
A
A= $$_{'persistentVolumeClaim'}
Truth table50%1/2
A
A= $vols
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 3 | ▶ | my $rp = ( $c->{readinessProbe} || {} )->{httpGet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$c{'readinessProbe'} || {}
MC/DC0%0/1
$$c{'readinessProbe'} || {}
$$c{'readinessProbe'}
Truth table50%1/2
A
A= $$c{'readinessProbe'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | my %n = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | %$old, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | name => $c->{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | image => $c->{image}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | 3 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 3 | delete @n{qw( ports env readiness volumes privileged )}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | 3 | ▶ | $n{ports} = [ map { $_->{containerPort} } @{ $c->{ports} } ] if $c->{ports}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | $n{env} = [ map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | 3 | ▶ | my $v = $_->{valueFrom} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$_{'valueFrom'} || {}
MC/DC0%0/1
$$_{'valueFrom'} || {}
$$_{'valueFrom'}
Truth table50%1/2
A
A= $$_{'valueFrom'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | $v->{secretKeyRef} ? { name => $_->{name}, secret => $v->{secretKeyRef}{name}, key => $v->{secretKeyRef}{key}, ( $v->{secretKeyRef}{optional} ? ( optional => JSON::MaybeXS::true() ) : () ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | : $v->{configMapKeyRef} ? { name => $_->{name}, configmap => $v->{configMapKeyRef}{name}, key => $v->{configMapKeyRef}{key} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | 3 | ▶ | : { name => $_->{name}, value => $_->{value} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 3 | ▶ | } @{ $c->{env} } ] if $c->{env}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 3 | ▶ | $n{readiness} = { port => $rp->{port}, path => $rp->{path} // '/' } if $rp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$rp{"path"} // "/"
MC/DC0%0/1
$$rp{"path"} // "/"
$$rp{"path"}
Truth table50%1/2
A
A= $$rp{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | 0 | ▶ | $n{volumes} = [ map { { claim => $claim{ $_->{name} } // $_->{name}, mount => $_->{mountPath} } } @{ $c->{volumeMounts} } ] if $c->{volumeMounts}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$claim{$$_{"name"}} // $$_{"name"}
MC/DC0%0/2
$claim{$$_{"name"}} // $$_{"name"}
$claim{$$_{"name"}}
$$_{"name"}
Truth table0%0/3
A // B
A= $claim{$$_{"name"}}B= $$_{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 3 | ▶ | $n{privileged} = JSON::MaybeXS::true() if ( $c->{securityContext} || {} )->{privileged}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$c{'securityContext'} || {}
MC/DC0%0/1
$$c{'securityContext'} || {}
$$c{'securityContext'}
Truth table50%1/2
A
A= $$c{'securityContext'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | 3 | return \%n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | 18 | ▶ | sub _bump { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_bump: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | 18 | my ($d) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | 18 | ▶ | $d->{generation} = ( $d->{generation} // 1 ) + 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$d{"generation"} // 1
MC/DC0%0/1
$$d{"generation"} // 1
$$d{"generation"}
Truth table50%1/2
A
A= $$d{"generation"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | 18 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | 23 | ▶ | sub _store { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_store: called CC=28 SCAR=37.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 23 | my ( $k, $kind, $ns, $name, $new ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 0 | ▶ | if ( $kind eq 'storageclasses' ) { $k->{storageclasses}{$name} = $new; return 'created' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | 0 | ▶ | if ( $kind eq 'namespaces' ) { $k->{namespaces}{$name} //= {}; return 'created' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$k{"namespaces"}{$name} //= {}
MC/DC0%0/1
$$k{"namespaces"}{$name} //= {}
$$k{"namespaces"}{$name}
Truth table0%0/2
A
A= $$k{"namespaces"}{$name}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | 23 | ▶ | die qq{error: $kind are derived by the controller and cannot be applied\n} if $DERIVED{$kind}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | 23 | ▶ | my $o = $CLUSTER{$kind} ? $k : $k->{namespaces}{$ns} or die qq{Error from server (NotFound): namespaces "$ns" not found\n}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | 23 | my $old = $o->{$kind}{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | 23 | ▶ | if ( $kind =~ /\A(?:cluster)?rolebindings\z/ && $old && $J->encode( $old->{roleRef} // {} ) ne $J->encode( $new->{roleRef} // {} ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition70%7/10
$kind =~ /\A(?:cluster)?rolebindings\z/ and $old and $J->encode($$old{"roleRef"} // {}) ne $J->encode($$new{"roleRef"} // {})
$kind =~ /\A(?:cluster)?rolebindings\z/ and $old
$$old{"roleRef"} // {}
$$new{"roleRef"} // {}
MC/DC66%2/3
$kind =~ /\A(?:cluster)?rolebindings\z/ and $old and $J->encode($$old{"roleRef"} // {}) ne $J->encode($$new{"roleRef"} // {})
$kind =~ /\A(?:cluster)?rolebindings\z/
$old
$J->encode($$old{"roleRef"} // {}) ne $J->encode($$new{"roleRef"} // {})
MC/DC0%0/1
$$old{"roleRef"} // {}
$$old{"roleRef"}
MC/DC0%0/1
$$new{"roleRef"} // {}
$$new{"roleRef"}
Truth table75%3/4
A and B and C
A= $kind =~ /\A(?:cluster)?rolebindings\z/B= $oldC= $J->encode($$old{"roleRef"} // {}) ne $J->encode($$new{"roleRef"} // {})
Truth table50%1/2
A
A= $$old{"roleRef"}
Truth table50%1/2
A
A= $$new{"roleRef"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | 2 | ▶ | die qq{The $GEN{$kind}[1] "$name" is invalid: roleRef: Invalid value: } . $J->encode( $new->{roleRef} // {} ) =~ s/\s+/ /gr . qq{: cannot change roleRef\n}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$new{"roleRef"} // {}
MC/DC0%0/1
$$new{"roleRef"} // {}
$$new{"roleRef"}
Truth table50%1/2
A
A= $$new{"roleRef"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | 21 | ▶ | if ( $kind eq 'pvcs' && $old && $J->encode( { %$old, size => undef } ) ne $J->encode( { %$new, size => undef } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$kind eq "pvcs" and $old and $J->encode({%$old, "size", undef}) ne $J->encode({%$new, "size", undef})
$kind eq "pvcs" and $old
MC/DC100%3/3
$kind eq "pvcs" and $old and $J->encode({%$old, "size", undef}) ne $J->encode({%$new, "size", undef})
$kind eq "pvcs"
$old
$J->encode({%$old, "size", undef}) ne $J->encode({%$new, "size", undef})
Truth table100%4/4
A and B and C
A= $kind eq "pvcs"B= $oldC= $J->encode({%$old, "size", undef}) ne $J->encode({%$new, "size", undef})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | 1 | die qq{The PersistentVolumeClaim "$name" is invalid: spec: Forbidden: spec is immutable after creation except resources.requests and volumeAttributesClassName for bound claims\n}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | 20 | ▶ | if ( $kind eq 'deployments' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | die qq{The Deployment "$name" is invalid: spec.selector: Invalid value: field is immutable\n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | 9 | ▶ | if $old && $J->encode( $old->{selector} ) ne $J->encode( $new->{selector} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$old and $J->encode($$old{"selector"}) ne $J->encode($$new{"selector"})
MC/DC0%0/2
$old and $J->encode($$old{"selector"}) ne $J->encode($$new{"selector"})
$old
$J->encode($$old{"selector"}) ne $J->encode($$new{"selector"})
Truth table33%1/3
A and B
A= $oldB= $J->encode($$old{"selector"}) ne $J->encode($$new{"selector"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | die qq{The Deployment "$name" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{} : `selector` does not match template `labels`\n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | 9 | ▶ | unless _sel_match( $new->{selector}, $new->{template}{labels} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | 9 | ▶ | $new->{generation} = $old->{generation} // 1 if $old; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$old{"generation"} // 1
MC/DC0%0/1
$$old{"generation"} // 1
$$old{"generation"}
Truth table50%1/2
A
A= $$old{"generation"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | 9 | ▶ | _bump($new) if $old && $J->encode( $old->{template} ) ne $J->encode( $new->{template} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$old and $J->encode($$old{"template"}) ne $J->encode($$new{"template"})
MC/DC50%1/2
$old and $J->encode($$old{"template"}) ne $J->encode($$new{"template"})
$old
$J->encode($$old{"template"}) ne $J->encode($$new{"template"})
Truth table66%2/3
A and B
A= $oldB= $J->encode($$old{"template"}) ne $J->encode($$new{"template"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | 9 | ▶ | $new->{generation} //= 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$new{"generation"} //= 1
MC/DC0%0/1
$$new{"generation"} //= 1
$$new{"generation"}
Truth table50%1/2
A
A= $$new{"generation"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | 20 | ▶ | my $same = $old && $J->encode($old) eq $J->encode($new); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$old && $J->encode($old) eq $J->encode($new)
MC/DC100%2/2
$old && $J->encode($old) eq $J->encode($new)
$old
$J->encode($old) eq $J->encode($new)
Truth table100%3/3
A && B
A= $oldB= $J->encode($old) eq $J->encode($new)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | 20 | $o->{$kind}{$name} = $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | 20 | ▶ | return $same ? 'unchanged' : $old ? 'configured' : 'created'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | 5 | ▶ | sub _docs_from_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_docs_from_file: called CC=10 SCAR=26.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | 5 | my ( $dev, $file, $stdin ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | 5 | my $text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | 5 | ▶ | if ( $file eq '-' ) { $text = $stdin // '' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$stdin // ""
MC/DC0%0/1
$stdin // ""
$stdin
Truth table50%1/2
A
A= $stdin
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | 3 | ▶ | my $f = ( $dev->{files} || {} )->{$file}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dev{'files'} || {}
MC/DC0%0/1
$$dev{'files'} || {}
$$dev{'files'}
Truth table50%1/2
A
A= $$dev{'files'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | 3 | ▶ | $f = $f->{content} if ref $f eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | 3 | ▶ | die "error: the path \"$file\" does not exist\n" unless defined $f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | 3 | $text = $f; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | 5 | my @d = eval { YAML::XS::Load( Encode::encode( 'UTF-8', $text ) ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | 0 | ▶ | if ( my $e = $@ ) { $e =~ s/\s+\z//; $e =~ s/\n.*//s; die "error: error parsing $file: error converting YAML to JSON: yaml: $e\n" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | 0 | ▶ | return map { ( $_->{kind} // '' ) eq 'List' ? @{ $_->{items} || [] } : $_ } grep { ref $_ eq 'HASH' } @d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$$_{"kind"} // ""
$$_{'items'} || []
MC/DC0%0/1
$$_{"kind"} // ""
$$_{"kind"}
MC/DC0%0/1
$$_{'items'} || []
$$_{'items'}
Truth table50%1/2
A
A= $$_{"kind"}
Truth table0%0/2
A
A= $$_{'items'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | 5 | ▶ | sub _v_apply { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_apply: called CC=15 SCAR=31.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | 5 | my ( $k, $a, $o, $dev, $stdin ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | 5 | ▶ | return ( 'error: must specify one of -f and -k', 0 ) unless $o->{files}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | 5 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | 5 | for my $f ( @{ $o->{files} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | 5 | my @docs = eval { _docs_from_file( $dev, $f, $stdin ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | 5 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | 5 | for my $d (@docs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | 5 | ▶ | my $kind = $FROM_APIKIND{ $d->{kind} // '' } or return ( qq{error: resource mapping not found for name: "} . ( $d->{metadata}{name} // '' ) . qq{" namespace: "" from "$f": no matches for kind "$d->{kind}"}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$$d{"kind"} // ""
$$d{"metadata"}{"name"} // ""
MC/DC0%0/1
$$d{"kind"} // ""
$$d{"kind"}
MC/DC0%0/1
$$d{"metadata"}{"name"} // ""
$$d{"metadata"}{"name"}
Truth table50%1/2
A
A= $$d{"kind"}
Truth table0%0/2
A
A= $$d{"metadata"}{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 5 | ▶ | my $name = ( $d->{metadata} || {} )->{name} or return ( 'error: error validating data: metadata.name missing', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$d{'metadata'} || {}
MC/DC0%0/1
$$d{'metadata'} || {}
$$d{'metadata'}
Truth table50%1/2
A
A= $$d{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | 5 | ▶ | my $ns = $d->{metadata}{namespace} // $o->{ns}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$$d{"metadata"}{"namespace"} // $$o{"ns"}
MC/DC0%0/2
$$d{"metadata"}{"namespace"} // $$o{"ns"}
$$d{"metadata"}{"namespace"}
$$o{"ns"}
Truth table33%1/3
A // B
A= $$d{"metadata"}{"namespace"}B= $$o{"ns"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | 5 | ▶ | my $old = $CLUSTER{$kind} ? ( $k->{$kind} || {} )->{$name} : ( $k->{namespaces}{$ns} || {} )->{$kind}{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$$k{$kind} || {}
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
$$k{$kind} || {}
$$k{$kind}
MC/DC0%0/1
$$k{'namespaces'}{$ns} || {}
$$k{'namespaces'}{$ns}
Truth table0%0/2
A
A= $$k{$kind}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | 5 | my $r = eval { _store( $k, $kind, $ns, $name, _from_api( $kind, $d, $old ) ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | 5 | ▶ | return ( join( "\n", @out, $@ =~ s/\s+\z//r ), 0 ) if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | 4 | push @out, "$SINGULAR{$kind}/$name $r"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | 4 | return ( join( "\n", @out ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | 11 | ▶ | sub _v_create { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_create: called CC=24 SCAR=40.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | 11 | my ( $k, $a, $o, $dev, $stdin ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | 11 | ▶ | if ( ( $a->[0] // '' ) eq 'secret' && ( $a->[1] // '' ) eq 'generic' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition71%5/7
($$a[0] // "") eq "secret" and ($$a[1] // "") eq "generic"
$$a[0] // ""
$$a[1] // ""
MC/DC0%0/2
($$a[0] // "") eq "secret" and ($$a[1] // "") eq "generic"
$$a[0]
$$a[1]
Truth table33%1/3
A and B
A= $$a[0]B= $$a[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | 4 | ▶ | my $name = $a->[2] // return ( 'error: exactly one NAME is required, got 0', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$a[2] // (return "error: exactly one NAME is required, got 0", 0)
MC/DC0%0/1
$$a[2] // (return "error: exactly one NAME is required, got 0", 0)
$$a[2]
Truth table50%1/2
A
A= $$a[2]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | 4 | ▶ | my %lit = map { $_->[0] => $_->[1] } @{ $o->{literal} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{'literal'} || []
MC/DC100%1/1
$$o{'literal'} || []
$$o{'literal'}
Truth table100%2/2
A
A= $$o{'literal'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | 4 | ▶ | for my $ff ( @{ $o->{from_file} || [] } ) { # Inhalt genau wie in der Datei (mit Zeilenende, wie echt) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{'from_file'} || []
MC/DC100%1/1
$$o{'from_file'} || []
$$o{'from_file'}
Truth table100%2/2
A
A= $$o{'from_file'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | 2 | my ( $key, $path ) = @$ff; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | 2 | ▶ | my $f = ( $dev->{files} || {} )->{$path}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dev{'files'} || {}
MC/DC0%0/1
$$dev{'files'} || {}
$$dev{'files'}
Truth table50%1/2
A
A= $$dev{'files'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | 2 | ▶ | $f = $f->{content} if ref $f eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | 2 | ▶ | return ( "error: error reading $path: no such file or directory", 0 ) unless defined $f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | 1 | ▶ | $lit{ $key // ( $path =~ s{.*/}{}r ) } = $f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$key // $path =~ s[.*/][]r
MC/DC0%0/2
$key // $path =~ s[.*/][]r
$key
$path =~ s[.*/][]r
Truth table33%1/3
A // B
A= $keyB= $path =~ s[.*/][]r
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | 3 | ▶ | if ( grep {/\A--dry-run=(?:client|server)\z/} keys %{ $o->{flags} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$o{'flags'} || {}
MC/DC0%0/1
$$o{'flags'} || {}
$$o{'flags'}
Truth table50%1/2
A
A= $$o{'flags'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | # nur das Manifest, nichts anlegen (fuer … | kubectl apply -f -) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | 3 | ▶ | return ( "secret/$name created (dry run)", 1 ) unless ( $o->{out} // '' ) =~ /\A(?:yaml|json)\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | 3 | return _structured( $o, 'secrets', { $name => \%lit } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | 0 | ▶ | return ( qq{error: failed to create secret secrets "$name" already exists}, 0 ) if $k->{namespaces}{ $o->{ns} }{secrets}{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | 0 | $k->{namespaces}{ $o->{ns} }{secrets}{$name} = \%lit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | 0 | return ( "secret/$name created", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | 0 | ▶ | if ( ( $a->[0] // '' ) =~ /\A(?:namespace|ns)\z/ ) { push @GAPS, 'kubectl create namespace'; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$a[0] // ""
MC/DC0%0/1
$$a[0] // ""
$$a[0]
Truth table50%1/2
A
A= $$a[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | 7 | ▶ | if ( defined $a->[0] && !$o->{files} ) { my @r = _create_more( $k, $a, $o, $dev ); return @r if @r } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $$a[0] and not $$o{"files"}
MC/DC0%0/2
defined $$a[0] and not $$o{"files"}
defined $$a[0]
not $$o{"files"}
Truth table33%1/3
A and not(B)
A= defined $$a[0]B= not $$o{"files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | 0 | ▶ | return _v_apply( $k, $a, $o, $dev, $stdin ) if $o->{files}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 0 | push @GAPS, "kubectl create @$a"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | 0 | return ( '', 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | 19 | ▶ | sub _target { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_target: called CC=5 SCAR=19.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | 19 | my ( $k, $o, $kind, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | 19 | ▶ | return ( $k->{$kind} ||= {} ) if $CLUSTER{$kind} && $kind ne 'namespaces'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition20%1/5
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind} and $kind ne "namespaces"
$$k{$kind} ||= {}
MC/DC0%0/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind} and $kind ne "namespaces"
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}
$kind ne "namespaces"
MC/DC0%0/1
$$k{$kind} ||= {}
$$k{$kind}
Truth table33%1/3
A and B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$kind}B= $kind ne "namespaces"
Truth table0%0/2
A
A= $$k{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | 19 | ▶ | return ( $k->{namespaces}{ $o->{ns} }{$kind} ||= {} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$k{"namespaces"}{$$o{"ns"}}{$kind} ||= {}
MC/DC100%1/1
$$k{"namespaces"}{$$o{"ns"}}{$kind} ||= {}
$$k{"namespaces"}{$$o{"ns"}}{$kind}
Truth table100%2/2
A
A= $$k{"namespaces"}{$$o{"ns"}}{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | 3 | ▶ | sub _v_delete { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_delete: called CC=14 SCAR=30.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | 3 | my ( $k, $a, $o, $dev ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | 3 | my ( $kind, $name ) = _kind_name($a); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | 3 | ▶ | my @names = defined $name ? ( $name, @$a[ 2 .. $#$a ] ) : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | 3 | ▶ | return ( 'error: resource(s) were provided, but no name was specified', 0 ) unless $kind && @names; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind and @names
MC/DC0%0/2
$kind and @names
$kind
@names
Truth table33%1/3
A and B
A= $kindB= @names
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | 3 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | 3 | for my $n (@names) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | 3 | ▶ | if ( $kind eq 'namespaces' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | 1 | ▶ | delete $k->{namespaces}{$n} or return ( qq{Error from server (NotFound): namespaces "$n" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | 1 | push @out, qq{namespace "$n" deleted}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | 2 | ▶ | if ( $kind eq 'pods' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | # Pods eines Deployments kommen neu (gleicher Status); nur die Neuerstellung zaehlt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | 0 | my ($p) = grep { $_->{name} eq $n } _pods( $k, $o->{ns} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | 0 | ▶ | return ( qq{Error from server (NotFound): pods "$n" not found}, 0 ) unless $p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | 0 | push @out, qq{pod "$n" deleted}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | 2 | ▶ | if ( $kind eq 'secrets' && $n =~ /\Ash\.helm\.release\.v1\.(.+)\.v(\d+)\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$kind eq "secrets" and $n =~ /\Ash\.helm\.release\.v1\.(.+)\.v(\d+)\z/
MC/DC50%1/2
$kind eq "secrets" and $n =~ /\Ash\.helm\.release\.v1\.(.+)\.v(\d+)\z/
$kind eq "secrets"
$n =~ /\Ash\.helm\.release\.v1\.(.+)\.v(\d+)\z/
Truth table66%2/3
A and B
A= $kind eq "secrets"B= $n =~ /\Ash\.helm\.release\.v1\.(.+)\.v(\d+)\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | 1 | Langertha::Holmgang::Sim::Linux::_part('Helm'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | 1 | ▶ | Langertha::Holmgang::Sim::Linux::Helm::drop_revision( $k, $o->{ns}, $1, $2 ) or return ( qq{Error from server (NotFound): secrets "$n" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | 1 | push @out, qq{secret "$n" deleted}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | 1 | ▶ | return ( qq{Error from server (MethodNotAllowed): the server does not allow this method on the requested resource}, 0 ) if $DERIVED{$kind}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | 1 | my $t = _target( $k, $o, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | 1 | ▶ | delete $t->{$n} or return ( qq{Error from server (NotFound): } . ( $SINGULAR{$kind} =~ s/\..*//r ) . qq{s "$n" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | 1 | push @out, ( $SINGULAR{$kind} =~ s/\..*//r ) . qq{ "$n" deleted}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | 3 | return ( join( "\n", @out ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | 15 | ▶ | sub _dep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_dep: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | 15 | my ( $k, $o, $ref ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 15 | ▶ | my ( $kind, $name ) = _kind_name( [ split( m{/}, $ref // '', 2 ) ] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$ref // ""
MC/DC0%0/1
$ref // ""
$ref
Truth table50%1/2
A
A= $ref
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | 15 | ▶ | die qq{error: the server doesn't have a resource type "$ref"\n} unless ( $kind // '' ) eq 'deployments'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$kind // ""
MC/DC0%0/1
$kind // ""
$kind
Truth table50%1/2
A
A= $kind
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | 15 | ▶ | my $d = $k->{namespaces}{ $o->{ns} }{deployments}{ $name // '' } or die qq{Error from server (NotFound): deployments.apps "$name" not found\n}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | 15 | return ( $d, $name ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | 14 | ▶ | sub _v_set { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_set: called CC=42 SCAR=41.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | 14 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | 14 | my ( $what, $ref, @assign ) = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | 14 | my ( $d, $name ) = eval { _dep( $k, $o, $ref ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | 14 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) unless $d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | 14 | my $before = $J->encode( $d->{template} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | 14 | ▶ | if ( ( $what // '' ) eq 'image' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition50%1/2
$what // ""
MC/DC0%0/1
$what // ""
$what
Truth table50%1/2
A
A= $what
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | 1 | for my $x (@assign) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | 1 | my ( $c, $img ) = split /=/, $x, 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | 1 | ▶ | my @cs = grep { $c eq '*' || $_->{name} eq $c } @{ $d->{template}{containers} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$c eq '*' || $$_{'name'} eq $c
MC/DC0%0/2
$c eq '*' || $$_{'name'} eq $c
$c eq '*'
$$_{'name'} eq $c
Truth table33%1/3
A || B
A= $c eq '*'B= $$_{'name'} eq $c
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | 1 | ▶ | return ( qq{error: unable to find container named "$c"}, 0 ) unless @cs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | 1 | $_->{image} = $img for @cs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | ▶ | elsif ( ( $what // '' ) eq 'env' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$what // ""
MC/DC0%0/1
$what // ""
$what
Truth table50%1/2
A
A= $what
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | # -c/--containers waehlt Container (Komma-Liste, *); ohne: alle (wie kubectl) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | 13 | ▶ | my $want = $o->{container} // '*'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{"container"} // "*"
MC/DC100%1/1
$$o{"container"} // "*"
$$o{"container"}
Truth table100%2/2
A
A= $$o{"container"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | 13 | my %want = map { $_ => 1 } split /,/, $want; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | 13 | ▶ | my @cs = grep { $want{'*'} || $want{ $_->{name} } } @{ $d->{template}{containers} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$want{'*'} || $want{$$_{'name'}}
MC/DC100%2/2
$want{'*'} || $want{$$_{'name'}}
$want{'*'}
$want{$$_{'name'}}
Truth table100%3/3
A || B
A= $want{'*'}B= $want{$$_{'name'}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | 13 | ▶ | return ( qq{error: unable to find container named "$want"}, 0 ) unless @cs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | 12 | ▶ | if ( $o->{env_list} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | return ( join( "\n", map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | 1 | my $c = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | ( "# deployments/$name, container $c->{name}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | map { defined $_->{secret} ? "# $_->{name} from secret $_->{secret}, key $_->{key}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | : defined $_->{configmap} ? "# $_->{name} from configmap $_->{configmap}, key $_->{key}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | 2 | ▶ | : "$_->{name}=" . ( $_->{value} // '' ) } @{ $c->{env} || [] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition75%3/4
$$_{"value"} // ""
$$c{'env'} || []
MC/DC0%0/1
$$_{"value"} // ""
$$_{"value"}
MC/DC100%1/1
$$c{'env'} || []
$$c{'env'}
Truth table50%1/2
A
A= $$_{"value"}
Truth table100%2/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | } @cs ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | 11 | my @set; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | 11 | ▶ | if ( defined $o->{env_from} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | 5 | ▶ | my ( $kind, $sname ) = $o->{env_from} =~ m{\A(secret|configmap)/(.+)\z} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | or return ( "error: unknown resource for --from: $o->{env_from}", 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | 0 | ▶ | if ( $kind eq 'configmap' ) { push @GAPS, 'kubectl set env --from=configmap'; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | 5 | ▶ | my $sec = $k->{namespaces}{ $o->{ns} }{secrets}{$sname} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | or return ( qq{Error from server (NotFound): secrets "$sname" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | 4 | ▶ | my @keys = defined $o->{env_keys} ? split( /,/, $o->{env_keys} ) : sort keys %$sec; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | 4 | for my $key (@keys) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | 5 | ▶ | return ( qq{error: key "$key" not found in secret "$sname"}, 0 ) unless exists $sec->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | 4 | ▶ | ( my $n = uc( ( $o->{env_prefix} // '' ) . $key ) ) =~ s/[^A-Z0-9_]/_/g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{"env_prefix"} // ""
MC/DC100%1/1
$$o{"env_prefix"} // ""
$$o{"env_prefix"}
Truth table100%2/2
A
A= $$o{"env_prefix"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | 4 | push @set, [ $n, { name => $n, secret => $sname, key => $key } ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 9 | for my $x (@assign) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | 6 | ▶ | if ( $x =~ /\A([A-Za-z_][A-Za-z0-9_.-]*)-\z/ ) { push @set, [ $1, undef ]; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | 5 | ▶ | my ( $n, $v ) = $x =~ /\A([^=]+)=(.*)\z/s or return ( "error: invalid env: $x", 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | 5 | push @set, [ $n, { name => $n, value => $v } ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | 9 | for my $c (@cs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | 10 | for my $s (@set) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | 11 | my ( $n, $e ) = @$s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | 11 | ▶ | my $had = grep { $_->{name} eq $n } @{ $c->{env} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$c{'env'} || []
MC/DC100%1/1
$$c{'env'} || []
$$c{'env'}
Truth table100%2/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | 11 | ▶ | next if !$e && !$had; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$e or $had
MC/DC0%0/2
$e or $had
$e
$had
Truth table66%2/3
A or B
A= $eB= $had
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | 11 | ▶ | $c->{env} = [ grep { $_->{name} ne $n } @{ $c->{env} || [] } ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$c{'env'} || []
MC/DC100%1/1
$$c{'env'} || []
$$c{'env'}
Truth table100%2/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | 11 | ▶ | push @{ $c->{env} }, $e if $e; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | ▶ | elsif ( ( $what // '' ) =~ /\A(?:serviceaccount|sa)\z/ ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$what // ""
MC/DC0%0/1
$what // ""
$what
Truth table0%0/2
A
A= $what
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | 0 | ▶ | return ( 'error: serviceaccount is required', 0 ) unless defined $assign[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | 0 | $d->{template}{service_account} = $assign[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | 0 | ▶ | _bump($d) if $J->encode( $d->{template} ) ne $before; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | 0 | return ( "deployment.apps/$name serviceaccount updated", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | 0 | else { push @GAPS, "kubectl set $what"; return ( '', 0 ) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | 10 | return ( "deployment.apps/$name " . ( $what eq 'image' ? 'image updated' : 'env updated' ), 1 ) if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | 10 | ▶ | _bump($d) if $J->encode( $d->{template} ) ne $before; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | 10 | ▶ | return ( "deployment.apps/$name " . ( $what eq 'image' ? 'image updated' : 'env updated' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | 13 | ▶ | sub _merge { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_merge: called CC=5 SCAR=16.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | 13 | my ( $a, $b ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | 13 | ▶ | return $b unless ref $a eq 'HASH' && ref $b eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $a eq "HASH" and ref $b eq "HASH"
MC/DC50%1/2
ref $a eq "HASH" and ref $b eq "HASH"
ref $a eq "HASH"
ref $b eq "HASH"
Truth table66%2/3
A and B
A= ref $a eq "HASH"B= ref $b eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | 8 | my %r = %$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | 8 | for my $k ( keys %$b ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | 0 | ▶ | if ( !defined $b->{$k} ) { delete $r{$k}; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | 9 | $r{$k} = _merge( $a->{$k}, $b->{$k} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | 8 | return \%r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | # strategic merge: Listen von Containern (name) bzw. Ports (port) werden zusammengefuehrt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | 24 | ▶ | sub _smerge { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_smerge: called CC=17 SCAR=32.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | 24 | my ( $a, $b, $key ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 24 | ▶ | if ( ref $a eq 'ARRAY' && ref $b eq 'ARRAY' && $key ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
ref $a eq "ARRAY" and ref $b eq "ARRAY" and $key
ref $a eq "ARRAY" and ref $b eq "ARRAY"
MC/DC33%1/3
ref $a eq "ARRAY" and ref $b eq "ARRAY" and $key
ref $a eq "ARRAY"
ref $b eq "ARRAY"
$key
Truth table50%2/4
A and B and C
A= ref $a eq "ARRAY"B= ref $b eq "ARRAY"C= $key
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | # Ports eines Service fuehrt die API ueber port zusammen, die eines Containers ueber containerPort | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | 2 | ▶ | $key = 'port' if $key eq 'containerPort' && !grep { ref $_ eq 'HASH' && exists $_->{containerPort} } @$a, @$b; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$key eq "containerPort" and not grep({ref $_ eq "HASH" and exists $$_{"containerPort"};} @$a, @$b)
ref $_ eq 'HASH' && exists $$_{'containerPort'}
MC/DC50%1/2
$key eq "containerPort" and not grep({ref $_ eq "HASH" and exists $$_{"containerPort"};} @$a, @$b)
$key eq "containerPort"
not grep({ref $_ eq "HASH" and exists $$_{"containerPort"};} @$a, @$b)
MC/DC0%0/2
ref $_ eq 'HASH' && exists $$_{'containerPort'}
ref $_ eq 'HASH'
exists $$_{'containerPort'}
Truth table66%2/3
A and not(B)
A= $key eq "containerPort"B= not grep({ref $_ eq "HASH" and exists $$_{"containerPort"};} @$a, @$b)
Truth table33%1/3
A && B
A= ref $_ eq 'HASH'B= exists $$_{'containerPort'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | 2 | my @r = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | 2 | for my $x (@$b) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | 2 | ▶ | my ($i) = grep { ref $r[$_] eq 'HASH' && ref $x eq 'HASH' && defined $x->{$key} && ( $r[$_]{$key} // '' ) eq $x->{$key} } 0 .. $#r; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition45%5/11
ref $r[$_] eq 'HASH' && ref $x eq 'HASH' && defined $$x{$key} && ($r[$_]{$key} // '') eq $$x{$key}
ref $r[$_] eq "HASH" and ref $x eq "HASH" and defined $$x{$key}
ref $r[$_] eq "HASH" and ref $x eq "HASH"
$r[$_]{$key} // ""
MC/DC0%0/4
ref $r[$_] eq 'HASH' && ref $x eq 'HASH' && defined $$x{$key} && ($r[$_]{$key} // '') eq $$x{$key}
ref $r[$_] eq "HASH"
ref $x eq "HASH"
defined $$x{$key}
$r[$_]{$key}
Truth table20%1/5
A and B and C && D
A= ref $r[$_] eq "HASH"B= ref $x eq "HASH"C= defined $$x{$key}D= $r[$_]{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | 0 | ▶ | if ( defined $i ) { $r[$i] = _smerge( $r[$i], $x ) } else { push @r, $x } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | 2 | return \@r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | 22 | ▶ | return $b unless ref $a eq 'HASH' && ref $b eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $a eq "HASH" and ref $b eq "HASH"
MC/DC50%1/2
ref $a eq "HASH" and ref $b eq "HASH"
ref $a eq "HASH"
ref $b eq "HASH"
Truth table66%2/3
A and B
A= ref $a eq "HASH"B= ref $b eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | 15 | my %r = %$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | 15 | my %mk = ( containers => 'name', env => 'name', ports => 'containerPort', volumes => 'name', volumeMounts => 'mountPath' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 15 | for my $k ( keys %$b ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | 0 | ▶ | if ( !defined $b->{$k} ) { delete $r{$k}; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | 18 | $r{$k} = _smerge( $a->{$k}, $b->{$k}, $mk{$k} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | 15 | return \%r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | 4 | ▶ | sub _jsonpatch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_jsonpatch: called CC=16 SCAR=34.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | 4 | my ( $doc, $ops ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | 4 | for my $op (@$ops) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | 4 | ▶ | my @p = map { s/~1/\//gr =~ s/~0/~/gr } grep { length } split m{/}, $op->{path} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$op{"path"} // ""
MC/DC0%0/1
$$op{"path"} // ""
$$op{"path"}
Truth table50%1/2
A
A= $$op{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | 4 | my $last = pop @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | 4 | my $t = $doc; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | 4 | ▶ | for my $s (@p) { $t = ref $t eq 'ARRAY' ? $t->[$s] : $t->{$s}; die "error: unable to find path $op->{path}\n" unless ref $t } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | 4 | ▶ | my $o = $op->{op} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$op{"op"} // ""
MC/DC0%0/1
$$op{"op"} // ""
$$op{"op"}
Truth table50%1/2
A
A= $$op{"op"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | 4 | ▶ | if ( $o eq 'replace' || $o eq 'add' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$o eq "replace" or $o eq "add"
MC/DC0%0/2
$o eq "replace" or $o eq "add"
$o eq "replace"
$o eq "add"
Truth table66%2/3
A or B
A= $o eq "replace"B= $o eq "add"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | 0 | ▶ | if ( ref $t eq 'ARRAY' ) { if ( $last eq '-' ) { push @$t, $op->{value} } elsif ( $o eq 'add' ) { splice @$t, $last, 0, $op->{value} } else { $t->[$last] = $op->{value} } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | 3 | ▶ | else { die "error: replace operation does not apply: doc is missing path: $op->{path}\n" if $o eq 'replace' && !exists $t->{$last}; $t->{$last} = $op->{value} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$o eq "replace" and not exists $$t{$last}
MC/DC0%0/2
$o eq "replace" and not exists $$t{$last}
$o eq "replace"
not exists $$t{$last}
Truth table33%1/3
A and not(B)
A= $o eq "replace"B= not exists $$t{$last}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | 0 | ▶ | elsif ( $o eq 'remove' ) { if ( ref $t eq 'ARRAY' ) { splice @$t, $last, 1 } else { delete $t->{$last} } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | 0 | else { die "error: unsupported json patch operation $o\n" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | 4 | return $doc; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | 12 | ▶ | sub _v_patch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_patch: called CC=15 SCAR=30.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | 12 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | 12 | my ( $kind, $name ) = _kind_name($a); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | 12 | ▶ | return ( 'error: you must specify the type of resource to patch', 0 ) unless $kind && defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind and defined $name
MC/DC0%0/2
$kind and defined $name
$kind
defined $name
Truth table33%1/3
A and B
A= $kindB= defined $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | 0 | ▶ | my $p = eval { JSON::MaybeXS->new->decode( $o->{patch} // '' ) } // eval { YAML::XS::Load( $o->{patch} // '' ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition28%2/7
eval {
do {
"JSON::MaybeXS"->new->decode($$o{"patch"} // "")
}
} // eval {
do {
YAML::XS::Load($$o{"patch"} // "")
}
}
$$o{"patch"} // ""
$$o{"patch"} // ""
MC/DC0%0/2
eval {
do {
"JSON::MaybeXS"->new->decode($$o{"patch"} // "")
}
} // eval {
do {
YAML::XS::Load($$o{"patch"} // "")
}
}
eval {
do {
"JSON::MaybeXS"->new->decode($$o{"patch"} // "")
}
}
eval {
do {
YAML::XS::Load($$o{"patch"} // "")
}
}
MC/DC0%0/1
$$o{"patch"} // ""
$$o{"patch"}
MC/DC0%0/1
$$o{"patch"} // ""
$$o{"patch"}
Truth table33%1/3
A // B
A= eval {
do {
"JSON::MaybeXS"->new->decode($$o{"patch"} // "")
}
}B= eval {
do {
YAML::XS::Load($$o{"patch"} // "")
}
}
Truth table50%1/2
A
A= $$o{"patch"}
Truth table0%0/2
A
A= $$o{"patch"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | 12 | ▶ | return ( 'error: unable to parse "' . ( $o->{patch} // '' ) . '": yaml: did not find expected node content', 0 ) unless ref $p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$o{"patch"} // ""
MC/DC0%0/1
$$o{"patch"} // ""
$$o{"patch"}
Truth table0%0/2
A
A= $$o{"patch"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | 12 | my $t = _target( $k, $o, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | 12 | ▶ | my $old = $t->{$name} or return ( qq{Error from server (NotFound): } . ( $SINGULAR{$kind} =~ s/\..*//r ) . qq{s "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | 12 | my $api = _api_obj( $kind, $name, $old, $o->{ns} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | 12 | ▶ | my $type = $o->{type} // 'strategic'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{"type"} // "strategic"
MC/DC100%1/1
$$o{"type"} // "strategic"
$$o{"type"}
Truth table100%2/2
A
A= $$o{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | 12 | my $new = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | 12 | ▶ | $type eq 'json' ? _jsonpatch( $api, $p ) : $type eq 'merge' ? _merge( $api, $p ) : _smerge( $api, $p ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | 12 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) unless $new; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | 12 | my $r = eval { _store( $k, $kind, $o->{ns}, $name, _from_api( $kind, $new, $old ) ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | 12 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | 10 | ▶ | return ( "$SINGULAR{$kind}/$name " . ( $r eq 'unchanged' ? 'patched (no change)' : 'patched' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | 0 | ▶ | sub _v_scale { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_scale: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | 0 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | 0 | ▶ | my $ref = @$a == 2 ? "$a->[0]/$a->[1]" : $a->[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | 0 | my ( $d, $name ) = eval { _dep( $k, $o, $ref ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | 0 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) unless $d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | 0 | ▶ | return ( 'error: required flag(s) "replicas" not set', 0 ) unless defined $o->{replicas}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | 0 | $d->{replicas} = 0 + $o->{replicas}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | 0 | return ( "deployment.apps/$name scaled", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | 0 | ▶ | sub _v_label { return _meta_edit( 'labels', @_ ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_label: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | 1 | ▶ | sub _v_annotate { return _meta_edit( 'annotations', @_ ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_annotate: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | # kubectl label|annotate KIND NAME k=v k2- [--overwrite]: nur Arten in API-Form | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | 1 | ▶ | sub _meta_edit { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_meta_edit: called CC=19 SCAR=38.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | 1 | my ( $what, $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | 1 | my ( $kind, $name ) = _kind_name($a); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | 1 | ▶ | my $verb = $what eq 'labels' ? 'label' : 'annotate'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | 0 | ▶ | unless ( $kind && $GEN{$kind} ) { push @GAPS, "kubectl $verb @$a"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind and $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
MC/DC0%0/2
$kind and $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
$kind
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
Truth table33%1/3
A and B
A= $kindB= $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | 1 | ▶ | my @kv = @$a[ ( $a->[0] =~ m{/} ? 1 : 2 ) .. $#$a ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | 1 | ▶ | return ( "error: at least one $what update is required", 0 ) unless @kv; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | 1 | my $t = _target( $k, $o, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | 1 | ▶ | my $x = $t->{ $name // '' } or return ( qq{Error from server (NotFound): $GEN{$kind}[3] "} . ( $name // '' ) . '" not found', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$name // ""
$name // ""
MC/DC0%0/1
$name // ""
$name
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | 1 | ▶ | my $m = $x->{metadata}{$what} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$x{"metadata"}{$what} ||= {}
MC/DC0%0/1
$$x{"metadata"}{$what} ||= {}
$$x{"metadata"}{$what}
Truth table50%1/2
A
A= $$x{"metadata"}{$what}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | 1 | for my $e (@kv) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | 0 | ▶ | if ( $e =~ /\A([^=]+)-\z/ ) { delete $m->{$1}; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | 1 | ▶ | my ( $kk, $v ) = $e =~ /\A([^=]+)=(.*)\z/s or return ( "error: invalid $what format: $e", 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | return ( "error: --overwrite is false but found the following declared $what(s): '$kk' already has a value ($m->{$kk})", 0 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | 1 | ▶ | if defined $m->{$kk} && $m->{$kk} ne $v && !$o->{flags}{'--overwrite'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $$m{$kk} and $$m{$kk} ne $v and not $$o{"flags"}{"--overwrite"}
defined $$m{$kk} and $$m{$kk} ne $v
MC/DC0%0/3
defined $$m{$kk} and $$m{$kk} ne $v and not $$o{"flags"}{"--overwrite"}
defined $$m{$kk}
$$m{$kk} ne $v
not $$o{"flags"}{"--overwrite"}
Truth table25%1/4
A and B and not(C)
A= defined $$m{$kk}B= $$m{$kk} ne $vC= not $$o{"flags"}{"--overwrite"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | 1 | $m->{$kk} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | 1 | ▶ | delete $x->{metadata}{$what} unless %$m; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | 1 | ▶ | delete $x->{metadata} unless %{ $x->{metadata} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | 1 | ▶ | return ( "$GEN{$kind}[3]/$name " . ( $what eq 'labels' ? 'labeled' : 'annotated' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | 1 | ▶ | sub _v_rollout { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_rollout: called CC=14 SCAR=42.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | 1 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | 1 | my ( $what, @refs ) = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | 1 | ▶ | @refs = ( "$refs[0]/$refs[1]" ) if @refs == 2 && $refs[0] !~ m{/}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@refs == 2 and not $refs[0] =~ m[/]
MC/DC0%0/2
@refs == 2 and not $refs[0] =~ m[/]
@refs == 2
not $refs[0] =~ m[/]
Truth table33%1/3
A and not(B)
A= @refs == 2B= not $refs[0] =~ m[/]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | 1 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | 1 | for my $ref (@refs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | 1 | my ( $d, $name ) = eval { _dep( $k, $o, $ref ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | 1 | ▶ | return ( $@ =~ s/\s+\z//r, 0 ) unless $d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | 1 | ▶ | if ( $what eq 'restart' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | 1 | ▶ | $d->{restarted_at} = '2026-10-21T12:' . sprintf( '%02d', ( $d->{generation} // 1 ) % 60 ) . ':00Z'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$d{"generation"} // 1
MC/DC0%0/1
$$d{"generation"} // 1
$$d{"generation"}
Truth table50%1/2
A
A= $$d{"generation"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | 1 | _bump($d); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | 1 | push @out, "deployment.apps/$name restarted"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | elsif ( $what eq 'status' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | 0 | my @p = grep { $_->{deployment} eq $name } _pods( $k, $o->{ns} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | 0 | my $r = grep { $_->{ready} } @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | 0 | ▶ | push @out, $r == @p ? qq{deployment "$name" successfully rolled out} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | : qq{Waiting for deployment "$name" rollout to finish: $r of } . scalar(@p) . " updated replicas are available...\nerror: timed out waiting for the condition"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | 0 | ▶ | return ( join( "\n", @out ), 0 ) if $r != @p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | elsif ( $what eq 'undo' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | 0 | ▶ | my $prev = $d->{previous} or return ( qq{error: no rollout history found for deployment "$name"}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | 0 | $d->{template} = $prev; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | 0 | delete $d->{previous}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | 0 | _bump($d); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | 0 | push @out, "deployment.apps/$name rolled back"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | elsif ( $what eq 'history' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | 0 | ▶ | push @out, "deployment.apps/$name \nREVISION CHANGE-CAUSE\n" . join( "\n", map {"$_ <none>"} 1 .. ( $d->{generation} // 1 ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$d{"generation"} // 1
MC/DC0%0/1
$$d{"generation"} // 1
$$d{"generation"}
Truth table0%0/2
A
A= $$d{"generation"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | 0 | else { push @GAPS, "kubectl rollout $what"; return ( '', 0 ) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | 1 | return ( join( "\n", @out ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | 5 | ▶ | sub _v_logs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_logs: called CC=20 SCAR=35.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | 5 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | 5 | ▶ | my $ref = $a->[0] // return ( 'error: expected \'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]\'.', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$a[0] // (return "error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.", 0)
MC/DC0%0/1
$$a[0] // (return "error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.", 0)
$$a[0]
Truth table50%1/2
A
A= $$a[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | 5 | my @p = _pods( $k, $o->{ns} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | 5 | ▶ | my ($p) = $ref =~ m{\A(?:deploy(?:ment)?(?:\.apps)?)/(.+)\z} ? grep { $_->{deployment} eq $1 } @p : grep { $_->{name} eq $ref || "pod/$_->{name}" eq $ref } @p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$_{'name'} eq $ref || "pod/$$_{'name'}" eq $ref
MC/DC50%1/2
$$_{'name'} eq $ref || "pod/$$_{'name'}" eq $ref
$$_{'name'} eq $ref
"pod/$$_{'name'}" eq $ref
Truth table66%2/3
A || B
A= $$_{'name'} eq $refB= "pod/$$_{'name'}" eq $ref
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | 5 | ▶ | return ( qq{Error from server (NotFound): pods "$ref" not found}, 0 ) unless $p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | 5 | my ($c) = @{ $p->{template}{containers} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | 5 | ▶ | if ( $p->{reason} eq 'ImagePullBackOff' || $p->{reason} eq 'CreateContainerConfigError' || $p->{phase} eq 'Pending' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$$p{"reason"} eq "ImagePullBackOff" or $$p{"reason"} eq "CreateContainerConfigError" or $$p{"phase"} eq "Pending"
$$p{"reason"} eq "ImagePullBackOff" or $$p{"reason"} eq "CreateContainerConfigError"
MC/DC0%0/3
$$p{"reason"} eq "ImagePullBackOff" or $$p{"reason"} eq "CreateContainerConfigError" or $$p{"phase"} eq "Pending"
$$p{"reason"} eq "ImagePullBackOff"
$$p{"reason"} eq "CreateContainerConfigError"
$$p{"phase"} eq "Pending"
Truth table25%1/4
A or B or C
A= $$p{"reason"} eq "ImagePullBackOff"B= $$p{"reason"} eq "CreateContainerConfigError"C= $$p{"phase"} eq "Pending"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | 0 | ▶ | return ( qq{Error from server (BadRequest): container "$c->{name}" in pod "$p->{name}" is waiting to start: } . ( $p->{reason} eq 'ImagePullBackOff' ? 'trying and failing to pull image' : $p->{reason} eq 'CreateContainerConfigError' ? 'CreateContainerConfigError' : 'ContainerCreating' ), 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | 5 | ▶ | my @l = $p->{reason} eq 'CrashLoopBackOff' ? @{ $p->{container}{crash_log} || ['error: missing configuration'] } : @{ $c->{logs} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition75%3/4
$$p{'container'}{'crash_log'} || ['error: missing configuration']
$$c{'logs'} || []
MC/DC0%0/1
$$p{'container'}{'crash_log'} || ['error: missing configuration']
$$p{'container'}{'crash_log'}
MC/DC100%1/1
$$c{'logs'} || []
$$c{'logs'}
Truth table50%1/2
A
A= $$p{'container'}{'crash_log'}
Truth table100%2/2
A
A= $$c{'logs'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | # Controller, deren Log aus dem Zustand folgt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | 5 | ▶ | push @l, _ingress_log($k) if ( $c->{derive_logs} // '' ) eq 'ingress-nginx'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$$c{"derive_logs"} // ""
MC/DC100%1/1
$$c{"derive_logs"} // ""
$$c{"derive_logs"}
Truth table100%2/2
A
A= $$c{"derive_logs"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | 5 | ▶ | push @l, _cm_log($k) if ( $c->{derive_logs} // '' ) eq 'cert-manager'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$$c{"derive_logs"} // ""
MC/DC100%1/1
$$c{"derive_logs"} // ""
$$c{"derive_logs"}
Truth table100%2/2
A
A= $$c{"derive_logs"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | 5 | ▶ | @l = @l[ ( @l > $o->{tail} ? @l - $o->{tail} : 0 ) .. $#l ] if defined $o->{tail} && $o->{tail} =~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $$o{"tail"} and $$o{"tail"} =~ /\A\d+\z/
MC/DC0%0/2
defined $$o{"tail"} and $$o{"tail"} =~ /\A\d+\z/
defined $$o{"tail"}
$$o{"tail"} =~ /\A\d+\z/
Truth table33%1/3
A and B
A= defined $$o{"tail"}B= $$o{"tail"} =~ /\A\d+\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | 5 | return ( join( "\n", @l ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | 5 | ▶ | sub _v_describe { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_describe: called CC=54 SCAR=70.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | 5 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | 5 | my ( $kind, $name ) = _kind_name($a); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | 5 | ▶ | return ( 'error: You must specify the type of resource to describe.', 0 ) unless $kind; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | 5 | my $ns = $o->{ns}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | 5 | ▶ | if ( $GEN{$kind} || $DERIVED{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
MC/DC100%2/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind} or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
$Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
Truth table100%3/3
A or B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::GEN{$kind}B= $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | 3 | ▶ | return _describe_gen( $k, $kind, $ns, $name ) if defined $name || $DERIVED{$kind}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
MC/DC0%0/2
defined $name or $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
defined $name
$Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
Truth table66%2/3
A or B
A= defined $nameB= $Langertha::Holmgang::Sim::Linux::Kubernetes::DERIVED{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | 0 | ▶ | my @n = sort keys %{ $kind eq 'certificates' ? _certs( $k, $ns ) : _gen_objs( $k, $kind, $ns ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | 0 | ▶ | return ( "No resources found in $ns namespace.", 1 ) unless @n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | 0 | return ( join( "\n\n\n", map { ( _describe_gen( $k, $kind, $ns, $_ ) )[0] } @n ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | 2 | ▶ | if ( $kind eq 'pods' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | 1 | ▶ | my @p = grep { !defined $name || $_->{name} eq $name || index( $_->{name}, $name ) == 0 } _pods( $k, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%4/6
!defined($name) || $$_{'name'} eq $name || index($$_{'name'}, $name) == 0
not defined $name or $$_{"name"} eq $name
MC/DC33%1/3
!defined($name) || $$_{'name'} eq $name || index($$_{'name'}, $name) == 0
not defined $name
$$_{"name"} eq $name
index($$_{'name'}, $name) == 0
Truth table50%2/4
not(A) or B || C
A= not defined $nameB= $$_{"name"} eq $nameC= index($$_{'name'}, $name) == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | 1 | ▶ | return ( qq{Error from server (NotFound): pods "$name" not found}, 0 ) unless @p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | 1 | return ( join( "\n\n", map { _describe_pod( $k, $ns, $_ ) } @p ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | 1 | ▶ | if ( $kind eq 'deployments' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | 0 | ▶ | my $d = $k->{namespaces}{$ns}{deployments}{ $name // '' } or return ( qq{Error from server (NotFound): deployments.apps "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | 0 | my @p = grep { $_->{deployment} eq $name } _pods( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | 0 | my $r = grep { $_->{ready} } @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | return ( join( "\n", "Name: $name", "Namespace: $ns", 'Selector: ' . _labels_text( $d->{selector} ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | "Replicas: $d->{replicas} desired | " . scalar(@p) . ' updated | ' . scalar(@p) . " total | $r available | " . ( @p - $r ) . ' unavailable', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | 'StrategyType: RollingUpdate', 'Pod Template:', ' Labels: ' . _labels_text( $d->{template}{labels} ), ' Containers:', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | 0 | ▶ | ( map { _describe_container( $_, ' ' ) } @{ $d->{template}{containers} } ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | 'Conditions:', ' Type Status Reason', ' ---- ------ ------', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | ' Available ' . ( $r == @p ? 'True MinimumReplicasAvailable' : 'False MinimumReplicasUnavailable' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | ' Progressing True NewReplicaSetAvailable' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | 1 | ▶ | if ( $kind eq 'services' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | 0 | ▶ | my $s = $k->{namespaces}{$ns}{services}{ $name // '' } or return ( qq{Error from server (NotFound): services "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | 0 | my @e = _endpoints( $k, $ns, $name ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | return ( join( "\n", "Name: $name", "Namespace: $ns", 'Selector: ' . _labels_text( $s->{selector} ), 'Type: ' . ( $s->{type} // 'ClusterIP' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | ( map { ( "Port: " . ( $_->{name} // '<unset>' ) . " $_->{port}/TCP", "TargetPort: $_->{target}/TCP", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | 0 | ▶ | 'Endpoints: ' . ( @e ? join( ',', map { my $p = $_; "$p->{ip}:" } @e ) =~ s/:(,|\z)/:$_->{target}$1/gr : '<none>' ) ) } @{ $s->{ports} || [] } ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$$s{"type"} // "ClusterIP"
$$_{"name"} // "<unset>"
$$s{'ports'} || []
MC/DC0%0/1
$$s{"type"} // "ClusterIP"
$$s{"type"}
MC/DC0%0/1
$$_{"name"} // "<unset>"
$$_{"name"}
MC/DC0%0/1
$$s{'ports'} || []
$$s{'ports'}
Truth table0%0/2
A
A= $$s{"type"}
Truth table0%0/2
A
A= $$_{"name"}
Truth table0%0/2
A
A= $$s{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | 'Session Affinity: None', 'Events: <none>' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | 1 | ▶ | if ( $kind eq 'pvcs' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | 0 | ▶ | my $p = $k->{namespaces}{$ns}{pvcs}{ $name // '' } or return ( qq{Error from server (NotFound): persistentvolumeclaims "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | 0 | my $ph = _pvc_phase( $k, $ns, $name ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | return ( join( "\n", "Name: $name", "Namespace: $ns", 'StorageClass: ' . ( $p->{storage_class} // '' ), "Status: $ph", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | 'Capacity: ' . ( $ph eq 'Bound' ? $p->{size} : '' ), 'Access Modes: ' . ( $ph eq 'Bound' ? 'RWO' : '' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | 'Events:', ' Type Reason Age From Message', ' ---- ------ ---- ---- -------', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | 0 | ▶ | ( $ph eq 'Pending' ? ' Warning ProvisioningFailed 2m (x41 over 12m) persistentvolume-controller storageclass.storage.k8s.io "' . ( $p->{storage_class} // '' ) . '" not found' : () ) ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/4
$$p{"storage_class"} // ""
$$p{"storage_class"} // ""
MC/DC0%0/1
$$p{"storage_class"} // ""
$$p{"storage_class"}
MC/DC0%0/1
$$p{"storage_class"} // ""
$$p{"storage_class"}
Truth table0%0/2
A
A= $$p{"storage_class"}
Truth table0%0/2
A
A= $$p{"storage_class"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | 1 | ▶ | if ( $kind eq 'networkpolicies' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | 0 | ▶ | my $p = $k->{namespaces}{$ns}{networkpolicies}{ $name // '' } or return ( qq{Error from server (NotFound): networkpolicies.networking.k8s.io "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | 0 | ▶ | my @l = ( "Name: $name", "Namespace: $ns", 'Spec:', ' PodSelector: ' . ( %{ $p->{pod_selector} || {} } ? _labels_text( $p->{pod_selector} ) : '<none> (Allowing the specific traffic to all pods in this namespace)' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$p{'pod_selector'} || {}
MC/DC0%0/1
$$p{'pod_selector'} || {}
$$p{'pod_selector'}
Truth table0%0/2
A
A= $$p{'pod_selector'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | ' Allowing ingress traffic:' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | 0 | ▶ | if ( !@{ $p->{ingress} || [] } ) { push @l, ' <none> (Selected pods are isolated for ingress connectivity)' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$p{'ingress'} || []
MC/DC0%0/1
$$p{'ingress'} || []
$$p{'ingress'}
Truth table0%0/2
A
A= $$p{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | 0 | ▶ | for my $r ( @{ $p->{ingress} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$p{'ingress'} || []
MC/DC0%0/1
$$p{'ingress'} || []
$$p{'ingress'}
Truth table0%0/2
A
A= $$p{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | 0 | ▶ | push @l, ' To Port: ' . ( $r->{ports} ? join( ', ', map {"$_/TCP"} @{ $r->{ports} } ) : '<any> (traffic allowed to all ports)' ), ' From:'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | 0 | ▶ | push @l, $r->{from} ? map { ' PodSelector: ' . _labels_text($_) } @{ $r->{from} } : ' <any> (traffic not restricted by source)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | 0 | push @l, ' Not affecting egress traffic', ' Policy Types: Ingress'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | 0 | return ( join( "\n", @l ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | 1 | ▶ | if ( $kind eq 'secrets' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | 0 | ▶ | my $s = _secrets_all( $k, $ns )->{ $name // '' } or return ( qq{Error from server (NotFound): secrets "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | 0 | return ( join( "\n", "Name: $name", "Namespace: $ns", '', 'Type: ' . _secret_type($s), '', 'Data', '====', map { "$_: " . length( $s->{$_} ) . ' bytes' } sort grep { !/\A_/ } keys %$s ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | 1 | ▶ | if ( $kind eq 'storageclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | 0 | ▶ | my $s = ( $k->{storageclasses} || {} )->{ $name // '' } or return ( qq{Error from server (NotFound): storageclasses.storage.k8s.io "$name" not found}, 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
$$k{'storageclasses'} || {}
$name // ""
MC/DC0%0/1
$$k{'storageclasses'} || {}
$$k{'storageclasses'}
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $$k{'storageclasses'}
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | 0 | ▶ | return ( join( "\n", "Name: $name", 'IsDefaultClass: ' . ( $s->{default} ? 'Yes' : 'No' ), "Provisioner: $s->{provisioner}", 'ReclaimPolicy: Delete', 'VolumeBindingMode: Immediate' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | 1 | ▶ | if ( $kind eq 'replicasets' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | 1 | ▶ | my @rs = grep { !defined $name || index( $_->{name}, $name ) == 0 } _replicasets( $k, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
!defined($name) || index($$_{'name'}, $name) == 0
MC/DC50%1/2
!defined($name) || index($$_{'name'}, $name) == 0
!defined($name)
index($$_{'name'}, $name) == 0
Truth table66%2/3
not(A) || B
A= !defined($name)B= index($$_{'name'}, $name) == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | 1 | ▶ | return ( qq{Error from server (NotFound): replicasets.apps "$name" not found}, 0 ) unless @rs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | return ( join( "\n\n", map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | 1 | my $r = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | join "\n", "Name: $r->{name}", "Namespace: $ns", "Controlled By: Deployment/$r->{deployment}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | "Replicas: $r->{current} current / $r->{desired} desired", "Pods Status: $r->{ready} Running / 0 Waiting / 0 Succeeded / 0 Failed", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | 1 | ▶ | ( $r->{failed} ? ( 'Conditions:', ' Type Status Reason', ' ---- ------ ------', ' ReplicaFailure True FailedCreate', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | 'Events:', ' Type Reason Age From Message', ' ---- ------ ---- ---- -------', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | " Warning FailedCreate 2m (x18 over 12m) replicaset-controller $r->{failed}" ) : ('Events: <none>') ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | } @rs ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | 0 | push @GAPS, "kubectl describe @$a"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | 0 | return ( '', 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | 1 | ▶ | sub _describe_container { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_describe_container: called CC=16 SCAR=37.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | 1 | my ( $c, $ind ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | return ( "$ind$c->{name}:", "$ind Image: $c->{image}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | 1 | ▶ | ( $c->{ports} ? "$ind Port: " . join( ', ', map {"$_/TCP"} @{ $c->{ports} } ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$c{"readiness"}{"path"} // "/"
MC/DC0%0/1
$$c{"readiness"}{"path"} // "/"
$$c{"readiness"}{"path"}
Truth table50%1/2
A
A= $$c{"readiness"}{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | ( $c->{readiness} ? "$ind Readiness: http-get http://:$c->{readiness}{port}" . ( $c->{readiness}{path} // '/' ) . ' delay=0s timeout=1s period=10s #success=1 #failure=3' : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | 1 | ▶ | "$ind Environment:", ( map { "$ind $_->{name}: " . ( defined $_->{secret} ? "<set to the key '$_->{key}' in secret '$_->{secret}'>" . ( $_->{optional} ? ' Optional: true' : ' Optional: false' ) : defined $_->{configmap} ? "<set to the key '$_->{key}' of config map '$_->{configmap}'>" : $_->{value} // '' ) } @{ $c->{env} || [] } ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition25%1/4
$$_{"value"} // ""
$$c{'env'} || []
MC/DC0%0/1
$$_{"value"} // ""
$$_{"value"}
MC/DC0%0/1
$$c{'env'} || []
$$c{'env'}
Truth table0%0/2
A
A= $$_{"value"}
Truth table50%1/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | 1 | ▶ | ( !@{ $c->{env} || [] } ? "$ind <none>" : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$c{'env'} || []
MC/DC0%0/1
$$c{'env'} || []
$$c{'env'}
Truth table50%1/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | 0 | ▶ | "$ind Mounts:", ( map { "$ind " . ( $_->{mount} // '/data' ) . " from $_->{claim} (rw)" } @{ $c->{volumes} || [] } ), ( !@{ $c->{volumes} || [] } ? "$ind <none>" : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%2/6
$$_{"mount"} // "/data"
$$c{'volumes'} || []
$$c{'volumes'} || []
MC/DC0%0/1
$$_{"mount"} // "/data"
$$_{"mount"}
MC/DC0%0/1
$$c{'volumes'} || []
$$c{'volumes'}
MC/DC0%0/1
$$c{'volumes'} || []
$$c{'volumes'}
Truth table0%0/2
A
A= $$_{"mount"}
Truth table50%1/2
A
A= $$c{'volumes'}
Truth table50%1/2
A
A= $$c{'volumes'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | 1 | ▶ | ( $c->{privileged} ? "$ind Security Context: privileged" : () ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | 1 | ▶ | sub _describe_pod { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_describe_pod: called CC=14 SCAR=33.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | 1 | my ( $k, $ns, $p ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | my @state = $p->{reason} eq 'CrashLoopBackOff' ? ( ' State: Waiting', ' Reason: CrashLoopBackOff', ' Last State: Terminated', ' Reason: Error', ' Exit Code: 1' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | : $p->{reason} =~ /\A(?:ImagePullBackOff|CreateContainerConfigError)\z/ ? ( ' State: Waiting', " Reason: $p->{reason}" ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | 1 | ▶ | : $p->{phase} eq 'Pending' ? (' State: Waiting', ' Reason: ContainerCreating') : ( ' State: Running', ' Started: Tue, 21 Oct 2026 11:48:02 +0200' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | 1 | my @ev; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | 1 | ▶ | if ( $p->{reason} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | 1 | my %r = ( NotReady => [ 'Warning', 'Unhealthy', 'kubelet' ], CrashLoopBackOff => [ 'Warning', 'BackOff', 'kubelet' ], ImagePullBackOff => [ 'Warning', 'Failed', 'kubelet' ], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | Unschedulable => [ 'Warning', 'FailedScheduling', 'default-scheduler' ], CreateContainerConfigError => [ 'Warning', 'Failed', 'kubelet' ] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | 1 | ▶ | my $r = $r{ $p->{reason} } // [ 'Normal', $p->{reason}, 'kubelet' ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$r{$$p{"reason"}} // ["Normal", $$p{"reason"}, "kubelet"]
MC/DC0%0/1
$r{$$p{"reason"}} // ["Normal", $$p{"reason"}, "kubelet"]
$r{$$p{"reason"}}
Truth table50%1/2
A
A= $r{$$p{"reason"}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | my $msg = $p->{reason} eq 'ImagePullBackOff' ? qq{Failed to pull image "$p->{container}{image}": rpc error: code = NotFound desc = failed to pull and unpack image "$p->{container}{image}": failed to resolve reference "$p->{container}{image}": $p->{container}{image}: not found} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | 1 | ▶ | : $p->{reason} eq 'CreateContainerConfigError' ? "Error: $p->{message}" : $p->{message}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | 1 | @ev = ( 'Events:', ' Type Reason Age From Message', ' ---- ------ ---- ---- -------', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | sprintf( ' %-8s %-10s %-19s %-18s %s', @$r[ 0, 1 ], '2m (x41 over 12m)', $r->[2], $msg ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | 0 | else { @ev = ('Events: <none>') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | 1 | my ($c) = @{ $p->{template}{containers} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | return join "\n", "Name: $p->{name}", "Namespace: $ns", 'Node: ' . ( $p->{phase} eq 'Pending' && $p->{reason} eq 'Unschedulable' ? '<none>' : 'node1/10.30.0.21' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | 2 | ▶ | 'Labels: ' . join( "\n ", map {"$_=$p->{labels}{$_}"} sort keys %{ $p->{labels} } ), "Status: $p->{phase}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition33%1/3
$$p{"phase"} eq "Pending" and $$p{"reason"} eq "Unschedulable"
MC/DC0%0/2
$$p{"phase"} eq "Pending" and $$p{"reason"} eq "Unschedulable"
$$p{"phase"} eq "Pending"
$$p{"reason"} eq "Unschedulable"
Truth table33%1/3
A and B
A= $$p{"phase"} eq "Pending"B= $$p{"reason"} eq "Unschedulable"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | "IP: " . ( $p->{phase} eq 'Pending' && $p->{reason} eq 'Unschedulable' ? '' : $p->{ip} ), 'Containers:', _describe_container( $c, ' ' ), @state, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | 1 | ▶ | " Ready: " . ( $p->{ready} ? 'True' : 'False' ), " Restart Count: $p->{restarts}", 'Conditions:', ' Type Status', ' Ready ' . ( $p->{ready} ? 'True' : 'False' ), @ev; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$p{"phase"} eq "Pending" and $$p{"reason"} eq "Unschedulable"
MC/DC0%0/2
$$p{"phase"} eq "Pending" and $$p{"reason"} eq "Unschedulable"
$$p{"phase"} eq "Pending"
$$p{"reason"} eq "Unschedulable"
Truth table33%1/3
A and B
A= $$p{"phase"} eq "Pending"B= $$p{"reason"} eq "Unschedulable"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | # kubectl exec POD -- curl|wget URL : Erreichbarkeit von Pod zu Service | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | 18 | ▶ | sub _v_exec { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_exec: called CC=31 SCAR=42.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | 18 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | 18 | ▶ | my $ref = $a->[0] // return ( 'error: expected \'exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]\'.', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$a[0] // (return "error: expected 'exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]'.", 0)
MC/DC0%0/1
$$a[0] // (return "error: expected 'exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]'.", 0)
$$a[0]
Truth table50%1/2
A
A= $$a[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | 18 | my @p = _pods( $k, $o->{ns} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | 18 | ▶ | my ($src) = $ref =~ m{\Adeploy(?:ment)?/(.+)\z} ? grep { $_->{deployment} eq $1 } @p : grep { $_->{name} eq $ref } @p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | 18 | ▶ | return ( qq{Error from server (NotFound): pods "$ref" not found}, 0 ) unless $src; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1119 | 18 | ▶ | my @cmd = @{ $o->{rest} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$o{'rest'} || []
MC/DC0%0/1
$$o{'rest'} || []
$$o{'rest'}
Truth table50%1/2
A
A= $$o{'rest'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1120 | 18 | ▶ | return ( qq{error: unable to upgrade connection: container not found ("$src->{template}{containers}[0]{name}")}, 0 ) unless $src->{phase} eq 'Running' && $src->{reason} ne 'CrashLoopBackOff'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$$src{"phase"} eq "Running" and $$src{"reason"} ne "CrashLoopBackOff"
MC/DC0%0/2
$$src{"phase"} eq "Running" and $$src{"reason"} ne "CrashLoopBackOff"
$$src{"phase"} eq "Running"
$$src{"reason"} ne "CrashLoopBackOff"
Truth table33%1/3
A and B
A= $$src{"phase"} eq "Running"B= $$src{"reason"} ne "CrashLoopBackOff"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1121 | 18 | ▶ | if ( $o->{interactive} && !@cmd || ( $cmd[0] // '' ) =~ /\A(?:sh|bash|ash)\z/ && @cmd == 1 ) { push @GAPS, "kubectl exec -it"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition72%8/11
$$o{"interactive"} and not @cmd or ($cmd[0] // "") =~ /\A(?:sh|bash|ash)\z/ and @cmd == 1
$$o{"interactive"} and not @cmd
($cmd[0] // "") =~ /\A(?:sh|bash|ash)\z/ and @cmd == 1
$cmd[0] // ""
MC/DC0%0/4
$$o{"interactive"} and not @cmd or ($cmd[0] // "") =~ /\A(?:sh|bash|ash)\z/ and @cmd == 1
$$o{"interactive"}
not @cmd
$cmd[0]
@cmd == 1
Truth table28%2/7
A and not(B) or C and D
A= $$o{"interactive"}B= not @cmdC= $cmd[0]D= @cmd == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1122 | 17 | ▶ | return pod_tool( $k, $o->{ns}, $src, \@cmd ) if ( $cmd[0] // '' ) =~ /\A(?:curl|wget)\z/ || ( $cmd[0] // '' ) eq 'openssl' && ( $cmd[1] // '' ) eq 's_client'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%8/12
($cmd[0] // "") =~ /\A(?:curl|wget)\z/ or ($cmd[0] // "") eq "openssl" and ($cmd[1] // "") eq "s_client"
$cmd[0] // ""
($cmd[0] // "") eq "openssl" and ($cmd[1] // "") eq "s_client"
$cmd[0] // ""
$cmd[1] // ""
MC/DC0%0/3
($cmd[0] // "") =~ /\A(?:curl|wget)\z/ or ($cmd[0] // "") eq "openssl" and ($cmd[1] // "") eq "s_client"
$cmd[0]
$cmd[0]
$cmd[1]
Truth table25%1/4
A or B and C
A= $cmd[0]B= $cmd[0]C= $cmd[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1123 | # alles andere in einer Shell des Pods (curl, wget, openssl darin wieder ueber den Cluster) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1124 | 3 | require Langertha::Holmgang::Sim::Linux; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1125 | 3 | ▶ | my $line = ( $cmd[0] // '' ) =~ /\A(?:sh|bash|ash)\z/ && ( $cmd[1] // '' ) eq '-c' ? $cmd[2] // '' : join ' ', map { /\A[\w\/.:=,@%+-]+\z/ ? $_ : "'" . s/'/'\\''/gr . "'" } @cmd; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition55%5/9
($cmd[0] // "") =~ /\A(?:sh|bash|ash)\z/ and ($cmd[1] // "") eq "-c"
$cmd[0] // ""
$cmd[1] // ""
$cmd[2] // ""
MC/DC0%0/2
($cmd[0] // "") =~ /\A(?:sh|bash|ash)\z/ and ($cmd[1] // "") eq "-c"
$cmd[0]
$cmd[1]
MC/DC0%0/1
$cmd[2] // ""
$cmd[2]
Truth table33%1/3
A and B
A= $cmd[0]B= $cmd[1]
Truth table50%1/2
A
A= $cmd[2]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1126 | 3 | my ($c) = @{ $src->{template}{containers} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1127 | 0 | ▶ | my %env = map { $_->{name} => ( defined $_->{value} ? $_->{value} : defined $_->{secret} ? ( ( ( $k->{namespaces}{ $o->{ns} }{secrets} || {} )->{ $_->{secret} } || {} )->{ $_->{key} } // '' ) : '' ) } @{ $c->{env} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition12%1/8
(($$k{"namespaces"}{$$o{"ns"}}{"secrets"} || {})->{$$_{"secret"}} || {})->{$$_{"key"}} // ""
($$k{'namespaces'}{$$o{'ns'}}{'secrets'} || {})->{$$_{'secret'}} || {}
$$k{'namespaces'}{$$o{'ns'}}{'secrets'} || {}
$$c{'env'} || []
MC/DC0%0/1
(($$k{"namespaces"}{$$o{"ns"}}{"secrets"} || {})->{$$_{"secret"}} || {})->{$$_{"key"}} // ""
$$k{'namespaces'}{$$o{'ns'}}{'secrets'}
MC/DC0%0/1
$$c{'env'} || []
$$c{'env'}
Truth table0%0/2
A
A= $$k{'namespaces'}{$$o{'ns'}}{'secrets'}
Truth table50%1/2
A
A= $$c{'env'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1128 | my $pd = { type => 'linux', hostname => $src->{name}, pod => { ns => $o->{ns}, name => $src->{name} }, kubernetes => $k, env => \%env, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1129 | files => { '/etc/hosts' => "127.0.0.1\tlocalhost\n$src->{ip}\t$src->{name}\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1130 | '/etc/resolv.conf' => "search $o->{ns}.svc.cluster.local svc.cluster.local cluster.local\nnameserver 10.43.0.10\noptions ndots:5\n" }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1131 | 3 | dirs => { map { $_ => {} } qw( /bin /etc /tmp /usr /var /proc /dev /app ) } }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1132 | 3 | my ( $out, $ok, $gap ) = Langertha::Holmgang::Sim::Linux->run( $pd, $line, { host => $src->{name}, state => {} } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1133 | 0 | ▶ | push @GAPS, map {"kubectl exec -- $_"} split /; /, $gap if defined $gap; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | 3 | return ( $out, $ok ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | 16 | ▶ | sub pod_tool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pod_tool: called CC=46 SCAR=44.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | 16 | my ( $k, $srcns, $src, $cmdref ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | 16 | my @cmd = @$cmdref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | 16 | my $o = { ns => $srcns }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | 16 | ▶ | my $tool = $cmd[0] // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cmd[0] // ""
MC/DC0%0/1
$cmd[0] // ""
$cmd[0]
Truth table50%1/2
A
A= $cmd[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | 16 | ▶ | if ( $tool eq 'openssl' && ( $cmd[1] // '' ) eq 's_client' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition60%3/5
$tool eq "openssl" and ($cmd[1] // "") eq "s_client"
$cmd[1] // ""
MC/DC50%1/2
$tool eq "openssl" and ($cmd[1] // "") eq "s_client"
$tool eq "openssl"
$cmd[1]
Truth table66%2/3
A and B
A= $tool eq "openssl"B= $cmd[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | 2 | my ( $conn, $sni ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | 2 | ▶ | for my $i ( 2 .. $#cmd ) { $conn = $cmd[ $i + 1 ] if $cmd[$i] eq '-connect'; $sni = $cmd[ $i + 1 ] if $cmd[$i] eq '-servername' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | 2 | ▶ | my ($h) = ( $conn // '' ) =~ /\A([^:]+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$conn // ""
MC/DC0%0/1
$conn // ""
$conn
Truth table50%1/2
A
A= $conn
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | 2 | ▶ | return ( 's_client: -connect requires an argument', 0 ) unless defined $h; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | 2 | return tls_probe( $k, $h, $sni ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | 0 | ▶ | if ( $tool !~ /\A(?:curl|wget)\z/ || $o->{interactive} ) { push @GAPS, "kubectl exec -- @cmd"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $tool =~ /\A(?:curl|wget)\z/ or $$o{"interactive"}
MC/DC0%0/2
not $tool =~ /\A(?:curl|wget)\z/ or $$o{"interactive"}
not $tool =~ /\A(?:curl|wget)\z/
$$o{"interactive"}
Truth table33%1/3
not(A) or B
A= not $tool =~ /\A(?:curl|wget)\z/B= $$o{"interactive"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | 14 | my ($url) = grep {m{\Ahttps?://}} @cmd; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | 0 | ▶ | ($url) = grep { !/\A-/ && $_ ne $tool } @cmd unless $url; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
!/\A-/ && $_ ne $tool
MC/DC0%0/2
!/\A-/ && $_ ne $tool
!/\A-/
$_ ne $tool
Truth table0%0/3
not(A) && B
A= !/\A-/B= $_ ne $tool
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | 14 | ▶ | return ( "$tool: no URL specified", 1 ) unless defined $url; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | 14 | ▶ | my ( $host, $port, $path ) = $url =~ m{\A(?:https?://)?([^/:]+)(?::(\d+))?(/.*)?\z} or return ( "$tool: bad URL", 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | # oeffentliche Namen (DNS auf den Ingress-Controller): ueber den Ingress | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | 14 | ▶ | my ($hh) = map { /\AHost:\s*(\S+)/i ? $1 : () } @cmd; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1157 | 14 | ▶ | if ( defined $hh || _public_host( $k, $host ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $hh or _public_host($k, $host)
MC/DC100%2/2
defined $hh or _public_host($k, $host)
defined $hh
_public_host($k, $host)
Truth table100%3/3
A or B
A= defined $hhB= _public_host($k, $host)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1158 | 9 | ▶ | return _client_ingress( $k, $tool, \@cmd, $url =~ m{\Ahttps://} ? 'https' : 'http', $hh // $host, $path // '/' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition60%3/5
$hh // $host
$path // "/"
MC/DC0%0/2
$hh // $host
$hh
$host
MC/DC0%0/1
$path // "/"
$path
Truth table66%2/3
A // B
A= $hhB= $host
Truth table50%1/2
A
A= $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1160 | 5 | ( my $svcname = $host ) =~ s/\..*//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1161 | 5 | ▶ | my $ns = $host =~ /\A[^.]+\.([^.]+)/ && $1 ne 'svc' ? $1 : $o->{ns}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$host =~ /\A[^.]+\.([^.]+)/ and $1 ne "svc"
MC/DC50%1/2
$host =~ /\A[^.]+\.([^.]+)/ and $1 ne "svc"
$host =~ /\A[^.]+\.([^.]+)/
$1 ne "svc"
Truth table66%2/3
A and B
A= $host =~ /\A[^.]+\.([^.]+)/B= $1 ne "svc"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1162 | 5 | ▶ | my $svc = ( $k->{namespaces}{$ns} || {} )->{services}{$svcname}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
$$k{'namespaces'}{$ns} || {}
$$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1163 | 5 | ▶ | my $fail = sub { $tool eq 'curl' ? ( "curl: ($_[0]) $_[1]", 0 ) : ( "wget: $_[2]", 0 ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | 5 | ▶ | return $fail->( 6, "Could not resolve host: $host", "bad address '$host'" ) unless $svc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | 5 | ▶ | my ($sp) = grep { $_->{port} == ( $port // 80 ) } @{ $svc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$port // 80
$$svc{'ports'} || []
MC/DC0%0/1
$port // 80
$port
MC/DC0%0/1
$$svc{'ports'} || []
$$svc{'ports'}
Truth table50%1/2
A
A= $port
Truth table50%1/2
A
A= $$svc{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | 5 | ▶ | return $fail->( 28, "Failed to connect to $host port " . ( $port // 80 ) . " after 10001 ms: Timeout was reached", 'download timed out' ) unless $sp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$port // 80
MC/DC0%0/1
$port // 80
$port
Truth table0%0/2
A
A= $port
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | 5 | my @e = _endpoints( $k, $ns, $svcname ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | 5 | ▶ | return $fail->( 7, "Failed to connect to $host port " . ( $port // 80 ) . " after 2 ms: Couldn't connect to server", "can't connect to remote host: Connection refused" ) unless @e; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$port // 80
MC/DC0%0/1
$port // 80
$port
Truth table50%1/2
A
A= $port
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | 4 | my $dst = $e[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | # NetworkPolicies (Ingress) des Ziel-Namespace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | 4 | ▶ | my @pol = grep { _sel_match( $_->{pod_selector}, $dst->{labels} ) } values %{ $k->{namespaces}{$ns}{networkpolicies} || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$k{'namespaces'}{$ns}{'networkpolicies'} || {}
MC/DC100%1/1
$$k{'namespaces'}{$ns}{'networkpolicies'} || {}
$$k{'namespaces'}{$ns}{'networkpolicies'}
Truth table100%2/2
A
A= $$k{'namespaces'}{$ns}{'networkpolicies'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | 4 | ▶ | if (@pol) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | my $ok = grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1174 | 3 | my $r = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1175 | 3 | ▶ | ( !$r->{from} || grep { $ns eq $o->{ns} && _sel_match( $_, $src->{labels} ) } @{ $r->{from} } ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%3/6
$ns eq $$o{'ns'} && _sel_match($_, $$src{'labels'})
not $$r{"ports"} or grep {$_ == $$sp{"target"};} @{$$r{"ports"};}
MC/DC50%1/2
$ns eq $$o{'ns'} && _sel_match($_, $$src{'labels'})
$ns eq $$o{'ns'}
_sel_match($_, $$src{'labels'})
MC/DC0%0/2
not $$r{"ports"} or grep {$_ == $$sp{"target"};} @{$$r{"ports"};}
not $$r{"ports"}
grep {$_ == $$sp{"target"};} @{$$r{"ports"};}
Truth table66%2/3
A && B
A= $ns eq $$o{'ns'}B= _sel_match($_, $$src{'labels'})
Truth table33%1/3
not(A) or B
A= not $$r{"ports"}B= grep {$_ == $$sp{"target"};} @{$$r{"ports"};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1176 | 3 | ▶ | && ( !$r->{ports} || grep { $_ == $sp->{target} } @{ $r->{ports} } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%4/6
(!$$r{'from'} || grep({$ns eq $$o{'ns'} and _sel_match($_, $$src{'labels'});} @{$$r{'from'};})) && (!$$r{'ports'} || grep({$_ == $$sp{'target'};} @{$$r{'ports'};}))
not $$r{"from"} or grep {$ns eq $$o{"ns"} and _sel_match($_, $$src{"labels"});} @{$$r{"from"};}
MC/DC0%0/3
(!$$r{'from'} || grep({$ns eq $$o{'ns'} and _sel_match($_, $$src{'labels'});} @{$$r{'from'};})) && (!$$r{'ports'} || grep({$_ == $$sp{'target'};} @{$$r{'ports'};}))
not $$r{"from"}
grep {$ns eq $$o{"ns"} and _sel_match($_, $$src{"labels"});} @{$$r{"from"};}
(!$$r{'ports'} || grep({$_ == $$sp{'target'};} @{$$r{'ports'};}))
Truth table40%2/5
not(A) or B && C
A= not $$r{"from"}B= grep {$ns eq $$o{"ns"} and _sel_match($_, $$src{"labels"});} @{$$r{"from"};}C= (!$$r{'ports'} || grep({$_ == $$sp{'target'};} @{$$r{'ports'};}))
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1177 | 3 | ▶ | } map { @{ $_->{ingress} || [] } } @pol; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$_{'ingress'} || []
MC/DC0%0/1
$$_{'ingress'} || []
$$_{'ingress'}
Truth table50%1/2
A
A= $$_{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1178 | 3 | ▶ | return $fail->( 28, "Failed to connect to $host port " . ( $port // 80 ) . " after 10001 ms: Timeout was reached", 'download timed out' ) unless $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$port // 80
MC/DC0%0/1
$port // 80
$port
Truth table50%1/2
A
A= $port
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1179 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1180 | 3 | my ($dc) = @{ $dst->{template}{containers} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1181 | return $fail->( 7, "Failed to connect to $host port " . ( $port // 80 ) . " after 2 ms: Couldn't connect to server", "can't connect to remote host: Connection refused" ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1182 | 3 | ▶ | unless grep { $_ == $sp->{target} } @{ $dc->{listens} || $dc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition28%2/7
$$dc{'listens'} || $$dc{'ports'} || []
$$dc{"listens"} or $$dc{"ports"}
$port // 80
MC/DC0%0/2
$$dc{'listens'} || $$dc{'ports'} || []
$$dc{"listens"}
$$dc{"ports"}
MC/DC0%0/1
$port // 80
$port
Truth table33%1/3
A or B
A= $$dc{"listens"}B= $$dc{"ports"}
Truth table0%0/2
A
A= $port
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1183 | 3 | ▶ | return ( $dc->{http_body} // '{"status":"ok"}', 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$dc{"http_body"} // "{\"status\":\"ok\"}"
MC/DC100%1/1
$$dc{"http_body"} // "{\"status\":\"ok\"}"
$$dc{"http_body"}
Truth table100%2/2
A
A= $$dc{"http_body"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1186 | # --- openssl s_client gegen den Ingress ------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1188 | 4 | ▶ | sub _dn_issuer { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_dn_issuer: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1189 | 4 | my ($i) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1190 | 4 | ▶ | return 'O = Acme Co, CN = Kubernetes Ingress Controller Fake Certificate' unless defined $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1191 | 4 | ▶ | return "C = US, O = (STAGING) Let's Encrypt, CN = (STAGING) Counterfeit Cashew R10" if $i =~ /staging/i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1192 | 4 | ▶ | return "C = US, O = Let's Encrypt, CN = R11" if $i =~ /letsencrypt|acme/i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1193 | 1 | ( my $n = $i ) =~ s{\A\w+/}{}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1194 | 1 | return "CN = $n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1195 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | 3 | ▶ | sub tls_probe { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tls_probe: called CC=17 SCAR=33.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | 3 | my ( $k, $host, $sni ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | 3 | ▶ | $sni //= $host; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$sni //= $host
MC/DC0%0/2
$sni //= $host
$sni
$host
Truth table33%1/3
A //= B
A= $sniB= $host
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | 3 | ▶ | return ( "$host: Name or service not known\nconnect:errno=2", 0 ) unless _public_host( $k, $host ) || $host =~ /\A[\d.]+\z/ && $host eq ( ( $k->{ingress} || {} )->{address} // '' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition10%1/10
_public_host($k, $host) or $host =~ /\A[\d.]+\z/ and $host eq (($$k{"ingress"} || {})->{"address"} // "")
$host =~ /\A[\d.]+\z/ and $host eq (($$k{"ingress"} || {})->{"address"} // "")
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'} || {}
MC/DC0%0/3
_public_host($k, $host) or $host =~ /\A[\d.]+\z/ and $host eq (($$k{"ingress"} || {})->{"address"} // "")
_public_host($k, $host)
$host =~ /\A[\d.]+\z/
$host eq (($$k{"ingress"} || {})->{"address"} // "")
MC/DC0%0/1
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'}
Truth table25%1/4
A or B and C
A= _public_host($k, $host)B= $host =~ /\A[\d.]+\z/C= $host eq (($$k{"ingress"} || {})->{"address"} // "")
Truth table0%0/2
A
A= $$k{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | 3 | my ( $ns, $sec ) = _tls_for_host( $k, $sni ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | 3 | ▶ | my $s = defined $sec ? _secret( $k, $ns, $sec ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | 3 | ▶ | my $info = $s && defined $s->{'tls.crt'} ? _cert_info( $s->{'tls.crt'} ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$s and defined $$s{"tls.crt"}
MC/DC50%1/2
$s and defined $$s{"tls.crt"}
$s
defined $$s{"tls.crt"}
Truth table66%2/3
A and B
A= $sB= defined $$s{"tls.crt"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | 3 | my ( $subj, $iss, $pem, $verify ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | 3 | ▶ | if ($info) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | 2 | ▶ | ( $subj = $info->{subject} // 'CN=' . ( $info->{san}[0] // $sni ) ) =~ s/=/ = /g; $subj =~ s/,\s*/, /g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition20%1/5
$$info{"subject"} // 'CN=' . ($$info{"san"}[0] // $sni)
$$info{"san"}[0] // $sni
MC/DC0%0/1
$$info{"subject"} // 'CN=' . ($$info{"san"}[0] // $sni)
$$info{"subject"}
MC/DC0%0/2
$$info{"san"}[0] // $sni
$$info{"san"}[0]
$sni
Truth table50%1/2
A
A= $$info{"subject"}
Truth table0%0/3
A // B
A= $$info{"san"}[0]B= $sni
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | 2 | $iss = _dn_issuer( $info->{issuer} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | 2 | $pem = $s->{'tls.crt'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | 2 | ▶ | $verify = !( grep { _host_match( $_, $sni ) } @{ $info->{san} } ) ? '62 (hostname mismatch)' : $info->{trusted} ? '0 (ok)' : '20 (unable to get local issuer certificate)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | 1 | $subj = 'O = Acme Co, CN = Kubernetes Ingress Controller Fake Certificate'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | 1 | $iss = $subj; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | 1 | $pem = _pem( subject => 'O=Acme Co,CN=Kubernetes Ingress Controller Fake Certificate', san => 'ingress.local', issuer => 'fake', trusted => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | 1 | $verify = '18 (self-signed certificate)'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | 3 | ▶ | return ( join( "\n", 'CONNECTED(00000003)', "depth=0 $subj", ( $verify =~ /\A0 / ? 'verify return:1' : 'verify error:num=' . ( $verify =~ s/ \((.*)\)/:$1/r ) ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | '---', 'Certificate chain', " 0 s:$subj", " i:$iss", '---', 'Server certificate', $pem =~ s/\n\z//r, "subject=$subj", "issuer=$iss", '---', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | 'SSL handshake has read 3214 bytes and written 389 bytes', 'Verification' . ( $verify =~ /\A0 / ? ': OK' : ' error: ' . ( $verify =~ s/\A\d+ \((.*)\)/$1/r ) ), '---', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | " Verify return code: $verify", '---', 'DONE' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | 2 | ▶ | sub x509 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
x509: called CC=14 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | 2 | my ( $pem, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | 2 | ▶ | my $info = _cert_info($pem) or return ( "Could not read certificate from <stdin>\nUnable to load certificate", 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | 2 | ▶ | ( my $subj = $info->{subject} // 'CN=' . ( $info->{san}[0] // '' ) ) =~ s/=/ = /g; $subj =~ s/,\s*/, /g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$$info{"subject"} // 'CN=' . ($$info{"san"}[0] // "")
$$info{"san"}[0] // ""
MC/DC0%0/1
$$info{"subject"} // 'CN=' . ($$info{"san"}[0] // "")
$$info{"subject"}
MC/DC0%0/1
$$info{"san"}[0] // ""
$$info{"san"}[0]
Truth table50%1/2
A
A= $$info{"subject"}
Truth table0%0/2
A
A= $$info{"san"}[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1229 | 2 | my $iss = _dn_issuer( $info->{issuer} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1230 | 2 | my @san = map {"DNS:$_"} grep {length} @{ $info->{san} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1231 | 2 | my %w = map { $_ => 1 } @$o; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1232 | 2 | my @l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1233 | 2 | ▶ | if ( $w{'-text'} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1234 | 0 | return ( join( "\n", 'Certificate:', ' Data:', ' Version: 3 (0x2)', " Issuer: $iss", ' Validity', ' Not Before: Oct 21 07:12:44 2026 GMT', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1235 | ' Not After : Jan 19 07:12:43 2027 GMT', " Subject: $subj", ' X509v3 extensions:', ' X509v3 Subject Alternative Name: ', ' ' . join( ', ', @san ) ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1236 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1237 | 2 | ▶ | push @l, "subject=$subj" if $w{'-subject'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | 2 | ▶ | push @l, "issuer=$iss" if $w{'-issuer'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | 2 | ▶ | push @l, 'notBefore=Oct 21 07:12:44 2026 GMT' if $w{'-dates'} || $w{'-startdate'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$w{"-dates"} or $w{"-startdate"}
MC/DC0%0/2
$w{"-dates"} or $w{"-startdate"}
$w{"-dates"}
$w{"-startdate"}
Truth table33%1/3
A or B
A= $w{"-dates"}B= $w{"-startdate"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | 2 | ▶ | push @l, 'notAfter=Jan 19 07:12:43 2027 GMT' if $w{'-dates'} || $w{'-enddate'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$w{"-dates"} or $w{"-enddate"}
MC/DC0%0/2
$w{"-dates"} or $w{"-enddate"}
$w{"-dates"}
$w{"-enddate"}
Truth table33%1/3
A or B
A= $w{"-dates"}B= $w{"-enddate"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | 2 | ▶ | push @l, 'X509v3 Subject Alternative Name: ', ' ' . join( ', ', @san ) if grep {/subjectAltName/} @$o; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | 2 | ▶ | push @l, $pem =~ s/\n\z//r unless $w{'-noout'} || @l; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$w{"-noout"} or @l
MC/DC0%0/2
$w{"-noout"} or @l
$w{"-noout"}
@l
Truth table33%1/3
A or B
A= $w{"-noout"}B= @l
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | 2 | return ( join( "\n", @l ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1246 | # --- -o jsonpath / custom-columns --------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1249 | 22 | ▶ | sub _jp_segments { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_jp_segments: called CC=14 SCAR=34.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1250 | 22 | my ($p) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1251 | 22 | my @s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1252 | 22 | $p =~ s/\A\s+|\s+\z//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1253 | 22 | $p =~ s/\A\$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1254 | 22 | ▶ | while ( length $p ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1255 | 0 | ▶ | if ( $p =~ s/\A\.\.((?:[^.\[\\]|\\.)+)// ) { push @s, [ 'rec', $1 =~ s/\\(.)/$1/gr ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | 66 | elsif ( $p =~ s/\A\.((?:[^.\[\\]|\\.)+)// ) { push @s, [ 'key', $1 =~ s/\\(.)/$1/gr ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | 0 | elsif ( $p =~ s/\A\[\s*['"]([^'"]*)['"]\s*\]// ) { push @s, [ 'key', $1 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | 1 | elsif ( $p =~ s/\A\[\s*\*\s*\]// ) { push @s, ['all'] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | 10 | elsif ( $p =~ s/\A\[\s*(-?\d+)\s*\]// ) { push @s, [ 'idx', $1 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | 0 | elsif ( $p =~ s/\A\[\s*(-?\d*)\s*:\s*(-?\d*)\s*\]// ) { push @s, [ 'slice', $1, $2 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | 1 | ▶ | elsif ( $p =~ s/\A\[\s*\?\(\s*@((?:\.(?:[^.\s=!<>)\\]|\\.)+)+)\s*(==|!=)\s*(?:"([^"]*)"|'([^']*)'|(\S+?))\s*\)\s*\]// ) { push @s, [ 'filter', $1, $2, $3 // $4 // $5 ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
($3 // $4) // $5
$3 // $4
MC/DC0%0/3
($3 // $4) // $5
$3
$4
$5
Truth table25%1/4
A // B // C
A= $3B= $4C= $5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | 0 | elsif ( $p =~ s/\A\[\s*\?\(\s*@((?:\.(?:[^.\s)\\]|\\.)+)+)\s*\)\s*\]// ) { push @s, [ 'has', $1 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | 0 | ▶ | elsif ( $p eq '.' || $p eq '@' ) { last } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$p eq "." or $p eq "\@"
MC/DC0%0/2
$p eq "." or $p eq "\@"
$p eq "."
$p eq "\@"
Truth table0%0/3
A or B
A= $p eq "."B= $p eq "\@"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1264 | 0 | else { return undef } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1265 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1266 | 22 | return \@s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1267 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1269 | 23 | ▶ | sub _jp_eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_jp_eval: called CC=38 SCAR=57.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1270 | 23 | my ( $nodes, $segs ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1271 | 23 | my @cur = @$nodes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1272 | 23 | for my $s (@$segs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1273 | 79 | my @n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1274 | 79 | for my $x (@cur) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1275 | 79 | ▶ | if ( $s->[0] eq 'key' ) { push @n, $x->{ $s->[1] } if ref $x eq 'HASH' && exists $x->{ $s->[1] } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
Condition33%1/3
ref $x eq "HASH" and exists $$x{$$s[1]}
MC/DC0%0/2
ref $x eq "HASH" and exists $$x{$$s[1]}
ref $x eq "HASH"
exists $$x{$$s[1]}
Truth table33%1/3
A and B
A= ref $x eq "HASH"B= exists $$x{$$s[1]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1276 | 0 | ▶ | elsif ( $s->[0] eq 'all' ) { push @n, ref $x eq 'ARRAY' ? @$x : ref $x eq 'HASH' ? @{$x}{ sort keys %$x } : () } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1277 | 10 | ▶ | elsif ( $s->[0] eq 'idx' ) { push @n, $x->[ $s->[1] ] if ref $x eq 'ARRAY' && defined $x->[ $s->[1] ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $x eq "ARRAY" and defined $$x[$$s[1]]
MC/DC0%0/2
ref $x eq "ARRAY" and defined $$x[$$s[1]]
ref $x eq "ARRAY"
defined $$x[$$s[1]]
Truth table33%1/3
A and B
A= ref $x eq "ARRAY"B= defined $$x[$$s[1]]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1278 | elsif ( $s->[0] eq 'slice' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1279 | 0 | ▶ | next unless ref $x eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1280 | 0 | ▶ | my ( $f, $t ) = ( length $s->[1] ? $s->[1] : 0, length $s->[2] ? $s->[2] : scalar @$x ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1281 | 0 | $_ += @$x for grep { $_ < 0 } $f, $t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1282 | 0 | ▶ | push @n, @$x[ $f .. ( $t > @$x ? $#$x : $t - 1 ) ] if $f < @$x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1283 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1284 | ▶ | elsif ( $s->[0] eq 'filter' || $s->[0] eq 'has' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$$s[0] eq "filter" or $$s[0] eq "has"
MC/DC0%0/2
$$s[0] eq "filter" or $$s[0] eq "has"
$$s[0] eq "filter"
$$s[0] eq "has"
Truth table33%1/3
A or B
A= $$s[0] eq "filter"B= $$s[0] eq "has"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1285 | 1 | ▶ | next unless ref $x eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1286 | 1 | ▶ | my $sub = _jp_segments( $s->[1] ) or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1287 | 1 | for my $el (@$x) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1288 | 2 | my ($v) = _jp_eval( [$el], $sub ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1289 | 0 | ▶ | if ( $s->[0] eq 'has' ) { push @n, $el if defined $v; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1290 | 2 | ▶ | my $vs = defined $v && !ref $v ? ( JSON::MaybeXS::is_bool($v) ? ( $v ? 'true' : 'false' ) : "$v" ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition33%1/3
defined $v and not ref $v
MC/DC0%0/2
defined $v and not ref $v
defined $v
not ref $v
Truth table33%1/3
A and not(B)
A= defined $vB= not ref $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1291 | 2 | ▶ | my $eq = defined $vs && $vs eq $s->[3]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $vs && $vs eq $$s[3]
MC/DC50%1/2
defined $vs && $vs eq $$s[3]
defined $vs
$vs eq $$s[3]
Truth table66%2/3
A && B
A= defined $vsB= $vs eq $$s[3]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1292 | 2 | ▶ | push @n, $el if $s->[2] eq '==' ? $eq : !$eq; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1293 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1295 | elsif ( $s->[0] eq 'rec' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1296 | 0 | my @q = ($x); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1297 | 0 | ▶ | while (@q) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1298 | 0 | my $y = shift @q; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1299 | 0 | ▶ | if ( ref $y eq 'HASH' ) { push @n, $y->{ $s->[1] } if exists $y->{ $s->[1] }; push @q, @{$y}{ sort keys %$y } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1300 | 0 | elsif ( ref $y eq 'ARRAY' ) { push @q, @$y } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1304 | 79 | @cur = @n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1305 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1306 | 23 | return @cur; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1308 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1309 | 20 | ▶ | sub _jp_text { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_jp_text: called CC=5 SCAR=18.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1310 | 20 | my ($v) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1311 | 20 | ▶ | return '' unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1312 | 20 | ▶ | return $v ? 'true' : 'false' if JSON::MaybeXS::is_bool($v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1313 | 20 | ▶ | return JSON::MaybeXS->new( canonical => 1 )->encode($v) if ref $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1314 | 20 | return "$v"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1317 | 9 | ▶ | sub jsonpath { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
jsonpath: called CC=5 SCAR=16.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1318 | 9 | my ( $data, $tpl ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1319 | 9 | $tpl =~ s/\A\s*'(.*)'\s*\z/$1/s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1320 | 9 | my @tok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1321 | 9 | ▶ | while ( length $tpl ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1322 | 14 | ▶ | if ( $tpl =~ s/\A\{((?:[^{}"]|"(?:[^"\\]|\\.)*")*)\}// ) { push @tok, [ 'e', $1 ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1323 | 1 | elsif ( $tpl =~ s/\A([^{]+)// ) { push @tok, [ 't', $1 ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1324 | 0 | else { return ( undef, 'error: error parsing jsonpath ' . $tpl . ', unclosed action' ) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1325 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1326 | 9 | my $err; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1327 | my $run; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1328 | 13 | ▶ | $run = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=13 SCAR=26.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1329 | 13 | my ( $toks, $ctx ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1330 | 13 | my $out = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1331 | 13 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1332 | 13 | ▶ | while ( $i < @$toks ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1333 | 25 | my ( $t, $v ) = @{ $toks->[$i] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1334 | 25 | ▶ | if ( $t eq 't' ) { $out .= $v; $i++; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1335 | 21 | $v =~ s/\A\s+|\s+\z//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1336 | 21 | ▶ | if ( $v =~ /\A"((?:[^"\\]|\\.)*)"\z/ ) { ( my $l = $1 ) =~ s/\\n/\n/g; $l =~ s/\\t/\t/g; $l =~ s/\\(.)/$1/g; $out .= $l; $i++; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1337 | 17 | ▶ | if ( $v =~ /\Arange\s+(.+)\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1338 | 1 | my $path = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1339 | 1 | my ( $depth, $j ) = ( 1, $i + 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1340 | 1 | ▶ | for ( ; $j < @$toks; $j++ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1341 | 5 | ▶ | next unless $toks->[$j][0] eq 'e'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1342 | 4 | ▶ | $depth++ if $toks->[$j][1] =~ /\A\s*range\s/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1343 | 4 | ▶ | last if $toks->[$j][1] =~ /\A\s*end\s*\z/ && !--$depth; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$toks[$j][1] =~ /\A\s*end\s*\z/ and not --$depth
MC/DC50%1/2
$$toks[$j][1] =~ /\A\s*end\s*\z/ and not --$depth
$$toks[$j][1] =~ /\A\s*end\s*\z/
not --$depth
Truth table66%2/3
A and not(B)
A= $$toks[$j][1] =~ /\A\s*end\s*\z/B= not --$depth
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1344 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1345 | 0 | ▶ | my $segs = _jp_segments($path) or do { $err = "error: error parsing jsonpath $path"; return '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1346 | 1 | my @body = @$toks[ $i + 1 .. $j - 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1347 | 1 | $out .= $run->( \@body, $_ ) for _jp_eval( [$ctx], $segs ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1348 | 1 | $i = $j + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1349 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1350 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1351 | 0 | ▶ | my $segs = _jp_segments($v) or do { $err = "error: error parsing jsonpath {$v}, unrecognized character"; return '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1352 | 16 | $out .= join ' ', map { _jp_text($_) } _jp_eval( [$ctx], $segs ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1353 | 16 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1355 | 13 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1356 | 9 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1357 | 9 | my $o = $run->( \@tok, $data ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1358 | 9 | ▶ | return ( undef, $err ) if defined $err; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1359 | 9 | return ( $o =~ s/\n\z//r ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1360 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1361 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1362 | 1 | ▶ | sub _custom_columns { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_custom_columns: called CC=9 SCAR=23.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1363 | 1 | my ( $data, $spec ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1364 | 1 | my @cols = map { [ split /:/, $_, 2 ] } split /,/, $spec; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1365 | 1 | ▶ | return ( undef, 'error: custom-columns format specified but no custom columns given' ) unless @cols; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1366 | 1 | ▶ | my @items = ( $data->{kind} // '' ) eq 'List' ? @{ $data->{items} || [] } : ($data); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$data{"kind"} // ""
$$data{'items'} || []
MC/DC0%0/1
$$data{"kind"} // ""
$$data{"kind"}
MC/DC0%0/1
$$data{'items'} || []
$$data{'items'}
Truth table50%1/2
A
A= $$data{"kind"}
Truth table50%1/2
A
A= $$data{'items'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1367 | 1 | my @rows = ( [ map { $_->[0] } @cols ] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1368 | 1 | for my $it (@items) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1369 | 2 | ▶ | push @rows, [ map { my $s = _jp_segments( ( $_->[1] // '' ) =~ s/\A\{|\}\z//gr ); my @v = $s ? _jp_eval( [$it], $s ) : (); @v ? join( ',', map { _jp_text($_) } @v ) : '<none>' } @cols ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%1/2
$$_[1] // ""
MC/DC0%0/1
$$_[1] // ""
$$_[1]
Truth table50%1/2
A
A= $$_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1370 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1371 | 1 | return ( _cols(@rows) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1372 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1373 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1374 | # --- RBAC --------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1375 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1376 | # API-Gruppe je Ressource (Plural der API) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1377 | our %GROUP = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1378 | 55 | ( map { $_ => '' } qw( pods services endpoints secrets configmaps persistentvolumeclaims persistentvolumes serviceaccounts events namespaces nodes ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1379 | 20 | ( map { $_ => 'apps' } qw( deployments replicasets statefulsets daemonsets ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1380 | 10 | ( map { $_ => 'batch' } qw( jobs cronjobs ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1381 | 15 | ( map { $_ => 'networking.k8s.io' } qw( ingresses ingressclasses networkpolicies ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1382 | 20 | ( map { $_ => 'rbac.authorization.k8s.io' } qw( roles rolebindings clusterroles clusterrolebindings ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1383 | 20 | ( map { $_ => 'cert-manager.io' } qw( certificates issuers clusterissuers certificaterequests ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1384 | 5 | ( map { $_ => 'acme.cert-manager.io' } qw( challenges orders ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1385 | storageclasses => 'storage.k8s.io', leases => 'coordination.k8s.io', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1386 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1387 | 5 | my %API_PLURAL = ( pvcs => 'persistentvolumeclaims' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1389 | # Ressource aus der Kommandozeile (pods, deploy, pods/log, deployments.apps) -> ( plural, gruppe ) oder () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1390 | 10 | ▶ | sub _resource { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_resource: called CC=11 SCAR=27.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1391 | 10 | my ($r) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1392 | 10 | ▶ | my ( $base, $sub ) = split m{/}, lc( $r // '' ), 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$r // ""
MC/DC0%0/1
$r // ""
$r
Truth table50%1/2
A
A= $r
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1393 | 10 | my $group; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1394 | 10 | ▶ | ( $base, $group ) = ( $1, $2 ) if $base =~ /\A([a-z]+)\.(.+)\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1395 | 10 | ▶ | my $plural = $KIND{$base} ? ( $API_PLURAL{ $KIND{$base} } // $KIND{$base} ) : exists $GROUP{$base} ? $base : $base eq '*' ? '*' : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition33%1/3
$API_PLURAL{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}} // $Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}
MC/DC0%0/2
$API_PLURAL{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}} // $Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}
$API_PLURAL{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}}
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}
Truth table33%1/3
A // B
A= $API_PLURAL{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}}B= $Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{$base}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1396 | 10 | ▶ | return () unless defined $plural; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1397 | 10 | ▶ | $group //= $GROUP{$plural} // '*'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%3/4
$group //= $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$plural} // "*"
$Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$plural} // "*"
MC/DC100%1/1
$group //= $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$plural} // "*"
$group
Truth table100%2/2
A
A= $group
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1398 | 10 | ▶ | return ( $plural . ( defined $sub ? "/$sub" : '' ), $group ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1399 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1400 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1401 | 5 | my @VIEW_RES = qw( pods pods/log services endpoints configmaps persistentvolumeclaims serviceaccounts events | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1402 | deployments replicasets statefulsets daemonsets jobs cronjobs ingresses networkpolicies ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1403 | 42 | ▶ | sub _builtin_roles { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_builtin_roles: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1404 | 126 | ▶ | my $rule = sub { my ( $verbs, @res ) = @_; my %g; push @{ $g{ $GROUP{ $_ =~ s{/.*}{}r } } }, $_ for @res; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1405 | 42 | return map { { apiGroups => [$_], resources => $g{$_}, verbs => $verbs } } sort keys %g }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1406 | 42 | my @ro = qw( get list watch ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1407 | 42 | my @rw = ( @ro, qw( create update patch delete deletecollection ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1408 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1409 | 42 | 'cluster-admin' => { rules => [ { apiGroups => ['*'], resources => ['*'], verbs => ['*'] } ] }, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1410 | admin => { rules => [ $rule->( \@rw, @VIEW_RES, qw( secrets roles rolebindings pods/exec ) ) ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1411 | edit => { rules => [ $rule->( \@rw, @VIEW_RES, qw( secrets pods/exec ) ) ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1412 | view => { rules => [ $rule->( \@ro, @VIEW_RES ) ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1413 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1414 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1415 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1416 | 42 | ▶ | sub _clusterroles { my ($k) = @_; return { %{ _builtin_roles() }, %{ $k->{clusterroles} || {} } } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clusterroles: called CC=2 SCAR=7.0
Condition50%1/2
$$k{'clusterroles'} || {}
MC/DC0%0/1
$$k{'clusterroles'} || {}
$$k{'clusterroles'}
Truth table50%1/2
A
A= $$k{'clusterroles'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1417 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1418 | # Wer: { user, groups } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1419 | 203 | ▶ | sub _who_sa { my ( $ns, $sa ) = @_; return { user => "system:serviceaccount:$ns:$sa", groups => [ 'system:serviceaccounts', "system:serviceaccounts:$ns", 'system:authenticated' ] } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_who_sa: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1420 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1421 | 17 | ▶ | sub _subject_match { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_subject_match: called CC=11 SCAR=27.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1422 | 17 | my ( $s, $who, $bns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1423 | 17 | ▶ | my $kind = $s->{kind} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{"kind"} // ""
MC/DC0%0/1
$$s{"kind"} // ""
$$s{"kind"}
Truth table50%1/2
A
A= $$s{"kind"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1424 | 17 | ▶ | return $who->{user} eq 'system:serviceaccount:' . ( $s->{namespace} // $bns // '' ) . ':' . ( $s->{name} // '' ) if $kind eq 'ServiceAccount'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition42%3/7
($$s{"namespace"} // $bns) // ""
$$s{"namespace"} // $bns
$$s{"name"} // ""
MC/DC0%0/2
($$s{"namespace"} // $bns) // ""
$$s{"namespace"}
$bns
MC/DC0%0/1
$$s{"name"} // ""
$$s{"name"}
Truth table33%1/3
A // B
A= $$s{"namespace"}B= $bns
Truth table50%1/2
A
A= $$s{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1425 | 10 | ▶ | return $who->{user} eq ( $s->{name} // '' ) if $kind eq 'User'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$s{"name"} // ""
MC/DC0%0/1
$$s{"name"} // ""
$$s{"name"}
Truth table50%1/2
A
A= $$s{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1426 | 4 | ▶ | return scalar grep { $_ eq ( $s->{name} // '' ) } @{ $who->{groups} || [] } if $kind eq 'Group'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$s{"name"} // ""
$$who{'groups'} || []
MC/DC0%0/1
$$s{"name"} // ""
$$s{"name"}
MC/DC0%0/1
$$who{'groups'} || []
$$who{'groups'}
Truth table50%1/2
A
A= $$s{"name"}
Truth table50%1/2
A
A= $$who{'groups'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1427 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1429 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1430 | 13 | ▶ | sub _rule_allows { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rule_allows: called CC=7 SCAR=19.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1431 | 13 | my ( $r, $verb, $group, $res, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1432 | 13 | ▶ | my $in = sub { my ( $l, $v ) = @_; scalar grep { $_ eq '*' || $_ eq $v } @{ ref $l eq 'ARRAY' ? $l : [] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
Branch: 1 branch
Condition66%2/3
$_ eq '*' || $_ eq $v
MC/DC50%1/2
$_ eq '*' || $_ eq $v
$_ eq '*'
$_ eq $v
Truth table66%2/3
A || B
A= $_ eq '*'B= $_ eq $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1433 | 13 | ▶ | return 0 unless $in->( $r->{verbs}, $verb ) && $in->( $r->{apiGroups}, $group ) && $in->( $r->{resources}, $res ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
&$in($$r{"verbs"}, $verb) and &$in($$r{"apiGroups"}, $group) and &$in($$r{"resources"}, $res)
&$in($$r{"verbs"}, $verb) and &$in($$r{"apiGroups"}, $group)
MC/DC66%2/3
&$in($$r{"verbs"}, $verb) and &$in($$r{"apiGroups"}, $group) and &$in($$r{"resources"}, $res)
&$in($$r{"verbs"}, $verb)
&$in($$r{"apiGroups"}, $group)
&$in($$r{"resources"}, $res)
Truth table75%3/4
A and B and C
A= &$in($$r{"verbs"}, $verb)B= &$in($$r{"apiGroups"}, $group)C= &$in($$r{"resources"}, $res)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1434 | 5 | ▶ | my @rn = @{ ref $r->{resourceNames} eq 'ARRAY' ? $r->{resourceNames} : [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1435 | 5 | ▶ | return 1 unless @rn; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1436 | 2 | ▶ | return defined $name && scalar grep { $_ eq $name } @rn; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
defined $name && scalar grep({$_ eq $name;} @rn)
MC/DC0%0/1
defined $name && scalar grep({$_ eq $name;} @rn)
defined $name
Truth table50%1/2
A
A= defined $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1437 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1438 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1439 | # Bindungen, die fuer wen in einem Namespace gelten: ( [ regel, quelle ] … ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1440 | 42 | ▶ | sub _rules_for { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rules_for: called CC=25 SCAR=43.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1441 | 42 | my ( $k, $who, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1442 | 42 | ▶ | return ( [ { apiGroups => ['*'], resources => ['*'], verbs => ['*'] }, 'cluster-admin' ] ) if $who->{admin}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1443 | 42 | my $crs = _clusterroles($k); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1444 | 42 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1445 | 42 | ▶ | for my $bn ( sort keys %{ $k->{clusterrolebindings} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'clusterrolebindings'} || {}
MC/DC0%0/1
$$k{'clusterrolebindings'} || {}
$$k{'clusterrolebindings'}
Truth table50%1/2
A
A= $$k{'clusterrolebindings'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1446 | 0 | my $b = $k->{clusterrolebindings}{$bn}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1447 | 0 | ▶ | next unless grep { _subject_match( $_, $who, undef ) } @{ $b->{subjects} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$b{'subjects'} || []
MC/DC0%0/1
$$b{'subjects'} || []
$$b{'subjects'}
Truth table0%0/2
A
A= $$b{'subjects'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1448 | 0 | ▶ | my $role = $crs->{ ( $b->{roleRef} || {} )->{name} // '' } or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
($$b{"roleRef"} || {})->{"name"} // ""
$$b{'roleRef'} || {}
MC/DC0%0/1
($$b{"roleRef"} || {})->{"name"} // ""
$$b{'roleRef'}
Truth table0%0/2
A
A= $$b{'roleRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1449 | 0 | ▶ | push @r, map { [ $_, "ClusterRoleBinding/$bn" ] } @{ $role->{rules} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$role{'rules'} || []
MC/DC0%0/1
$$role{'rules'} || []
$$role{'rules'}
Truth table0%0/2
A
A= $$role{'rules'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1450 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1451 | 42 | ▶ | return @r unless defined $ns && length $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $ns and length $ns
MC/DC0%0/2
defined $ns and length $ns
defined $ns
length $ns
Truth table33%1/3
A and B
A= defined $nsB= length $ns
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1452 | 42 | ▶ | my $o = $k->{namespaces}{$ns} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$k{'namespaces'}{$ns} || {}
MC/DC100%1/1
$$k{'namespaces'}{$ns} || {}
$$k{'namespaces'}{$ns}
Truth table100%2/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1453 | 42 | ▶ | for my $bn ( sort keys %{ $o->{rolebindings} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{'rolebindings'} || {}
MC/DC100%1/1
$$o{'rolebindings'} || {}
$$o{'rolebindings'}
Truth table100%2/2
A
A= $$o{'rolebindings'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1454 | 13 | my $b = $o->{rolebindings}{$bn}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1455 | 13 | ▶ | next unless grep { _subject_match( $_, $who, $ns ) } @{ $b->{subjects} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$b{'subjects'} || []
MC/DC0%0/1
$$b{'subjects'} || []
$$b{'subjects'}
Truth table50%1/2
A
A= $$b{'subjects'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1456 | 7 | ▶ | my $rr = $b->{roleRef} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$b{'roleRef'} || {}
MC/DC0%0/1
$$b{'roleRef'} || {}
$$b{'roleRef'}
Truth table50%1/2
A
A= $$b{'roleRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1457 | 7 | ▶ | my $role = ( $rr->{kind} // '' ) eq 'ClusterRole' ? $crs->{ $rr->{name} // '' } : ( $o->{roles} || {} )->{ $rr->{name} // '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%4/8
$$rr{"kind"} // ""
$$rr{"name"} // ""
$$o{'roles'} || {}
$$rr{"name"} // ""
MC/DC0%0/1
$$rr{"kind"} // ""
$$rr{"kind"}
MC/DC0%0/1
$$rr{"name"} // ""
$$rr{"name"}
MC/DC0%0/1
$$o{'roles'} || {}
$$o{'roles'}
MC/DC0%0/1
$$rr{"name"} // ""
$$rr{"name"}
Truth table50%1/2
A
A= $$rr{"kind"}
Truth table50%1/2
A
A= $$rr{"name"}
Truth table50%1/2
A
A= $$o{'roles'}
Truth table50%1/2
A
A= $$rr{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1458 | 7 | ▶ | next unless $role; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1459 | 7 | ▶ | push @r, map { [ $_, "RoleBinding/$bn" ] } @{ $role->{rules} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$role{'rules'} || []
MC/DC0%0/1
$$role{'rules'} || []
$$role{'rules'}
Truth table50%1/2
A
A= $$role{'rules'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1460 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1461 | 42 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1462 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1464 | 42 | ▶ | sub _allowed { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_allowed: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1465 | 42 | my ( $k, $who, $verb, $group, $res, $ns, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1466 | 42 | return scalar grep { _rule_allows( $_->[0], $verb, $group, $res, $name ) } _rules_for( $k, $who, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1467 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1468 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1469 | 33 | ▶ | sub _forbidden { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_forbidden: called CC=4 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1470 | 33 | my ( $who, $verb, $group, $res, $ns, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1471 | 33 | my ($base) = split m{/}, $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1472 | 33 | ▶ | return ( defined $name ? qq{$base "$name"} : $base ) . qq{ is forbidden: User "$who->{user}" cannot $verb resource "$res" in API group "$group" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $ns and length $ns
MC/DC0%0/2
defined $ns and length $ns
defined $ns
length $ns
Truth table33%1/3
A and B
A= defined $nsB= length $ns
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1473 | . ( defined $ns && length $ns ? qq{in the namespace "$ns"} : 'at the cluster scope' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1474 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1475 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1476 | # kubectl auth can-i VERB RESOURCE[/NAME] [--as …] [--as-group …] [-n ns] | --list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1477 | 8 | ▶ | sub _v_auth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_auth: called CC=35 SCAR=54.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1478 | 8 | my ( $k, $a, $o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1479 | 8 | my ( $sub, @r ) = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1480 | 8 | ▶ | if ( ( $sub // '' ) eq 'whoami' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$sub // ""
MC/DC0%0/1
$sub // ""
$sub
Truth table50%1/2
A
A= $sub
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1481 | 0 | ▶ | my $u = ( $o->{f}{as} || [] )->[0] // 'kubernetes-admin'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
($$o{"f"}{"as"} || [])->[0] // "kubernetes-admin"
$$o{'f'}{'as'} || []
MC/DC0%0/1
($$o{"f"}{"as"} || [])->[0] // "kubernetes-admin"
$$o{'f'}{'as'}
Truth table0%0/2
A
A= $$o{'f'}{'as'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1482 | 0 | ▶ | return ( "ATTRIBUTE VALUE\nUsername $u\nGroups [" . ( $o->{f}{as} ? 'system:authenticated' : 'kubeadm:cluster-admins system:authenticated' ) . ']', 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1484 | 0 | ▶ | unless ( ( $sub // '' ) eq 'can-i' ) { push @GAPS, "kubectl auth @$a"; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$sub // ""
MC/DC0%0/1
$sub // ""
$sub
Truth table50%1/2
A
A= $sub
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1485 | 8 | ▶ | my $as = ( $o->{f}{as} || [] )->[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$o{'f'}{'as'} || []
MC/DC0%0/1
$$o{'f'}{'as'} || []
$$o{'f'}{'as'}
Truth table50%1/2
A
A= $$o{'f'}{'as'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1486 | my $who = !defined $as ? { admin => 1, user => 'kubernetes-admin', groups => ['system:masters'] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1487 | : $as =~ /\Asystem:serviceaccount:([^:]+):(.+)\z/ ? _who_sa( $1, $2 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1488 | 8 | ▶ | : { user => $as, groups => [ @{ $o->{f}{'as-group'} || [] }, 'system:authenticated' ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%2/2
$$o{'f'}{'as-group'} || []
MC/DC100%1/1
$$o{'f'}{'as-group'} || []
$$o{'f'}{'as-group'}
Truth table100%2/2
A
A= $$o{'f'}{'as-group'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1489 | 8 | ▶ | my $ns = $o->{all} ? '' : $o->{ns}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1490 | 8 | ▶ | if ( $o->{list} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1491 | 0 | my @rows = ( [ 'Resources', 'Non-Resource URLs', 'Resource Names', 'Verbs' ] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1492 | 0 | for my $x ( _rules_for( $k, $who, $ns ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1493 | 0 | my $r = $x->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1494 | 0 | ▶ | for my $res ( @{ $r->{resources} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$r{'resources'} || []
MC/DC0%0/1
$$r{'resources'} || []
$$r{'resources'}
Truth table0%0/2
A
A= $$r{'resources'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1495 | 0 | ▶ | my @g = @{ $r->{apiGroups} || [''] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$r{'apiGroups'} || ['']
MC/DC0%0/1
$$r{'apiGroups'} || ['']
$$r{'apiGroups'}
Truth table0%0/2
A
A= $$r{'apiGroups'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1496 | 0 | ▶ | push @rows, map { [ ( $_ eq '' || $res eq '*' && $_ eq '*' ? $res : "$res.$_" ), '[]', '[' . join( ' ', @{ $r->{resourceNames} || [] } ) . ']', '[' . join( ' ', @{ $r->{verbs} || [] } ) . ']' ] } @g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/10
$_ eq "" or $res eq "*" and $_ eq "*"
$res eq "*" and $_ eq "*"
$$r{'resourceNames'} || []
$$r{'verbs'} || []
MC/DC0%0/3
$_ eq "" or $res eq "*" and $_ eq "*"
$_ eq ""
$res eq "*"
$_ eq "*"
MC/DC0%0/1
$$r{'resourceNames'} || []
$$r{'resourceNames'}
MC/DC0%0/1
$$r{'verbs'} || []
$$r{'verbs'}
Truth table0%0/4
A or B and C
A= $_ eq ""B= $res eq "*"C= $_ eq "*"
Truth table0%0/2
A
A= $$r{'resourceNames'}
Truth table0%0/2
A
A= $$r{'verbs'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1497 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1498 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1499 | 0 | push @rows, [ 'selfsubjectreviews.authentication.k8s.io', '[]', '[]', '[create]' ], [ 'selfsubjectaccessreviews.authorization.k8s.io', '[]', '[]', '[create]' ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1500 | 0 | return ( _cols(@rows), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1501 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1502 | 8 | my ( $verb, $what, $nm ) = @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1503 | 8 | ▶ | return ( "error: you must specify two arguments: verb resource or a single argument: nonResourceURL", 0 ) unless defined $what; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1504 | 8 | ▶ | ( $what, $nm ) = ( $1, $2 ) if !defined $nm && $what =~ m{\A([^/]+/(?:log|exec|status|scale|portforward|attach|proxy))/([^/]+)\z}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $nm and $what =~ m[\A([^/]+/(?:log|exec|status|scale|portforward|attach|proxy))/([^/]+)\z]
MC/DC0%0/2
not defined $nm and $what =~ m[\A([^/]+/(?:log|exec|status|scale|portforward|attach|proxy))/([^/]+)\z]
not defined $nm
$what =~ m[\A([^/]+/(?:log|exec|status|scale|portforward|attach|proxy))/([^/]+)\z]
Truth table33%1/3
not(A) and B
A= not defined $nmB= $what =~ m[\A([^/]+/(?:log|exec|status|scale|portforward|attach|proxy))/([^/]+)\z]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1505 | 8 | ▶ | ( $what, $nm ) = ( $1, $2 ) if !defined $nm && $what =~ m{\A([^/]+)/([^/]+)\z} && !grep { $2 eq $_ } qw( log exec status scale portforward attach proxy ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not defined $nm and $what =~ m[\A([^/]+)/([^/]+)\z] and not grep({$2 eq $_;} "log", "exec", "status", "scale", "portforward", "attach", "proxy")
not defined $nm and $what =~ m[\A([^/]+)/([^/]+)\z]
MC/DC66%2/3
not defined $nm and $what =~ m[\A([^/]+)/([^/]+)\z] and not grep({$2 eq $_;} "log", "exec", "status", "scale", "portforward", "attach", "proxy")
not defined $nm
$what =~ m[\A([^/]+)/([^/]+)\z]
not grep({$2 eq $_;} "log", "exec", "status", "scale", "portforward", "attach", "proxy")
Truth table75%3/4
not(A) and B and not(C)
A= not defined $nmB= $what =~ m[\A([^/]+)/([^/]+)\z]C= not grep({$2 eq $_;} "log", "exec", "status", "scale", "portforward", "attach", "proxy")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1506 | 8 | my ( $res, $group ) = _resource($what); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1507 | 8 | ▶ | return ( qq{Warning: the server doesn't have a resource type '$what'\n\nno}, 0 ) unless defined $res; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1508 | 8 | ▶ | my $nsx = $CLUSTER{ $KIND{ ( split m{/}, $res )[0] } // '' } || ( split m{/}, $res )[0] =~ /\A(?:nodes|clusterroles|clusterrolebindings|clusterissuers|ingressclasses|storageclasses|namespaces|persistentvolumes)\z/ ? '' : $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""} or (split(m[/], $res, 0))[0] =~ /\A(?:nodes|clusterroles|clusterrolebindings|clusterissuers|ingressclasses|storageclasses|namespaces|persistentvolumes)\z/
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""
MC/DC0%0/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""} or (split(m[/], $res, 0))[0] =~ /\A(?:nodes|clusterroles|clusterrolebindings|clusterissuers|ingressclasses|storageclasses|namespaces|persistentvolumes)\z/
$Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""}
(split(m[/], $res, 0))[0] =~ /\A(?:nodes|clusterroles|clusterrolebindings|clusterissuers|ingressclasses|storageclasses|namespaces|persistentvolumes)\z/
MC/DC0%0/1
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""
$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]}
Truth table33%1/3
A or B
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::CLUSTER{$Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]} // ""}B= (split(m[/], $res, 0))[0] =~ /\A(?:nodes|clusterroles|clusterrolebindings|clusterissuers|ingressclasses|storageclasses|namespaces|persistentvolumes)\z/
Truth table50%1/2
A
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::KIND{(split(m[/], $res, 0))[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1509 | 8 | ▶ | return _allowed( $k, $who, $verb, $group eq '*' ? '' : $group, $res, $nsx, $nm ) ? ( 'yes', 1 ) : ( 'no', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1510 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1512 | 226 | ▶ | sub _sa_exists { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_sa_exists: called CC=5 SCAR=16.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1513 | 226 | my ( $k, $ns, $sa ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1514 | 226 | ▶ | return 1 if !defined $sa || $sa eq 'default'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $sa or $sa eq "default"
MC/DC50%1/2
not defined $sa or $sa eq "default"
not defined $sa
$sa eq "default"
Truth table66%2/3
not(A) or B
A= not defined $saB= $sa eq "default"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1515 | 41 | ▶ | return exists( ( ( $k->{namespaces}{$ns} || {} )->{serviceaccounts} || {} )->{$sa} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{'namespaces'}{$ns} || {})->{'serviceaccounts'} || {}
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{'serviceaccounts'} || {}
$$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1516 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1518 | # erste nicht erlaubte Anforderung eines Containers (needs_rbac) -> Meldung oder undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1519 | 199 | ▶ | sub _rbac_denied { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rbac_denied: called CC=9 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1520 | 199 | my ( $k, $ns, $tpl, $c ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1521 | 199 | ▶ | my $sa = $tpl->{service_account} // 'default'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$tpl{"service_account"} // "default"
MC/DC100%1/1
$$tpl{"service_account"} // "default"
$$tpl{"service_account"}
Truth table100%2/2
A
A= $$tpl{"service_account"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1522 | 199 | my $who = _who_sa( $ns, $sa ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1523 | 199 | ▶ | for my $n ( @{ $c->{needs_rbac} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$c{'needs_rbac'} || []
MC/DC100%1/1
$$c{'needs_rbac'} || []
$$c{'needs_rbac'}
Truth table100%2/2
A
A= $$c{'needs_rbac'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1524 | 34 | my $res = $n->{resource}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1525 | 34 | ▶ | my $group = $n->{group} // $GROUP{ ( split m{/}, $res )[0] } // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
($$n{"group"} // $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{(split(m[/], $res, 0))[0]}) // ""
$$n{"group"} // $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{(split(m[/], $res, 0))[0]}
MC/DC0%0/2
($$n{"group"} // $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{(split(m[/], $res, 0))[0]}) // ""
$$n{"group"}
$Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{(split(m[/], $res, 0))[0]}
Truth table33%1/3
A // B
A= $$n{"group"}B= $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{(split(m[/], $res, 0))[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1526 | 34 | ▶ | my $nsx = exists $n->{namespace} ? $n->{namespace} // '' : $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$$n{"namespace"} // ""
MC/DC0%0/1
$$n{"namespace"} // ""
$$n{"namespace"}
Truth table0%0/2
A
A= $$n{"namespace"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1527 | 34 | ▶ | next if _allowed( $k, $who, $n->{verb}, $group, $res, $nsx, $n->{name} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1528 | 33 | return _forbidden( $who, $n->{verb}, $group, $res, $nsx, $n->{name} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1529 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1530 | 166 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1531 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1532 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1533 | # --- Ingress -------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1535 | 5 | ▶ | sub _gen_objs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_gen_objs: called CC=5 SCAR=17.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1536 | 5 | my ( $k, $kind, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1537 | 5 | ▶ | return $k->{$kind} || {} if $GEN{$kind}[2]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$k{$kind} || {}
MC/DC0%0/1
$$k{$kind} || {}
$$k{$kind}
Truth table50%1/2
A
A= $$k{$kind}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1538 | 4 | ▶ | return ( ( $k->{namespaces}{$ns} || {} )->{$kind} ) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{'namespaces'}{$ns} || {})->{$kind} || {}
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{$kind} || {}
$$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1539 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1540 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1541 | 26 | ▶ | sub _ingress_class { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ingress_class: called CC=10 SCAR=40.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1542 | 26 | my ( $k, $ing ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1543 | 26 | ▶ | my $c = ( $ing->{spec} || {} )->{ingressClassName} // ( ( $ing->{metadata} || {} )->{annotations} || {} )->{'kubernetes.io/ingress.class'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition22%2/9
($$ing{"spec"} || {})->{"ingressClassName"} // (($$ing{"metadata"} || {})->{"annotations"} || {})->{"kubernetes.io/ingress.class"}
$$ing{'spec'} || {}
($$ing{'metadata'} || {})->{'annotations'} || {}
$$ing{'metadata'} || {}
MC/DC0%0/2
($$ing{"spec"} || {})->{"ingressClassName"} // (($$ing{"metadata"} || {})->{"annotations"} || {})->{"kubernetes.io/ingress.class"}
$$ing{'spec'}
$$ing{'metadata'}
Truth table33%1/3
A // B
A= $$ing{'spec'}B= $$ing{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1544 | 26 | ▶ | return $c if defined $c; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1545 | 0 | ▶ | my $ics = $k->{ingressclasses} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$k{'ingressclasses'} || {}
MC/DC0%0/1
$$k{'ingressclasses'} || {}
$$k{'ingressclasses'}
Truth table0%0/2
A
A= $$k{'ingressclasses'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1546 | 0 | ▶ | my ($d) = grep { ( ( ( $ics->{$_}{metadata} || {} )->{annotations} || {} )->{'ingressclass.kubernetes.io/is-default-class'} // '' ) eq 'true' } sort keys %$ics; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
(($$ics{$_}{"metadata"} || {})->{"annotations"} || {})->{"ingressclass.kubernetes.io/is-default-class"} // ""
($$ics{$_}{'metadata'} || {})->{'annotations'} || {}
$$ics{$_}{'metadata'} || {}
MC/DC0%0/1
(($$ics{$_}{"metadata"} || {})->{"annotations"} || {})->{"ingressclass.kubernetes.io/is-default-class"} // ""
$$ics{$_}{'metadata'}
Truth table0%0/2
A
A= $$ics{$_}{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1547 | 0 | return $d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1548 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1549 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1550 | # behandelt der Ingress-Controller des Clusters diese Klasse? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1551 | 48 | ▶ | sub _handled { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_handled: called CC=8 SCAR=24.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1552 | 48 | my ( $k, $cls ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1553 | 48 | ▶ | my $ctl = ( $k->{ingress} || {} )->{controller} // return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{"ingress"} || {})->{"controller"} // (return 0)
$$k{'ingress'} || {}
MC/DC0%0/1
($$k{"ingress"} || {})->{"controller"} // (return 0)
$$k{'ingress'}
Truth table50%1/2
A
A= $$k{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1554 | 48 | ▶ | my $ic = ( $k->{ingressclasses} || {} )->{ $cls // '' } or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$k{'ingressclasses'} || {}
$cls // ""
MC/DC0%0/1
$$k{'ingressclasses'} || {}
$$k{'ingressclasses'}
MC/DC0%0/1
$cls // ""
$cls
Truth table50%1/2
A
A= $$k{'ingressclasses'}
Truth table50%1/2
A
A= $cls
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1555 | 48 | ▶ | return ( ( $ic->{spec} || {} )->{controller} // '' ) eq $ctl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ic{"spec"} || {})->{"controller"} // ""
$$ic{'spec'} || {}
MC/DC0%0/1
($$ic{"spec"} || {})->{"controller"} // ""
$$ic{'spec'}
Truth table50%1/2
A
A= $$ic{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1556 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1557 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1558 | 22 | ▶ | sub _host_match { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_host_match: called CC=5 SCAR=22.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1559 | 22 | my ( $pat, $host ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1560 | 22 | ▶ | return 1 unless defined $pat && length $pat; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pat and length $pat
MC/DC0%0/2
defined $pat and length $pat
defined $pat
length $pat
Truth table33%1/3
A and B
A= defined $patB= length $pat
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1561 | 22 | ▶ | return lc $pat eq lc $host unless $pat =~ /\A\*\.(.+)\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1562 | 0 | my $d = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1563 | 0 | ▶ | return $host =~ /\A[^.]+\.\Q$d\E\z/i ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1564 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1565 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1566 | 71 | ▶ | sub _all_ingresses { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_all_ingresses: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1567 | 71 | my ($k) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1568 | 71 | my @i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1569 | 71 | ▶ | for my $ns ( sort keys %{ $k->{namespaces} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'namespaces'} || {}
MC/DC0%0/1
$$k{'namespaces'} || {}
$$k{'namespaces'}
Truth table50%1/2
A
A= $$k{'namespaces'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1570 | 213 | ▶ | my $m = $k->{namespaces}{$ns}{ingresses} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$k{'namespaces'}{$ns}{'ingresses'} || {}
MC/DC100%1/1
$$k{'namespaces'}{$ns}{'ingresses'} || {}
$$k{'namespaces'}{$ns}{'ingresses'}
Truth table100%2/2
A
A= $$k{'namespaces'}{$ns}{'ingresses'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1571 | 213 | push @i, map { [ $ns, $_, $m->{$_} ] } sort keys %$m; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1572 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1573 | 71 | return @i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1574 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1575 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1576 | # Wohin fuehrt host+path? -> ( ns, ingress, backend ) oder () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1577 | 7 | ▶ | sub _ingress_route { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ingress_route: called CC=23 SCAR=34.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1578 | 7 | my ( $k, $host, $path ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1579 | 7 | my @cand; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1580 | 7 | for my $x ( _all_ingresses($k) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1581 | 7 | my ( $ns, $n, $ing ) = @$x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1582 | 7 | ▶ | next unless _handled( $k, _ingress_class( $k, $ing ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1583 | 6 | ▶ | for my $r ( @{ ( $ing->{spec} || {} )->{rules} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'spec'} || {})->{'rules'} || []
$$ing{'spec'} || {}
MC/DC0%0/1
($$ing{'spec'} || {})->{'rules'} || []
$$ing{'spec'}
Truth table50%1/2
A
A= $$ing{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1584 | 6 | ▶ | next unless _host_match( $r->{host}, $host ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1585 | 5 | ▶ | my $exact = defined $r->{host} && $r->{host} !~ /\*/ ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $$r{"host"} and not $$r{"host"} =~ /\*/
MC/DC0%0/2
defined $$r{"host"} and not $$r{"host"} =~ /\*/
defined $$r{"host"}
not $$r{"host"} =~ /\*/
Truth table33%1/3
A and not(B)
A= defined $$r{"host"}B= not $$r{"host"} =~ /\*/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1586 | 5 | ▶ | for my $p ( @{ ( $r->{http} || {} )->{paths} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$r{'http'} || {})->{'paths'} || []
$$r{'http'} || {}
MC/DC0%0/1
($$r{'http'} || {})->{'paths'} || []
$$r{'http'}
Truth table50%1/2
A
A= $$r{'http'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1587 | 10 | ▶ | my $pp = $p->{path} // '/'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$p{"path"} // "/"
MC/DC0%0/1
$$p{"path"} // "/"
$$p{"path"}
Truth table50%1/2
A
A= $$p{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1588 | 10 | ▶ | my $t = $p->{pathType} // 'ImplementationSpecific'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$p{"pathType"} // "ImplementationSpecific"
MC/DC0%0/1
$$p{"pathType"} // "ImplementationSpecific"
$$p{"pathType"}
Truth table50%1/2
A
A= $$p{"pathType"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1589 | 10 | ▶ | my $m = $t eq 'Exact' ? ( $path eq $pp ? 100000 : 0 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition100%6/6
$pp eq "/" or $path eq $pp or $path =~ m[\A\Q${\($pp =~ s[/\z][]r);}\E/]
$pp eq "/" or $path eq $pp
MC/DC100%3/3
$pp eq "/" or $path eq $pp or $path =~ m[\A\Q${\($pp =~ s[/\z][]r);}\E/]
$pp eq "/"
$path eq $pp
$path =~ m[\A\Q${\($pp =~ s[/\z][]r);}\E/]
Truth table100%4/4
A or B or C
A= $pp eq "/"B= $path eq $ppC= $path =~ m[\A\Q${\($pp =~ s[/\z][]r);}\E/]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1590 | 4 | ▶ | : $t eq 'Prefix' ? ( $pp eq '/' || $path eq $pp || $path =~ m{\A\Q${\( $pp =~ s{/\z}{}r )}\E/} ? 1 + length $pp : 0 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1591 | : ( index( $path, $pp ) == 0 ? 1 + length $pp : 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1592 | 10 | ▶ | push @cand, [ $m + 1000000 * $exact, $ns, $n, $p->{backend} ] if $m; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1593 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1594 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1595 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1596 | 7 | my ($best) = sort { $b->[0] <=> $a->[0] } @cand; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1597 | 7 | ▶ | return $best ? @$best[ 1 .. 3 ] : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1599 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1600 | # Zertifikat des Ingress-Controllers fuer einen Host: ( ns, secret ) oder () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1601 | 12 | ▶ | sub _tls_for_host { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tls_for_host: called CC=8 SCAR=21.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1602 | 12 | my ( $k, $host ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1603 | 12 | for my $x ( _all_ingresses($k) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1604 | 12 | my ( $ns, $n, $ing ) = @$x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1605 | 12 | ▶ | next unless _handled( $k, _ingress_class( $k, $ing ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1606 | 11 | ▶ | for my $t ( @{ ( $ing->{spec} || {} )->{tls} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'} || {}
MC/DC0%0/1
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'}
Truth table50%1/2
A
A= $$ing{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1607 | 11 | ▶ | return ( $ns, $t->{secretName}, $n ) if grep { _host_match( $_, $host ) } @{ $t->{hosts} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$t{'hosts'} || []
MC/DC0%0/1
$$t{'hosts'} || []
$$t{'hosts'}
Truth table50%1/2
A
A= $$t{'hosts'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1608 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1609 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1610 | 4 | return (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1611 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1612 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1613 | # Pseudo-PEM: Nutzlast "subject=…;san=a,b;issuer=…;trusted=1" in Base64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1614 | 15 | ▶ | sub _pem { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pem: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1615 | 15 | my (%c) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1616 | 15 | return "-----BEGIN CERTIFICATE-----\n" . MIME::Base64::encode_base64( join ';', map {"$_=$c{$_}"} sort keys %c ) . "-----END CERTIFICATE-----\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1617 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1618 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1619 | 9 | ▶ | sub _cert_info { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cert_info: called CC=5 SCAR=17.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1620 | 9 | my ($pem) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1621 | 9 | ▶ | my ($b) = ( $pem // '' ) =~ /-----BEGIN CERTIFICATE-----\s*(.*?)\s*-----END/s or return undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$pem // ""
MC/DC0%0/1
$pem // ""
$pem
Truth table50%1/2
A
A= $pem
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1622 | 9 | my $t = MIME::Base64::decode_base64($b); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1623 | 9 | ▶ | return undef unless $t =~ /san=/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1624 | 9 | my %c = map { split /=/, $_, 2 } split /;/, $t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1625 | 9 | ▶ | return { %c, san => [ split /,/, $c{san} // '' ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$c{"san"} // ""
MC/DC0%0/1
$c{"san"} // ""
$c{"san"}
Truth table50%1/2
A
A= $c{"san"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1626 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1627 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1628 | # Was ein Client von https://host sieht: ( ok, curl-code, meldung ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1629 | 8 | ▶ | sub _tls_check { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tls_check: called CC=8 SCAR=20.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1630 | 8 | my ( $k, $host, $insecure ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1631 | 8 | my ( $ns, $sec ) = _tls_for_host( $k, $host ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1632 | 8 | ▶ | my $s = defined $sec ? _secret( $k, $ns, $sec ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1633 | 8 | ▶ | my $info = $s && defined $s->{'tls.crt'} ? _cert_info( $s->{'tls.crt'} ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$s and defined $$s{"tls.crt"}
MC/DC50%1/2
$s and defined $$s{"tls.crt"}
$s
defined $$s{"tls.crt"}
Truth table66%2/3
A and B
A= $sB= defined $$s{"tls.crt"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1634 | 8 | ▶ | return (1) if $insecure; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1635 | 3 | ▶ | return ( 0, 60, 'SSL certificate problem: self-signed certificate' ) unless $info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1636 | 1 | ▶ | return ( 0, 60, "SSL: no alternative certificate subject name matches target host name '$host'" ) unless grep { _host_match( $_, $host ) } @{ $info->{san} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1637 | 1 | ▶ | return ( 0, 60, 'SSL certificate problem: unable to get local issuer certificate' ) unless $info->{trusted}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1638 | 1 | return (1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1639 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1640 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1641 | 5 | my %HTTP = ( 200 => 'OK', 308 => 'Permanent Redirect', 404 => 'Not Found', 502 => 'Bad Gateway', 503 => 'Service Temporarily Unavailable' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1642 | 4 | ▶ | sub _nginx_page { my ($c) = @_; return "<html>\n<head><title>$c $HTTP{$c}</title></head>\n<body>\n<center><h1>$c $HTTP{$c}</h1></center>\n<hr><center>nginx</center>\n</body>\n</html>" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_nginx_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1643 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1644 | # Antwort des Ingress-Controllers: ( http-code, rumpf ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1645 | 7 | ▶ | sub _ingress_http { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ingress_http: called CC=20 SCAR=33.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1646 | 7 | my ( $k, $scheme, $host, $path ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1647 | 7 | my ( $ns, $ing, $be ) = _ingress_route( $k, $host, $path ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1648 | 7 | ▶ | return ( 404, _nginx_page(404) ) unless $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1649 | 5 | ▶ | return ( 308, _nginx_page(308) ) if $scheme eq 'http' && _tls_for_host( $k, $host ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$scheme eq "http" and _tls_for_host($k, $host)
MC/DC50%1/2
$scheme eq "http" and _tls_for_host($k, $host)
$scheme eq "http"
_tls_for_host($k, $host)
Truth table66%2/3
A and B
A= $scheme eq "http"B= _tls_for_host($k, $host)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1650 | 4 | ▶ | my $sb = ( $be || {} )->{service} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($be || {})->{'service'} || {}
$be || {}
MC/DC0%0/1
($be || {})->{'service'} || {}
$be
Truth table50%1/2
A
A= $be
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1651 | 4 | ▶ | my $svc = ( $k->{namespaces}{$ns}{services} || {} )->{ $sb->{name} // '' } or return ( 503, _nginx_page(503) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$$k{'namespaces'}{$ns}{'services'} || {}
$$sb{"name"} // ""
MC/DC0%0/1
$$k{'namespaces'}{$ns}{'services'} || {}
$$k{'namespaces'}{$ns}{'services'}
MC/DC0%0/1
$$sb{"name"} // ""
$$sb{"name"}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}{'services'}
Truth table50%1/2
A
A= $$sb{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1652 | 3 | ▶ | my $want = $sb->{port} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$sb{'port'} || {}
MC/DC0%0/1
$$sb{'port'} || {}
$$sb{'port'}
Truth table50%1/2
A
A= $$sb{'port'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1653 | 3 | ▶ | my ($sp) = grep { defined $want->{number} ? $_->{port} == $want->{number} : ( $_->{name} // '' ) eq ( $want->{name} // '' ) } @{ $svc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$$_{"name"} // ""
$$want{"name"} // ""
$$svc{'ports'} || []
MC/DC0%0/1
$$_{"name"} // ""
$$_{"name"}
MC/DC0%0/1
$$want{"name"} // ""
$$want{"name"}
MC/DC0%0/1
$$svc{'ports'} || []
$$svc{'ports'}
Truth table50%1/2
A
A= $$_{"name"}
Truth table50%1/2
A
A= $$want{"name"}
Truth table50%1/2
A
A= $$svc{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1654 | 3 | ▶ | return ( 503, _nginx_page(503) ) unless $sp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1655 | 3 | ▶ | my @e = _endpoints( $k, $ns, $sb->{name} ) or return ( 503, _nginx_page(503) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1656 | 3 | my ($dc) = @{ $e[0]{template}{containers} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1657 | 3 | ▶ | return ( 502, _nginx_page(502) ) unless grep { $_ == $sp->{target} } @{ $dc->{listens} || $dc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
$$dc{'listens'} || $$dc{'ports'} || []
$$dc{"listens"} or $$dc{"ports"}
MC/DC0%0/2
$$dc{'listens'} || $$dc{'ports'} || []
$$dc{"listens"}
$$dc{"ports"}
Truth table33%1/3
A or B
A= $$dc{"listens"}B= $$dc{"ports"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1658 | 3 | ▶ | return ( 200, $dc->{http_body} // '{"status":"ok"}' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dc{"http_body"} // "{\"status\":\"ok\"}"
MC/DC0%0/1
$$dc{"http_body"} // "{\"status\":\"ok\"}"
$$dc{"http_body"}
Truth table50%1/2
A
A= $$dc{"http_body"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1659 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1660 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1661 | 16 | ▶ | sub _public_host { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_public_host: called CC=9 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1662 | 16 | my ( $k, $host ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1663 | 16 | ▶ | return 0 unless $k->{ingress}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1664 | 12 | ▶ | return 1 if $host eq ( $k->{ingress}{address} // '' ) || exists( ( $k->{dns} || {} )->{$host} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition71%5/7
$host eq ($$k{"ingress"}{"address"} // "") or exists(($$k{"dns"} || {})->{$host})
$$k{"ingress"}{"address"} // ""
$$k{'dns'} || {}
MC/DC0%0/2
$host eq ($$k{"ingress"}{"address"} // "") or exists(($$k{"dns"} || {})->{$host})
$host eq ($$k{"ingress"}{"address"} // "")
$$k{'dns'}
MC/DC0%0/1
$$k{"ingress"}{"address"} // ""
$$k{"ingress"}{"address"}
Truth table66%2/3
A or B
A= $host eq ($$k{"ingress"}{"address"} // "")B= $$k{'dns'}
Truth table50%1/2
A
A= $$k{"ingress"}{"address"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1665 | 1 | ▶ | return scalar grep { my $i = $_->[2]; grep { defined $_->{host} && _host_match( $_->{host}, $host ) } @{ ( $i->{spec} || {} )->{rules} || [] } } _all_ingresses($k); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition42%3/7
defined $$_{'host'} && _host_match($$_{'host'}, $host)
($$i{'spec'} || {})->{'rules'} || []
$$i{'spec'} || {}
MC/DC0%0/2
defined $$_{'host'} && _host_match($$_{'host'}, $host)
defined $$_{'host'}
_host_match($$_{'host'}, $host)
MC/DC0%0/1
($$i{'spec'} || {})->{'rules'} || []
$$i{'spec'}
Truth table33%1/3
A && B
A= defined $$_{'host'}B= _host_match($$_{'host'}, $host)
Truth table50%1/2
A
A= $$i{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1666 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1667 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1668 | # curl|wget gegen den Ingress-Controller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1669 | 9 | ▶ | sub _client_ingress { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_client_ingress: called CC=35 SCAR=51.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1670 | 9 | my ( $k, $tool, $cmd, $scheme, $host, $path ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1671 | 9 | my ( %f, $w ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1672 | 9 | my @c = @$cmd[ 1 .. $#$cmd ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1673 | 9 | ▶ | while (@c) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1674 | 19 | my $x = shift @c; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1675 | 19 | ▶ | if ( $tool eq 'curl' && $x =~ /\A-([a-zA-Z]+)\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 8 branches
Condition66%2/3
$tool eq "curl" and $x =~ /\A-([a-zA-Z]+)\z/
MC/DC50%1/2
$tool eq "curl" and $x =~ /\A-([a-zA-Z]+)\z/
$tool eq "curl"
$x =~ /\A-([a-zA-Z]+)\z/
Truth table66%2/3
A and B
A= $tool eq "curl"B= $x =~ /\A-([a-zA-Z]+)\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1676 | 10 | my $fl = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1677 | 10 | $f{$_} = 1 for split //, $fl; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1678 | 10 | ▶ | if ( $fl =~ /[owHmXdA]\z/ ) { my $v = shift @c; $w = $v if $fl =~ /w\z/ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1679 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1680 | 0 | ▶ | elsif ( $x eq '--insecure' || $x eq '--no-check-certificate' ) { $f{k} = 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$x eq "--insecure" or $x eq "--no-check-certificate"
MC/DC0%0/2
$x eq "--insecure" or $x eq "--no-check-certificate"
$x eq "--insecure"
$x eq "--no-check-certificate"
Truth table33%1/3
A or B
A= $x eq "--insecure"B= $x eq "--no-check-certificate"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1681 | 0 | elsif ( $x eq '--fail' ) { $f{f} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1682 | 0 | elsif ( $x eq '--location' ) { $f{L} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1683 | 0 | elsif ( $x eq '--head' ) { $f{I} = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1684 | 0 | ▶ | elsif ( $x =~ /\A--(?:write-out|output|header|max-time|connect-timeout|resolve|user-agent)\z/ ) { my $v = shift @c; $w = $v if $x eq '--write-out' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1685 | 0 | elsif ( $x =~ /\A--write-out=(.*)\z/s ) { $w = $1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1686 | 0 | ▶ | elsif ( $tool eq 'wget' && $x =~ /\A-[qOST]+\z/ && $x =~ /[OT]\z/ ) { shift @c } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$tool eq "wget" and $x =~ /\A-[qOST]+\z/ and $x =~ /[OT]\z/
$tool eq "wget" and $x =~ /\A-[qOST]+\z/
MC/DC0%0/3
$tool eq "wget" and $x =~ /\A-[qOST]+\z/ and $x =~ /[OT]\z/
$tool eq "wget"
$x =~ /\A-[qOST]+\z/
$x =~ /[OT]\z/
Truth table25%1/4
A and B and C
A= $tool eq "wget"B= $x =~ /\A-[qOST]+\z/C= $x =~ /[OT]\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1687 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1688 | 9 | for my $hop ( 1 .. 3 ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1689 | 9 | ▶ | if ( $scheme eq 'https' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1690 | 8 | my ( $ok, $code, $msg ) = _tls_check( $k, $host, $f{k} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1691 | 8 | ▶ | unless ($ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1692 | 2 | ▶ | return ( "curl: ($code) $msg\nMore details here: https://curl.se/docs/sslcerts.html", 0 ) if $tool eq 'curl'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1693 | 0 | ▶ | return ( "Connecting to $host (" . ( ( $k->{ingress} || {} )->{address} // '' ) . ":443)\nssl_client: $host: certificate verification failed: " . ( $msg =~ s/\ASSL(?: certificate problem)?:\s*//r ) . "\nwget: error getting response: Connection reset by peer", 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'} || {}
MC/DC0%0/1
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'}
Truth table0%0/2
A
A= $$k{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1694 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1695 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1696 | 7 | my ( $st, $body ) = _ingress_http( $k, $scheme, $host, $path ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1697 | 0 | ▶ | if ( $st == 308 && ( $f{L} || $tool eq 'wget' ) ) { $scheme = 'https'; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$st == 308 and $f{"L"} || $tool eq "wget"
$f{"L"} or $tool eq "wget"
MC/DC0%0/3
$st == 308 and $f{"L"} || $tool eq "wget"
$st == 308
$f{"L"}
$tool eq "wget"
Truth table50%2/4
A and B or C
A= $st == 308B= $f{"L"}C= $tool eq "wget"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1698 | 7 | ▶ | return ( $st == 200 ? ( $body, 1 ) : ( "wget: server returned error: HTTP/1.1 $st $HTTP{$st}", 0 ) ) if $tool eq 'wget'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1699 | 7 | ▶ | return ( "curl: (22) The requested URL returned error: $st", 0 ) if $f{f} && $st >= 400; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$f{"f"} and $st >= 400
MC/DC0%0/2
$f{"f"} and $st >= 400
$f{"f"}
$st >= 400
Truth table33%1/3
A and B
A= $f{"f"}B= $st >= 400
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1700 | 7 | ▶ | my $out = $f{I} ? "HTTP/1.1 $st $HTTP{$st}\nContent-Type: text/html\n" . ( $st == 308 ? "Location: https://$host$path\n" : '' ) : $body; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1701 | 7 | ▶ | $out = '' if $f{o}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1702 | 0 | ▶ | if ( defined $w ) { ( my $ww = $w ) =~ s/%\{http_code\}/$st/g; $ww =~ s/\\n/\n/g; $out .= $ww } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1703 | 7 | return ( $out =~ s/\n\z//r, 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1704 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1705 | 0 | return ( 'curl: (47) Maximum (3) redirects followed', 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1706 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1707 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1708 | # Hinweise des Ingress-Controllers (wie im Log von ingress-nginx) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1709 | 2 | ▶ | sub _ingress_log { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ingress_log: called CC=34 SCAR=43.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1710 | 2 | my ($k) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1711 | 2 | my @l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1712 | 2 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1713 | 2 | ▶ | my $ts = sub { sprintf 'W1024 08:%02d:%02d.%06d 7', 10 + $i, ( 7 * ++$i ) % 60, 118223 + 977 * $i }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1714 | 2 | for my $x ( _all_ingresses($k) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1715 | 2 | my ( $ns, $n, $ing ) = @$x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1716 | 2 | my $cls = _ingress_class( $k, $ing ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1717 | 2 | ▶ | unless ( _handled( $k, $cls ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1718 | 1 | ▶ | push @l, $ts->() =~ s/\AW/I/r . qq{ store.go:440] "Ignoring ingress because of error while validating ingress class" ingress="$ns/$n" error="} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1719 | . ( defined $cls ? qq{no object matching key \\"$cls\\" in local store} : 'ingress does not contain a valid IngressClass' ) . '"'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1720 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1721 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1722 | 1 | ▶ | for my $r ( @{ ( $ing->{spec} || {} )->{rules} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'spec'} || {})->{'rules'} || []
$$ing{'spec'} || {}
MC/DC0%0/1
($$ing{'spec'} || {})->{'rules'} || []
$$ing{'spec'}
Truth table50%1/2
A
A= $$ing{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1723 | 1 | ▶ | for my $p ( @{ ( $r->{http} || {} )->{paths} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$r{'http'} || {})->{'paths'} || []
$$r{'http'} || {}
MC/DC0%0/1
($$r{'http'} || {})->{'paths'} || []
$$r{'http'}
Truth table50%1/2
A
A= $$r{'http'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1724 | 2 | ▶ | my $sb = ( $p->{backend} || {} )->{service} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$p{'backend'} || {})->{'service'} || {}
$$p{'backend'} || {}
MC/DC0%0/1
($$p{'backend'} || {})->{'service'} || {}
$$p{'backend'}
Truth table50%1/2
A
A= $$p{'backend'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1725 | 2 | ▶ | my $sn = $sb->{name} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$sb{"name"} // ""
MC/DC0%0/1
$$sb{"name"} // ""
$$sb{"name"}
Truth table50%1/2
A
A= $$sb{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1726 | 2 | ▶ | my $svc = ( $k->{namespaces}{$ns}{services} || {} )->{$sn}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'namespaces'}{$ns}{'services'} || {}
MC/DC0%0/1
$$k{'namespaces'}{$ns}{'services'} || {}
$$k{'namespaces'}{$ns}{'services'}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}{'services'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1727 | 2 | ▶ | if ( !$svc ) { push @l, $ts->() . qq{ controller.go:1214] Error obtaining Endpoints for Service "$ns/$sn": no object matching key "$ns/$sn" in local store}; next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1728 | 1 | ▶ | my $want = $sb->{port} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$sb{'port'} || {}
MC/DC0%0/1
$$sb{'port'} || {}
$$sb{'port'}
Truth table50%1/2
A
A= $$sb{'port'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1729 | 1 | ▶ | my ($sp) = grep { defined $want->{number} ? $_->{port} == $want->{number} : ( $_->{name} // '' ) eq ( $want->{name} // '' ) } @{ $svc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$$_{"name"} // ""
$$want{"name"} // ""
$$svc{'ports'} || []
MC/DC0%0/1
$$_{"name"} // ""
$$_{"name"}
MC/DC0%0/1
$$want{"name"} // ""
$$want{"name"}
MC/DC0%0/1
$$svc{'ports'} || []
$$svc{'ports'}
Truth table50%1/2
A
A= $$_{"name"}
Truth table50%1/2
A
A= $$want{"name"}
Truth table50%1/2
A
A= $$svc{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1730 | 0 | ▶ | if ( !$sp ) { push @l, $ts->() . qq{ controller.go:1196] Service "$ns/$sn" does not have any port matching } . ( $want->{number} // $want->{name} // '' ); next } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
($$want{"number"} // $$want{"name"}) // ""
$$want{"number"} // $$want{"name"}
MC/DC0%0/2
($$want{"number"} // $$want{"name"}) // ""
$$want{"number"}
$$want{"name"}
Truth table0%0/3
A // B
A= $$want{"number"}B= $$want{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1731 | 1 | ▶ | push @l, $ts->() . qq{ controller.go:1214] Service "$ns/$sn" does not have any active Endpoint.} unless _endpoints( $k, $ns, $sn ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1732 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1733 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1734 | 1 | ▶ | for my $t ( @{ ( $ing->{spec} || {} )->{tls} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'} || {}
MC/DC0%0/1
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'}
Truth table50%1/2
A
A= $$ing{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1735 | 1 | ▶ | my $sec = $t->{secretName} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$t{"secretName"} // ""
MC/DC0%0/1
$$t{"secretName"} // ""
$$t{"secretName"}
Truth table50%1/2
A
A= $$t{"secretName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1736 | 1 | my $s = _secret( $k, $ns, $sec ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1737 | 1 | ▶ | if ( !$s || !defined $s->{'tls.crt'} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$s and defined $$s{"tls.crt"}
MC/DC0%0/2
$s and defined $$s{"tls.crt"}
$s
defined $$s{"tls.crt"}
Truth table33%1/3
A and B
A= $sB= defined $$s{"tls.crt"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1738 | 0 | push @l, $ts->() . qq{ backend_ssl.go:47] Error obtaining X.509 certificate: no object matching key "$ns/$sec" in local store}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1739 | $ts->() . qq{ controller.go:1418] Error getting SSL certificate "$ns/$sec": local SSL certificate $ns/$sec was not found. Using default certificate}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1740 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1741 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1742 | 1 | ▶ | my $info = _cert_info( $s->{'tls.crt'} ) or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1743 | 1 | ▶ | for my $h ( @{ $t->{hosts} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$t{'hosts'} || []
MC/DC0%0/1
$$t{'hosts'} || []
$$t{'hosts'}
Truth table50%1/2
A
A= $$t{'hosts'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1744 | push @l, $ts->() . qq{ controller.go:1442] Unexpected error validating SSL certificate "$ns/$sec" for server "$h": x509: certificate is valid for } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1745 | 0 | ▶ | . join( ', ', @{ $info->{san} } ) . ", not $h" unless grep { _host_match( $_, $h ) } @{ $info->{san} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1746 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1747 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1748 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1749 | 2 | return @l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1750 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1751 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1752 | # --- cert-manager --------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1753 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1754 | 39 | ▶ | sub _cm_ns { my ($k) = @_; return ( $k->{cert_manager} || {} )->{namespace} // 'cert-manager' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cm_ns: called CC=3 SCAR=12.0
Condition50%2/4
($$k{"cert_manager"} || {})->{"namespace"} // "cert-manager"
$$k{'cert_manager'} || {}
MC/DC0%0/1
($$k{"cert_manager"} || {})->{"namespace"} // "cert-manager"
$$k{'cert_manager'}
Truth table50%1/2
A
A= $$k{'cert_manager'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1755 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1756 | 5 | our @ACME = ( 'https://acme-v02.api.letsencrypt.org/directory', 'https://acme-staging-v02.api.letsencrypt.org/directory' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1757 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1758 | # Certificates eines Namespace: gespeicherte und die aus Ingress-Annotationen (ingress-shim) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1759 | 49 | ▶ | sub _certs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_certs: called CC=14 SCAR=29.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1760 | 49 | my ( $k, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1761 | 49 | ▶ | my %c = %{ ( ( $k->{namespaces}{$ns} || {} )->{certificates} ) || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%3/4
($$k{'namespaces'}{$ns} || {})->{'certificates'} || {}
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{'certificates'} || {}
$$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1762 | 49 | for my $x ( grep { $_->[0] eq $ns } _all_ingresses($k) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1763 | 37 | my ( undef, $n, $ing ) = @$x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1764 | 37 | ▶ | my $an = ( $ing->{metadata} || {} )->{annotations} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'metadata'} || {})->{'annotations'} || {}
$$ing{'metadata'} || {}
MC/DC0%0/1
($$ing{'metadata'} || {})->{'annotations'} || {}
$$ing{'metadata'}
Truth table50%1/2
A
A= $$ing{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1765 | my ( $kind, $iss ) = defined $an->{'cert-manager.io/cluster-issuer'} ? ( 'ClusterIssuer', $an->{'cert-manager.io/cluster-issuer'} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1766 | 37 | ▶ | : defined $an->{'cert-manager.io/issuer'} ? ( 'Issuer', $an->{'cert-manager.io/issuer'} ) : next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1767 | 37 | ▶ | for my $t ( @{ ( $ing->{spec} || {} )->{tls} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'} || {}
MC/DC0%0/1
($$ing{'spec'} || {})->{'tls'} || []
$$ing{'spec'}
Truth table50%1/2
A
A= $$ing{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1768 | 37 | ▶ | next unless defined $t->{secretName}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1769 | $c{ $t->{secretName} } //= { metadata => { ownerReferences => [ { apiVersion => "networking.k8s.io/v1", kind => "Ingress", name => $n, controller => JSON::MaybeXS::true(), blockOwnerDeletion => JSON::MaybeXS::true() } ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1770 | 37 | ▶ | spec => { secretName => $t->{secretName}, dnsNames => [ @{ $t->{hosts} || [] } ], issuerRef => { kind => $kind, name => $iss, group => 'cert-manager.io' } } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$c{$$t{"secretName"}} //= {"metadata", {"ownerReferences", [{"apiVersion", "networking.k8s.io/v1", "kind", "Ingress", "name", $n, "controller", bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ), "blockOwnerDeletion", bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' )}]}, "spec", {"secretName", $$t{"secretName"}, "dnsNames", [@{$$t{"hosts"} or [];}], "issuerRef", {"kind", $kind, "name", $iss, "group", "cert-manager.io"}}}
$$t{'hosts'} || []
MC/DC0%0/1
$c{$$t{"secretName"}} //= {"metadata", {"ownerReferences", [{"apiVersion", "networking.k8s.io/v1", "kind", "Ingress", "name", $n, "controller", bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ), "blockOwnerDeletion", bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' )}]}, "spec", {"secretName", $$t{"secretName"}, "dnsNames", [@{$$t{"hosts"} or [];}], "issuerRef", {"kind", $kind, "name", $iss, "group", "cert-manager.io"}}}
$c{$$t{"secretName"}}
MC/DC0%0/1
$$t{'hosts'} || []
$$t{'hosts'}
Truth table50%1/2
A
A= $c{$$t{"secretName"}}
Truth table50%1/2
A
A= $$t{'hosts'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1771 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1772 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1773 | 49 | return \%c; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1774 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1775 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1776 | # ( issuer, art, namespace-der-geheimnisse ) oder () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1777 | 41 | ▶ | sub _issuer_of { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_issuer_of: called CC=12 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1778 | 41 | my ( $k, $ns, $ref ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1779 | 41 | ▶ | my $kind = $ref->{kind} // 'Issuer'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$ref{"kind"} // "Issuer"
MC/DC0%0/1
$$ref{"kind"} // "Issuer"
$$ref{"kind"}
Truth table50%1/2
A
A= $$ref{"kind"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1780 | 41 | ▶ | return () if ( $ref->{group} // 'cert-manager.io' ) ne 'cert-manager.io'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$$ref{"group"} // "cert-manager.io"
MC/DC100%1/1
$$ref{"group"} // "cert-manager.io"
$$ref{"group"}
Truth table100%2/2
A
A= $$ref{"group"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1781 | 41 | ▶ | if ( $kind eq 'ClusterIssuer' ) { my $i = ( $k->{clusterissuers} || {} )->{ $ref->{name} // '' } or return (); return ( $i, $kind, _cm_ns($k) ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%2/4
$$k{'clusterissuers'} || {}
$$ref{"name"} // ""
MC/DC0%0/1
$$k{'clusterissuers'} || {}
$$k{'clusterissuers'}
MC/DC0%0/1
$$ref{"name"} // ""
$$ref{"name"}
Truth table50%1/2
A
A= $$k{'clusterissuers'}
Truth table50%1/2
A
A= $$ref{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1782 | 0 | ▶ | my $i = ( ( $k->{namespaces}{$ns} || {} )->{issuers} || {} )->{ $ref->{name} // '' } or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
($$k{'namespaces'}{$ns} || {})->{'issuers'} || {}
$$k{'namespaces'}{$ns} || {}
$$ref{"name"} // ""
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{'issuers'} || {}
$$k{'namespaces'}{$ns}
MC/DC0%0/1
$$ref{"name"} // ""
$$ref{"name"}
Truth table0%0/2
A
A= $$k{'namespaces'}{$ns}
Truth table0%0/2
A
A= $$ref{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1783 | 0 | return ( $i, 'Issuer', $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1784 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1785 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1786 | # ( bereit, grund, meldung ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1787 | 39 | ▶ | sub _issuer_state { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_issuer_state: called CC=14 SCAR=33.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1788 | 39 | my ( $k, $i, $sns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1789 | 39 | ▶ | my $s = $i->{spec} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$i{'spec'} || {}
MC/DC0%0/1
$$i{'spec'} || {}
$$i{'spec'}
Truth table50%1/2
A
A= $$i{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1790 | 39 | ▶ | if ( $s->{ca} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1791 | 17 | ▶ | my $sn = $s->{ca}{secretName} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{"ca"}{"secretName"} // ""
MC/DC0%0/1
$$s{"ca"}{"secretName"} // ""
$$s{"ca"}{"secretName"}
Truth table50%1/2
A
A= $$s{"ca"}{"secretName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1792 | 17 | ▶ | my $sec = _secret( $k, $sns, $sn ) or return ( 0, 'ErrGetKeyPair', qq{Error getting keypair for CA issuer: secrets "$sn" not found} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1793 | 5 | ▶ | return ( 0, 'ErrInvalidKeyPair', 'Error getting keypair for CA issuer: certificate data is empty' ) unless defined $sec->{'tls.crt'} && defined $sec->{'tls.key'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $$sec{"tls.crt"} and defined $$sec{"tls.key"}
MC/DC0%0/2
defined $$sec{"tls.crt"} and defined $$sec{"tls.key"}
defined $$sec{"tls.crt"}
defined $$sec{"tls.key"}
Truth table33%1/3
A and B
A= defined $$sec{"tls.crt"}B= defined $$sec{"tls.key"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1794 | 5 | return ( 1, 'KeyPairVerified', 'Signing CA verified' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1795 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1796 | 22 | ▶ | if ( $s->{acme} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1797 | 22 | ▶ | my $srv = $s->{acme}{server} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{"acme"}{"server"} // ""
MC/DC0%0/1
$$s{"acme"}{"server"} // ""
$$s{"acme"}{"server"}
Truth table50%1/2
A
A= $$s{"acme"}{"server"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1798 | 22 | ▶ | my @known = ( @ACME, @{ ( $k->{cert_manager} || {} )->{acme_servers} || [] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{'cert_manager'} || {})->{'acme_servers'} || []
$$k{'cert_manager'} || {}
MC/DC0%0/1
($$k{'cert_manager'} || {})->{'acme_servers'} || []
$$k{'cert_manager'}
Truth table50%1/2
A
A= $$k{'cert_manager'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1799 | 22 | ▶ | unless ( grep { $_ eq $srv } @known ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1800 | 0 | my ($h) = $srv =~ m{\Ahttps?://([^/:]+)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1801 | 0 | ▶ | return ( 0, 'ErrRegisterACMEAccount', qq{Failed to register ACME account: Get "$srv": dial tcp: lookup } . ( $h // $srv ) . ' on 10.43.0.10:53: no such host' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$h // $srv
MC/DC0%0/2
$h // $srv
$h
$srv
Truth table0%0/3
A // B
A= $hB= $srv
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1802 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1803 | 22 | return ( 1, 'ACMEAccountRegistered', 'The ACME account was registered with the ACME server' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1804 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1805 | 0 | ▶ | return ( 1, 'IsReady', '' ) if $s->{selfSigned}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1806 | 0 | return ( 0, 'InvalidConfig', 'no issuer type specified for Issuer' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1807 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1808 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1809 | # Zustand eines Certificate: { ready, reason, message, cr => [bereit, grund, meldung], challenges => [ … ], issuer => … } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1810 | 41 | ▶ | sub _cert_state { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cert_state: called CC=48 SCAR=55.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1811 | 41 | my ( $k, $ns, $name, $c ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1812 | 41 | ▶ | my $s = $c->{spec} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$c{'spec'} || {}
MC/DC0%0/1
$$c{'spec'} || {}
$$c{'spec'}
Truth table50%1/2
A
A= $$c{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1813 | 41 | ▶ | my $ref = $s->{issuerRef} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{'issuerRef'} || {}
MC/DC0%0/1
$$s{'issuerRef'} || {}
$$s{'issuerRef'}
Truth table50%1/2
A
A= $$s{'issuerRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1814 | 41 | ▶ | my %r = ( name => $name, secret => $s->{secretName}, dns => [ @{ $s->{dnsNames} || [] } ], challenges => [] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{'dnsNames'} || []
MC/DC0%0/1
$$s{'dnsNames'} || []
$$s{'dnsNames'}
Truth table50%1/2
A
A= $$s{'dnsNames'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1815 | 41 | ▶ | my $not = sub { my ( $cr_reason, $cr_msg ) = @_; return { %r, ready => 0, reason => 'DoesNotExist', message => 'Issuing certificate as Secret does not exist', cr => [ 0, $cr_reason, $cr_msg ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1816 | 41 | my ( $i, $ikind, $sns ) = _issuer_of( $k, $ns, $ref ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1817 | 41 | ▶ | my $ik = $ref->{kind} // 'Issuer'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$ref{"kind"} // "Issuer"
MC/DC0%0/1
$$ref{"kind"} // "Issuer"
$$ref{"kind"}
Truth table50%1/2
A
A= $$ref{"kind"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1818 | 41 | ▶ | return $not->( 'Pending', qq{Referenced "$ik" not found: } . lc($ik) . qq{.cert-manager.io "} . ( $ref->{name} // '' ) . '" not found' ) unless $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$ref{"name"} // ""
MC/DC0%0/1
$$ref{"name"} // ""
$$ref{"name"}
Truth table50%1/2
A
A= $$ref{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1819 | 38 | my ($iready) = _issuer_state( $k, $i, $sns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1820 | 38 | ▶ | return $not->( 'Pending', 'Referenced issuer does not have a Ready status condition' ) unless $iready; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1821 | 27 | ▶ | return $not->( 'Pending', 'spec.dnsNames: at least one DNS name is required' ) unless @{ $r{dns} } || defined $s->{commonName}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@{$r{"dns"};} or defined $$s{"commonName"}
MC/DC0%0/2
@{$r{"dns"};} or defined $$s{"commonName"}
@{$r{"dns"};}
defined $$s{"commonName"}
Truth table33%1/3
A or B
A= @{$r{"dns"};}B= defined $$s{"commonName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1822 | 27 | my $is = $i->{spec}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1823 | 27 | my $trusted = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1824 | 27 | ▶ | if ( $is->{acme} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1825 | 22 | ▶ | $trusted = ( $is->{acme}{server} // '' ) !~ /staging/ ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$is{"acme"}{"server"} // ""
MC/DC0%0/1
$$is{"acme"}{"server"} // ""
$$is{"acme"}{"server"}
Truth table50%1/2
A
A= $$is{"acme"}{"server"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1826 | 22 | my $pending = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1827 | 22 | for my $d ( @{ $r{dns} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1828 | 22 | my ( $state, $reason ) = ( 'valid', 'Successfully authorized domain' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1829 | 0 | ▶ | my ($sol) = grep { my $sel = ( $_->{selector} || {} )->{dnsNames}; !$sel || grep { $_ eq $d } @$sel } @{ $is->{acme}{solvers} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition42%3/7
$$_{'selector'} || {}
!$sel || grep({$_ eq $d;} @$sel)
$$is{'acme'}{'solvers'} || []
MC/DC0%0/1
$$_{'selector'} || {}
$$_{'selector'}
MC/DC0%0/2
!$sel || grep({$_ eq $d;} @$sel)
!$sel
grep({$_ eq $d;} @$sel)
MC/DC0%0/1
$$is{'acme'}{'solvers'} || []
$$is{'acme'}{'solvers'}
Truth table50%1/2
A
A= $$_{'selector'}
Truth table33%1/3
not(A) || B
A= !$selB= grep({$_ eq $d;} @$sel)
Truth table50%1/2
A
A= $$is{'acme'}{'solvers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1830 | 22 | ▶ | if ( !$sol || ( $d =~ /\A\*/ && !$sol->{dns01} ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition33%2/6
not $sol or $d =~ /\A\*/ and not $$sol{"dns01"}
$d =~ /\A\*/ and not $$sol{"dns01"}
MC/DC0%0/3
not $sol or $d =~ /\A\*/ and not $$sol{"dns01"}
not $sol
$d =~ /\A\*/
not $$sol{"dns01"}
Truth table25%1/4
not(A) or B and not(C)
A= not $solB= $d =~ /\A\*/C= not $$sol{"dns01"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1831 | 0 | ( $state, $reason ) = ( 'errored', 'Failed to determine a valid solver configuration for the set of domains on the Order: no configured challenge solvers can be used for this challenge' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1832 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1833 | elsif ( my $h = $sol->{http01} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1834 | 22 | ▶ | my $ingc = ( $h->{ingress} || {} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$h{'ingress'} || {}
MC/DC0%0/1
$$h{'ingress'} || {}
$$h{'ingress'}
Truth table50%1/2
A
A= $$h{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1835 | 22 | ▶ | my $cls = $ingc->{ingressClassName} // $ingc->{class}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$$ingc{"ingressClassName"} // $$ingc{"class"}
MC/DC0%0/2
$$ingc{"ingressClassName"} // $$ingc{"class"}
$$ingc{"ingressClassName"}
$$ingc{"class"}
Truth table33%1/3
A // B
A= $$ingc{"ingressClassName"}B= $$ingc{"class"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1836 | 22 | ▶ | my %dns = %{ $k->{dns} || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$k{'dns'} || {}
MC/DC0%0/1
$$k{'dns'} || {}
$$k{'dns'}
Truth table50%1/2
A
A= $$k{'dns'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1837 | 22 | ▶ | if ( %dns && !exists $dns{$d} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
%dns and not exists $dns{$d}
MC/DC0%0/2
%dns and not exists $dns{$d}
%dns
not exists $dns{$d}
Truth table33%1/3
A and not(B)
A= %dnsB= not exists $dns{$d}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1838 | 0 | ( $state, $reason ) = ( 'pending', qq{Waiting for HTTP-01 challenge propagation: failed to perform self check GET request 'http://$d/.well-known/acme-challenge/tP3dBxM0Ugs3Fv2sHzv5Kp0yZq1rWc8eJn4aLo6iYuQ': Get "http://$d/.well-known/acme-challenge/tP3dBxM0Ugs3Fv2sHzv5Kp0yZq1rWc8eJn4aLo6iYuQ": dial tcp: lookup $d on 10.43.0.10:53: no such host} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1839 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1840 | elsif ( !_handled( $k, $cls ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1841 | 6 | ( $state, $reason ) = ( 'pending', q{Waiting for HTTP-01 challenge propagation: wrong status code '404', expected '200'} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1842 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1843 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1844 | elsif ( my $dn = $sol->{dns01} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1845 | 0 | my ($prov) = grep { ref $dn->{$_} eq 'HASH' } sort keys %$dn; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1846 | 0 | ▶ | my $ref2 = $prov ? ( $dn->{$prov}{apiTokenSecretRef} || $dn->{$prov}{tsigSecretSecretRef} || $dn->{$prov}{secretAccessKeySecretRef} ) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$$dn{$prov}{"apiTokenSecretRef"} or $$dn{$prov}{"tsigSecretSecretRef"} or $$dn{$prov}{"secretAccessKeySecretRef"}
$$dn{$prov}{"apiTokenSecretRef"} or $$dn{$prov}{"tsigSecretSecretRef"}
MC/DC0%0/3
$$dn{$prov}{"apiTokenSecretRef"} or $$dn{$prov}{"tsigSecretSecretRef"} or $$dn{$prov}{"secretAccessKeySecretRef"}
$$dn{$prov}{"apiTokenSecretRef"}
$$dn{$prov}{"tsigSecretSecretRef"}
$$dn{$prov}{"secretAccessKeySecretRef"}
Truth table0%0/4
A or B or C
A= $$dn{$prov}{"apiTokenSecretRef"}B= $$dn{$prov}{"tsigSecretSecretRef"}C= $$dn{$prov}{"secretAccessKeySecretRef"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1847 | 0 | ▶ | if ($ref2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1848 | 0 | ▶ | my $sec = _secret( $k, $sns, $ref2->{name} // '' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$ref2{"name"} // ""
MC/DC0%0/1
$$ref2{"name"} // ""
$$ref2{"name"}
Truth table0%0/2
A
A= $$ref2{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1849 | ( $state, $reason ) = ( 'errored', "error getting $prov secret: " . ( $sec ? qq{key "$ref2->{key}" not found in secret} : qq{secrets "} . ( $ref2->{name} // '' ) . '" not found' ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1850 | 0 | ▶ | unless $sec && defined $sec->{ $ref2->{key} // '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/7
$sec and defined $$sec{$$ref2{"key"} // ""}
$$ref2{"key"} // ""
$$ref2{"name"} // ""
MC/DC0%0/2
$sec and defined $$sec{$$ref2{"key"} // ""}
$sec
defined $$sec{$$ref2{"key"} // ""}
MC/DC0%0/1
$$ref2{"key"} // ""
$$ref2{"key"}
MC/DC0%0/1
$$ref2{"name"} // ""
$$ref2{"name"}
Truth table0%0/3
A and B
A= $secB= defined $$sec{$$ref2{"key"} // ""}
Truth table0%0/2
A
A= $$ref2{"key"}
Truth table0%0/2
A
A= $$ref2{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1851 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1852 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1853 | 22 | ▶ | push @{ $r{challenges} }, { domain => $d, state => $state, reason => $reason, type => $sol && $sol->{dns01} ? 'DNS-01' : 'HTTP-01' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$sol and $$sol{"dns01"}
MC/DC0%0/2
$sol and $$sol{"dns01"}
$sol
$$sol{"dns01"}
Truth table33%1/3
A and B
A= $solB= $$sol{"dns01"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1854 | 22 | ▶ | $pending = 1 if $state ne 'valid'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1855 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1856 | 22 | ▶ | if ($pending) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1857 | 6 | my ($bad) = grep { $_->{state} ne 'valid' } @{ $r{challenges} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1858 | 6 | ▶ | return { %{ $not->( 'Pending', qq{Waiting on certificate issuance from order $ns/$name-1-2873461: "} . ( $bad->{state} eq 'errored' ? 'errored' : 'pending' ) . '"' ) }, order => $bad->{state} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1859 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1860 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1861 | 21 | ▶ | $trusted = 0 if $is->{selfSigned}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1862 | 21 | ▶ | $trusted = ( $is->{ca}{trusted} // 1 ) ? 1 : 0 if $is->{ca}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%1/2
$$is{"ca"}{"trusted"} // 1
MC/DC0%0/1
$$is{"ca"}{"trusted"} // 1
$$is{"ca"}{"trusted"}
Truth table50%1/2
A
A= $$is{"ca"}{"trusted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1863 | return { %r, ready => 1, reason => 'Ready', message => 'Certificate is up to date and has not expired', cr => [ 1, 'Issued', 'Certificate fetched from issuer successfully' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1864 | 21 | ▶ | order => 'valid', trusted => $trusted, issuer => "$ikind/" . ( $ref->{name} // '' ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$ref{"name"} // ""
MC/DC0%0/1
$$ref{"name"} // ""
$$ref{"name"}
Truth table50%1/2
A
A= $$ref{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1865 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1866 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1867 | # Secret aus dem Zustand, sonst eines, das cert-manager ausgestellt hat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1868 | 37 | ▶ | sub _secret { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_secret: called CC=12 SCAR=25.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1869 | 37 | my ( $k, $ns, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1870 | 37 | ▶ | my $s = ( ( $k->{namespaces}{$ns} || {} )->{secrets} || {} )->{ $name // '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%4/6
($$k{'namespaces'}{$ns} || {})->{'secrets'} || {}
$$k{'namespaces'}{$ns} || {}
$name // ""
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{'secrets'} || {}
$$k{'namespaces'}{$ns}
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1871 | 37 | ▶ | return $s if $s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1872 | 32 | my $certs = _certs( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1873 | 32 | for my $cn ( sort keys %$certs ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1874 | 39 | my $c = $certs->{$cn}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1875 | 39 | ▶ | next unless ( ( $c->{spec} || {} )->{secretName} // '' ) eq ( $name // '' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
($$c{"spec"} || {})->{"secretName"} // ""
$$c{'spec'} || {}
$name // ""
MC/DC0%0/1
($$c{"spec"} || {})->{"secretName"} // ""
$$c{'spec'}
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $$c{'spec'}
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1876 | 20 | my $st = _cert_state( $k, $ns, $cn, $c ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1877 | 20 | ▶ | next unless $st->{ready}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1878 | 14 | my @dns = @{ $st->{dns} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1879 | 14 | ▶ | return { 'tls.crt' => _pem( subject => 'CN=' . ( $dns[0] // $cn ), san => join( ',', @dns ), issuer => $st->{issuer}, trusted => $st->{trusted} ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$dns[0] // $cn
MC/DC0%0/2
$dns[0] // $cn
$dns[0]
$cn
Truth table33%1/3
A // B
A= $dns[0]B= $cn
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1880 | 'tls.key' => "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIOx0Zl8i\n-----END PRIVATE KEY-----\n", _issued => 1 }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1881 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1882 | 18 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1883 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1884 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1885 | # alle Secrets eines Namespace mit den ausgestellten | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1886 | 6 | ▶ | sub _secrets_all { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_secrets_all: called CC=9 SCAR=22.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1887 | 6 | my ( $k, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1888 | 6 | ▶ | my %s = %{ ( ( $k->{namespaces}{$ns} || {} )->{secrets} ) || {} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{'namespaces'}{$ns} || {})->{'secrets'} || {}
$$k{'namespaces'}{$ns} || {}
MC/DC0%0/1
($$k{'namespaces'}{$ns} || {})->{'secrets'} || {}
$$k{'namespaces'}{$ns}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1889 | 6 | ▶ | if ( $k->{helm} ) { Langertha::Holmgang::Sim::Linux::_part('Helm'); %s = ( Langertha::Holmgang::Sim::Linux::Helm::release_secrets( $k, $ns ), %s ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1890 | 6 | for my $c ( values %{ _certs( $k, $ns ) } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1891 | 12 | ▶ | my $sn = ( $c->{spec} || {} )->{secretName} // next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$c{"spec"} || {})->{"secretName"} // (next)
$$c{'spec'} || {}
MC/DC0%0/1
($$c{"spec"} || {})->{"secretName"} // (next)
$$c{'spec'}
Truth table50%1/2
A
A= $$c{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1892 | 12 | ▶ | next if $s{$sn}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1893 | 12 | ▶ | my $x = _secret( $k, $ns, $sn ) or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1894 | 7 | $s{$sn} = $x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1895 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1896 | 6 | return \%s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1897 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1898 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1899 | 13 | ▶ | sub _secret_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_secret_type: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1900 | 13 | my ($s) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1901 | 13 | ▶ | return 'helm.sh/release.v1' if $s->{_helm}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1902 | 9 | ▶ | return defined $s->{'tls.crt'} && defined $s->{'tls.key'} ? 'kubernetes.io/tls' : 'Opaque'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $$s{"tls.crt"} and defined $$s{"tls.key"}
MC/DC50%1/2
defined $$s{"tls.crt"} and defined $$s{"tls.key"}
defined $$s{"tls.crt"}
defined $$s{"tls.key"}
Truth table66%2/3
A and B
A= defined $$s{"tls.crt"}B= defined $$s{"tls.key"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1903 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1904 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1905 | 0 | ▶ | sub _cm_log { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cm_log: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1906 | 0 | my ($k) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1907 | 0 | my @l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1908 | 0 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1909 | 0 | ▶ | for my $ns ( sort keys %{ $k->{namespaces} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$k{'namespaces'} || {}
MC/DC0%0/1
$$k{'namespaces'} || {}
$$k{'namespaces'}
Truth table0%0/2
A
A= $$k{'namespaces'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1910 | 0 | my $certs = _certs( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1911 | 0 | for my $cn ( sort keys %$certs ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1912 | 0 | my $st = _cert_state( $k, $ns, $cn, $certs->{$cn} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1913 | 0 | ▶ | next if $st->{ready}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1914 | 0 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1915 | 0 | my ($ch) = grep { $_->{state} ne 'valid' } @{ $st->{challenges} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1916 | push @l, sprintf( 'E1024 08:%02d:%02d.%06d 1 controller.go:157] "re-queuing item due to error processing" err="%s" logger="cert-manager.controller" key="%s/%s-1"', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1917 | 0 | ▶ | 20 + $i, ( 13 * $i ) % 60, 418310 + 711 * $i, ( $ch ? $ch->{reason} : $st->{cr}[2] ) =~ s/"/\\"/gr, $ns, $cn ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1918 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1919 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1920 | 0 | ▶ | for my $ci ( sort keys %{ $k->{clusterissuers} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$k{'clusterissuers'} || {}
MC/DC0%0/1
$$k{'clusterissuers'} || {}
$$k{'clusterissuers'}
Truth table0%0/2
A
A= $$k{'clusterissuers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1921 | 0 | my ( $ok, $reason, $msg ) = _issuer_state( $k, $k->{clusterissuers}{$ci}, _cm_ns($k) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1922 | 0 | ▶ | push @l, sprintf( 'E1024 08:31:%02d.%06d 1 setup.go:%d] "%s" err="%s" logger="cert-manager.controller" resource_name="%s" resource_kind="ClusterIssuer"', ++$i % 60, 207110 + $i, 100 + $i, $reason, $msg =~ s/"/\\"/gr, $ci ) unless $ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1923 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1924 | 0 | return @l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1925 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1926 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1927 | # --- Tabellen und Beschreibungen der Arten in API-Form --------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1928 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1929 | 14 | ▶ | sub _cond_text { my ($b) = @_; return $b ? 'True' : 'False' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cond_text: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1930 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1931 | # Status fuer -o yaml|json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1932 | 4 | ▶ | sub _gen_status { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_gen_status: called CC=9 SCAR=28.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1933 | 4 | my ( $k, $kind, $ns, $name, $x ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1934 | 4 | ▶ | if ( $kind eq 'certificates' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1935 | 2 | my $st = _cert_state( $k, $ns, $name, $x ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1936 | 2 | return { conditions => [ { type => 'Ready', status => _cond_text( $st->{ready} ), reason => $st->{reason}, message => $st->{message} } ] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1937 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1938 | 2 | ▶ | if ( $kind eq 'issuers' || $kind eq 'clusterissuers' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind eq "issuers" or $kind eq "clusterissuers"
MC/DC0%0/2
$kind eq "issuers" or $kind eq "clusterissuers"
$kind eq "issuers"
$kind eq "clusterissuers"
Truth table33%1/3
A or B
A= $kind eq "issuers"B= $kind eq "clusterissuers"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1939 | 0 | ▶ | my ( $ok, $reason, $msg ) = _issuer_state( $k, $x, $kind eq 'issuers' ? $ns : _cm_ns($k) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1940 | 0 | return { conditions => [ { type => 'Ready', status => _cond_text($ok), reason => $reason, message => $msg } ] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1941 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1942 | 2 | ▶ | if ( $kind eq 'ingresses' && _handled( $k, _ingress_class( $k, $x ) ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind eq "ingresses" and _handled($k, _ingress_class($k, $x))
MC/DC0%0/2
$kind eq "ingresses" and _handled($k, _ingress_class($k, $x))
$kind eq "ingresses"
_handled($k, _ingress_class($k, $x))
Truth table33%1/3
A and B
A= $kind eq "ingresses"B= _handled($k, _ingress_class($k, $x))
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1943 | 2 | ▶ | return { loadBalancer => { ingress => [ { ip => ( $k->{ingress} || {} )->{address} // '' } ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'} || {}
MC/DC0%0/1
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'}
Truth table50%1/2
A
A= $$k{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1944 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1945 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1946 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1947 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1948 | 8 | ▶ | sub _gen_rows { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_gen_rows: called CC=43 SCAR=59.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1949 | 8 | my ( $k, $kind, $ns, $o, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1950 | 8 | ▶ | my $objs = $kind eq 'certificates' ? _certs( $k, $ns ) : _gen_objs( $k, $kind, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1951 | 0 | ▶ | $objs = { %{ _builtin_roles() }, %$objs } if $kind eq 'clusterroles'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1952 | 8 | ▶ | $objs = { default => {}, %$objs } if $kind eq 'serviceaccounts' && $k->{namespaces}{$ns}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kind eq "serviceaccounts" and $$k{"namespaces"}{$ns}
MC/DC0%0/2
$kind eq "serviceaccounts" and $$k{"namespaces"}{$ns}
$kind eq "serviceaccounts"
$$k{"namespaces"}{$ns}
Truth table33%1/3
A and B
A= $kind eq "serviceaccounts"B= $$k{"namespaces"}{$ns}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1953 | 8 | ▶ | my @n = grep { !defined $name || $_ eq $name } sort keys %$objs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
!defined($name) || $_ eq $name
MC/DC100%2/2
!defined($name) || $_ eq $name
!defined($name)
$_ eq $name
Truth table100%3/3
not(A) || B
A= !defined($name)B= $_ eq $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1954 | 8 | ▶ | return ( undef, qq{Error from server (NotFound): $GEN{$kind}[3] "$name" not found} ) if defined $name && !@n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and not @n
MC/DC0%0/2
defined $name and not @n
defined $name
not @n
Truth table66%2/3
A and not(B)
A= defined $nameB= not @n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1955 | 8 | ▶ | return ( { map { $_ => { %{ $objs->{$_} }, ( _gen_status( $k, $kind, $ns, $_, $objs->{$_} ) ? ( _status => _gen_status( $k, $kind, $ns, $_, $objs->{$_} ) ) : () ) } } @n } ) if $o->{out} && $o->{out} =~ /\A(?:yaml|json)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
MC/DC50%1/2
$$o{"out"} and $$o{"out"} =~ /\A(?:yaml|json)/
$$o{"out"}
$$o{"out"} =~ /\A(?:yaml|json)/
Truth table66%2/3
A and B
A= $$o{"out"}B= $$o{"out"} =~ /\A(?:yaml|json)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1956 | 6 | ▶ | my $wide = ( $o->{out} // '' ) eq 'wide'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$o{"out"} // ""
MC/DC0%0/1
$$o{"out"} // ""
$$o{"out"}
Truth table50%1/2
A
A= $$o{"out"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1957 | 6 | my @rows; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1958 | 6 | ▶ | if ( $kind eq 'ingresses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1959 | @rows = ( [qw( NAME CLASS HOSTS ADDRESS PORTS AGE )], map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1960 | 2 | my $i = $objs->{$_}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1961 | 2 | ▶ | my $s = $i->{spec} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$i{'spec'} || {}
MC/DC0%0/1
$$i{'spec'} || {}
$$i{'spec'}
Truth table50%1/2
A
A= $$i{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1962 | 2 | ▶ | [ $_, $s->{ingressClassName} // '<none>', join( ',', map { $_->{host} // '*' } @{ $s->{rules} || [] } ) || '*', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%4/8
$$_{"host"} // "*"
$$s{'rules'} || []
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'} || {}
MC/DC0%0/1
$$_{"host"} // "*"
$$_{"host"}
MC/DC0%0/1
$$s{'rules'} || []
$$s{'rules'}
MC/DC0%0/1
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'}
Truth table50%1/2
A
A= $$_{"host"}
Truth table50%1/2
A
A= $$s{'rules'}
Truth table50%1/2
A
A= $$k{'ingress'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1963 | 2 | ▶ | _handled( $k, _ingress_class( $k, $i ) ) ? ( $k->{ingress} || {} )->{address} // '' : '', @{ $s->{tls} || [] } ? '80, 443' : '80', '41d' ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%3/6
$$s{"ingressClassName"} // "<none>"
join(',', map({$$_{'host'} // '*';} @{$$s{'rules'} or [];})) || '*'
$$s{'tls'} || []
MC/DC0%0/1
$$s{"ingressClassName"} // "<none>"
$$s{"ingressClassName"}
MC/DC0%0/1
join(',', map({$$_{'host'} // '*';} @{$$s{'rules'} or [];})) || '*'
join(',', map({$$_{'host'} // '*';} @{$$s{'rules'} or [];}))
MC/DC0%0/1
$$s{'tls'} || []
$$s{'tls'}
Truth table50%1/2
A
A= $$s{"ingressClassName"}
Truth table50%1/2
A
A= join(',', map({$$_{'host'} // '*';} @{$$s{'rules'} or [];}))
Truth table50%1/2
A
A= $$s{'tls'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1964 | } @n ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1965 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1966 | elsif ( $kind eq 'ingressclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1967 | 0 | ▶ | @rows = ( [qw( NAME CONTROLLER PARAMETERS AGE )], map { [ $_, ( $objs->{$_}{spec} || {} )->{controller} // '', '<none>', '41d' ] } @n ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
($$objs{$_}{"spec"} || {})->{"controller"} // ""
$$objs{$_}{'spec'} || {}
MC/DC0%0/1
($$objs{$_}{"spec"} || {})->{"controller"} // ""
$$objs{$_}{'spec'}
Truth table0%0/2
A
A= $$objs{$_}{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1968 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1969 | elsif ( $kind eq 'serviceaccounts' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1970 | 0 | @rows = ( [qw( NAME SECRETS AGE )], map { [ $_, 0, '41d' ] } @n ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1971 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1972 | ▶ | elsif ( $kind eq 'roles' || $kind eq 'clusterroles' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$kind eq "roles" or $kind eq "clusterroles"
MC/DC0%0/2
$kind eq "roles" or $kind eq "clusterroles"
$kind eq "roles"
$kind eq "clusterroles"
Truth table33%1/3
A or B
A= $kind eq "roles"B= $kind eq "clusterroles"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1973 | 0 | @rows = ( [ 'NAME', 'CREATED AT' ], map { [ $_, '2026-09-13T08:14:51Z' ] } @n ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1974 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1975 | ▶ | elsif ( $kind eq 'rolebindings' || $kind eq 'clusterrolebindings' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$kind eq "rolebindings" or $kind eq "clusterrolebindings"
MC/DC0%0/2
$kind eq "rolebindings" or $kind eq "clusterrolebindings"
$kind eq "rolebindings"
$kind eq "clusterrolebindings"
Truth table33%1/3
A or B
A= $kind eq "rolebindings"B= $kind eq "clusterrolebindings"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1976 | @rows = ( [ qw( NAME ROLE AGE ), ( $wide ? qw( USERS GROUPS SERVICEACCOUNTS ) : () ) ], map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1977 | 0 | ▶ | my $b = $objs->{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1978 | 0 | ▶ | my @s = @{ $b->{subjects} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$b{'subjects'} || []
MC/DC0%0/1
$$b{'subjects'} || []
$$b{'subjects'}
Truth table0%0/2
A
A= $$b{'subjects'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1979 | 0 | ▶ | my $sj = sub { my ($t) = @_; join ',', map { $t eq 'ServiceAccount' ? ( $_->{namespace} // $ns ) . ":$_->{name}" : $_->{name} } grep { ( $_->{kind} // '' ) eq $t } @s }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
Branch: 1 branch
Condition0%0/5
$$_{"namespace"} // $ns
$$_{"kind"} // ""
MC/DC0%0/2
$$_{"namespace"} // $ns
$$_{"namespace"}
$ns
MC/DC0%0/1
$$_{"kind"} // ""
$$_{"kind"}
Truth table0%0/3
A // B
A= $$_{"namespace"}B= $ns
Truth table0%0/2
A
A= $$_{"kind"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1980 | 0 | ▶ | [ $_, ( ( $b->{roleRef} || {} )->{kind} // '' ) . '/' . ( ( $b->{roleRef} || {} )->{name} // '' ), '41d', ( $wide ? ( $sj->('User'), $sj->('Group'), $sj->('ServiceAccount') ) : () ) ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/8
($$b{"roleRef"} || {})->{"kind"} // ""
$$b{'roleRef'} || {}
($$b{"roleRef"} || {})->{"name"} // ""
$$b{'roleRef'} || {}
MC/DC0%0/1
($$b{"roleRef"} || {})->{"kind"} // ""
$$b{'roleRef'}
MC/DC0%0/1
($$b{"roleRef"} || {})->{"name"} // ""
$$b{'roleRef'}
Truth table0%0/2
A
A= $$b{'roleRef'}
Truth table0%0/2
A
A= $$b{'roleRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1981 | } @n ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1982 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1983 | elsif ( $kind eq 'certificates' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1984 | 4 | ▶ | @rows = ( [qw( NAME READY SECRET AGE )], map { my $st = _cert_state( $k, $ns, $_, $objs->{$_} ); [ $_, _cond_text( $st->{ready} ), $st->{secret} // '', '3d' ] } @n ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$st{"secret"} // ""
MC/DC0%0/1
$$st{"secret"} // ""
$$st{"secret"}
Truth table50%1/2
A
A= $$st{"secret"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1985 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1986 | ▶ | elsif ( $kind eq 'issuers' || $kind eq 'clusterissuers' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$kind eq "issuers" or $kind eq "clusterissuers"
MC/DC0%0/2
$kind eq "issuers" or $kind eq "clusterissuers"
$kind eq "issuers"
$kind eq "clusterissuers"
Truth table0%0/3
A or B
A= $kind eq "issuers"B= $kind eq "clusterissuers"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1987 | 0 | ▶ | @rows = ( [qw( NAME READY AGE )], map { my ($ok) = _issuer_state( $k, $objs->{$_}, $kind eq 'issuers' ? $ns : _cm_ns($k) ); [ $_, _cond_text($ok), '41d' ] } @n ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1988 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1989 | 6 | return ( \@rows ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1990 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1991 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1992 | 4 | ▶ | sub _derived_rows { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_derived_rows: called CC=6 SCAR=18.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1993 | 4 | my ( $k, $kind, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1994 | 4 | my $certs = _certs( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1995 | 4 | my @st = map { _cert_state( $k, $ns, $_, $certs->{$_} ) } sort keys %$certs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1996 | 4 | ▶ | if ( $kind eq 'certificaterequests' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1997 | return ( [qw( NAME APPROVED DENIED READY ISSUER REQUESTOR AGE )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1998 | 2 | ▶ | map { [ "$_->{name}-1", 'True', '', _cond_text( $_->{cr}[0] ), ( ( $certs->{ $_->{name} }{spec} || {} )->{issuerRef} || {} )->{name} // '', 'system:serviceaccount:cert-manager:cert-manager', '12m' ] } @st ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%3/6
(($$certs{$$_{"name"}}{"spec"} || {})->{"issuerRef"} || {})->{"name"} // ""
($$certs{$$_{'name'}}{'spec'} || {})->{'issuerRef'} || {}
$$certs{$$_{'name'}}{'spec'} || {}
MC/DC0%0/1
(($$certs{$$_{"name"}}{"spec"} || {})->{"issuerRef"} || {})->{"name"} // ""
$$certs{$$_{'name'}}{'spec'}
Truth table50%1/2
A
A= $$certs{$$_{'name'}}{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1999 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2000 | 2 | my @acme = grep { defined $_->{order} } @st; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2001 | 0 | ▶ | if ( $kind eq 'orders' ) { return ( [qw( NAME STATE AGE )], map { [ "$_->{name}-1-2873461", $_->{order}, '12m' ] } @acme ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2002 | 2 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2003 | 2 | return ( [qw( NAME STATE DOMAIN AGE )], map { my $c = $_; map { [ "$c->{name}-1-2873461-" . ( 1902000000 + 7919 * ++$i ), $_->{state}, $_->{domain}, '12m' ] } @{ $c->{challenges} } } @acme ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2004 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2005 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2006 | # abgeleitete Objekte in API-Form (fuer -o yaml|json|jsonpath) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2007 | 1 | ▶ | sub _derived_objs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_derived_objs: called CC=11 SCAR=28.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2008 | 1 | my ( $k, $kind, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2009 | 1 | my $certs = _certs( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2010 | 1 | my %o; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2011 | 1 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2012 | 1 | for my $cn ( sort keys %$certs ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2013 | 2 | my $st = _cert_state( $k, $ns, $cn, $certs->{$cn} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2014 | 2 | ▶ | my $ref = ( $certs->{$cn}{spec} || {} )->{issuerRef} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$certs{$cn}{'spec'} || {})->{'issuerRef'} || {}
$$certs{$cn}{'spec'} || {}
MC/DC0%0/1
($$certs{$cn}{'spec'} || {})->{'issuerRef'} || {}
$$certs{$cn}{'spec'}
Truth table50%1/2
A
A= $$certs{$cn}{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2015 | 2 | ▶ | my $meta = sub { { name => $_[0], namespace => $ns, ownerReferences => [ { apiVersion => 'cert-manager.io/v1', kind => $_[1], name => $_[2], controller => JSON::MaybeXS::true() } ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2016 | 2 | ▶ | if ( $kind eq 'certificaterequests' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2017 | $o{"$cn-1"} = { apiVersion => 'cert-manager.io/v1', kind => 'CertificateRequest', metadata => $meta->( "$cn-1", 'Certificate', $cn ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2018 | spec => { issuerRef => $ref, username => 'system:serviceaccount:cert-manager:cert-manager' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2019 | status => { conditions => [ { type => 'Approved', status => 'True', reason => 'cert-manager.io', message => 'Certificate request has been approved by cert-manager.io' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2020 | 0 | { type => 'Ready', status => _cond_text( $st->{cr}[0] ), reason => $st->{cr}[1], message => $st->{cr}[2] } ] } }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2021 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2022 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2023 | 2 | ▶ | next unless defined $st->{order}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2024 | 1 | my $on = "$cn-1-2873461"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2025 | 1 | ▶ | if ( $kind eq 'orders' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2026 | 0 | my ($bad) = grep { $_->{state} ne 'valid' } @{ $st->{challenges} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2027 | $o{$on} = { apiVersion => 'acme.cert-manager.io/v1', kind => 'Order', metadata => $meta->( $on, 'CertificateRequest', "$cn-1" ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2028 | 0 | ▶ | spec => { dnsNames => $st->{dns}, issuerRef => $ref }, status => { state => $st->{order}, ( $bad ? ( reason => $bad->{reason} ) : () ) } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2029 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2030 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2031 | 1 | for my $c ( @{ $st->{challenges} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2032 | 1 | my $chn = "$on-" . ( 1902000000 + 7919 * ++$i ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2033 | $o{$chn} = { apiVersion => 'acme.cert-manager.io/v1', kind => 'Challenge', metadata => $meta->( $chn, 'Order', $on ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2034 | spec => { dnsName => $c->{domain}, type => $c->{type}, issuerRef => $ref }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2035 | status => { state => $c->{state}, reason => $c->{reason}, presented => $c->{state} eq 'errored' ? JSON::MaybeXS::false() : JSON::MaybeXS::true(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2036 | 1 | ▶ | processing => $c->{state} eq 'valid' ? JSON::MaybeXS::false() : JSON::MaybeXS::true() } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2037 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2038 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2039 | 1 | return \%o; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2040 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2041 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2042 | 3 | ▶ | sub _describe_gen { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_describe_gen: called CC=89 SCAR=70.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2043 | 3 | my ( $k, $kind, $ns, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2044 | 3 | ▶ | if ( $DERIVED{$kind} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2045 | 1 | my $certs = _certs( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2046 | 1 | for my $cn ( sort keys %$certs ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2047 | 2 | my $st = _cert_state( $k, $ns, $cn, $certs->{$cn} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2048 | 2 | ▶ | next unless index( $name // '', $cn ) == 0 || !defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
index($name // "", $cn) == 0 or not defined $name
$name // ""
MC/DC0%0/2
index($name // "", $cn) == 0 or not defined $name
index($name // "", $cn) == 0
not defined $name
MC/DC0%0/1
$name // ""
$name
Truth table33%1/3
A or not(B)
A= index($name // "", $cn) == 0B= not defined $name
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2049 | 2 | ▶ | if ( $kind eq 'certificaterequests' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2050 | return ( join( "\n", "Name: $cn-1", "Namespace: $ns", 'API Version: cert-manager.io/v1', 'Kind: CertificateRequest', 'Status:', ' Conditions:', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2051 | 0 | ' Type: Approved', ' Status: True', ' Type: Ready', ' Status: ' . _cond_text( $st->{cr}[0] ), " Reason: $st->{cr}[1]", " Message: $st->{cr}[2]", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2052 | 'Events: <none>' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2053 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2054 | 2 | ▶ | my @ch = @{ $st->{challenges} } or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2055 | 1 | my ($c) = grep { $_->{state} ne 'valid' } @ch; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2056 | 1 | ▶ | $c //= $ch[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$c //= $ch[0]
MC/DC0%0/2
$c //= $ch[0]
$c
$ch[0]
Truth table33%1/3
A //= B
A= $cB= $ch[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2057 | return ( join( "\n", "Name: " . ( $name // "$cn-1-2873461" ), "Namespace: $ns", 'API Version: acme.cert-manager.io/v1', 'Kind: ' . ( $kind eq 'orders' ? 'Order' : 'Challenge' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2058 | 1 | ▶ | 'Spec:', " Dns Name: $c->{domain}", " Type: $c->{type}", 'Status:', " Presented: " . ( $c->{state} eq 'errored' ? 'false' : 'true' ), " Processing: " . ( $c->{state} eq 'valid' ? 'false' : 'true' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition50%1/2
$name // "$cn-1-2873461"
MC/DC0%0/1
$name // "$cn-1-2873461"
$name
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2059 | " Reason: $c->{reason}", " State: $c->{state}", 'Events: <none>' ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2060 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2061 | 0 | ▶ | return ( qq{Error from server (NotFound): $SINGULAR{$kind} "} . ( $name // '' ) . '" not found', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2062 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2063 | 2 | ▶ | my $objs = $kind eq 'certificates' ? _certs( $k, $ns ) : _gen_objs( $k, $kind, $ns ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2064 | 0 | ▶ | $objs = { %{ _builtin_roles() }, %$objs } if $kind eq 'clusterroles'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2065 | 2 | ▶ | $objs = { default => {}, %$objs } if $kind eq 'serviceaccounts'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2066 | 2 | ▶ | my $x = $objs->{ $name // '' } or return ( qq{Error from server (NotFound): $GEN{$kind}[3] "} . ( $name // '' ) . '" not found', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$name // ""
$name // ""
MC/DC0%0/1
$name // ""
$name
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2067 | 2 | ▶ | my $s = $x->{spec} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$x{'spec'} || {}
MC/DC0%0/1
$$x{'spec'} || {}
$$x{'spec'}
Truth table50%1/2
A
A= $$x{'spec'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2068 | 2 | ▶ | my $m = $x->{metadata} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$x{'metadata'} || {}
MC/DC100%1/1
$$x{'metadata'} || {}
$$x{'metadata'}
Truth table100%2/2
A
A= $$x{'metadata'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2069 | 2 | ▶ | my $kv = sub { my ($h) = @_; my @k = sort keys %{ $h || {} }; @k ? join( "\n ", map {"$_: $h->{$_}"} @k ) : '<none>' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%2/2
$h || {}
MC/DC100%1/1
$h || {}
$h
Truth table100%2/2
A
A= $h
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2070 | 2 | ▶ | my @l = ( "Name: $name", ( $GEN{$kind}[2] ? () : "Namespace: $ns" ), 'Labels: ' . $kv->( $m->{labels} ), 'Annotations: ' . $kv->( $m->{annotations} ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2071 | 2 | ▶ | if ( $kind eq 'ingresses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2072 | 1 | my $cls = _ingress_class( $k, $x ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2073 | 1 | ▶ | push @l, 'Address: ' . ( _handled( $k, $cls ) ? ( $k->{ingress} || {} )->{address} // '' : '' ), 'Ingress Class: ' . ( $s->{ingressClassName} // '<none>' ), 'Default backend: <default>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'} || {}
$$s{"ingressClassName"} // "<none>"
MC/DC0%0/1
($$k{"ingress"} || {})->{"address"} // ""
$$k{'ingress'}
MC/DC0%0/1
$$s{"ingressClassName"} // "<none>"
$$s{"ingressClassName"}
Truth table50%1/2
A
A= $$k{'ingress'}
Truth table50%1/2
A
A= $$s{"ingressClassName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2074 | 1 | ▶ | push @l, 'TLS:', map { ' ' . ( $_->{secretName} // 'SNI routes' ) . ' terminates ' . join( ',', @{ $_->{hosts} || [] } ) } @{ $s->{tls} || [] } if @{ $s->{tls} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%4/8
$$s{'tls'} || []
$$_{"secretName"} // "SNI routes"
$$_{'hosts'} || []
$$s{'tls'} || []
MC/DC0%0/1
$$s{'tls'} || []
$$s{'tls'}
MC/DC0%0/1
$$_{"secretName"} // "SNI routes"
$$_{"secretName"}
MC/DC0%0/1
$$_{'hosts'} || []
$$_{'hosts'}
MC/DC0%0/1
$$s{'tls'} || []
$$s{'tls'}
Truth table50%1/2
A
A= $$s{'tls'}
Truth table50%1/2
A
A= $$_{"secretName"}
Truth table50%1/2
A
A= $$_{'hosts'}
Truth table50%1/2
A
A= $$s{'tls'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2075 | 1 | push @l, 'Rules:', ' Host Path Backends', ' ---- ---- --------'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2076 | 1 | ▶ | for my $r ( @{ $s->{rules} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$s{'rules'} || []
MC/DC0%0/1
$$s{'rules'} || []
$$s{'rules'}
Truth table50%1/2
A
A= $$s{'rules'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2077 | 1 | ▶ | push @l, ' ' . ( $r->{host} // '*' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$r{"host"} // "*"
MC/DC0%0/1
$$r{"host"} // "*"
$$r{"host"}
Truth table50%1/2
A
A= $$r{"host"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2078 | 1 | ▶ | for my $p ( @{ ( $r->{http} || {} )->{paths} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$r{'http'} || {})->{'paths'} || []
$$r{'http'} || {}
MC/DC0%0/1
($$r{'http'} || {})->{'paths'} || []
$$r{'http'}
Truth table50%1/2
A
A= $$r{'http'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2079 | 2 | ▶ | my $sb = ( $p->{backend} || {} )->{service} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
($$p{'backend'} || {})->{'service'} || {}
$$p{'backend'} || {}
MC/DC0%0/1
($$p{'backend'} || {})->{'service'} || {}
$$p{'backend'}
Truth table50%1/2
A
A= $$p{'backend'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2080 | 2 | ▶ | my $port = ( $sb->{port} || {} )->{number} // ( $sb->{port} || {} )->{name} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition55%5/9
(($$sb{"port"} || {})->{"number"} // ($$sb{"port"} || {})->{"name"}) // ""
($$sb{"port"} || {})->{"number"} // ($$sb{"port"} || {})->{"name"}
$$sb{'port'} || {}
$$sb{'port'} || {}
MC/DC0%0/2
(($$sb{"port"} || {})->{"number"} // ($$sb{"port"} || {})->{"name"}) // ""
$$sb{'port'}
$$sb{'port'}
Truth table33%1/3
A // B
A= $$sb{'port'}B= $$sb{'port'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2081 | 2 | ▶ | my $svc = ( $k->{namespaces}{$ns}{services} || {} )->{ $sb->{name} // '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$$k{'namespaces'}{$ns}{'services'} || {}
$$sb{"name"} // ""
MC/DC0%0/1
$$k{'namespaces'}{$ns}{'services'} || {}
$$k{'namespaces'}{$ns}{'services'}
MC/DC0%0/1
$$sb{"name"} // ""
$$sb{"name"}
Truth table50%1/2
A
A= $$k{'namespaces'}{$ns}{'services'}
Truth table50%1/2
A
A= $$sb{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2082 | my $ep = !$svc ? qq{<error: services "} . ( $sb->{name} // '' ) . '" not found>' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2083 | 2 | ▶ | : do { my @e = _endpoints( $k, $ns, $sb->{name} ); my ($sp) = grep { $port =~ /\A\d+\z/ ? $_->{port} == $port : ( $_->{name} // '' ) eq $port } @{ $svc->{ports} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$$sb{"name"} // ""
$$_{"name"} // ""
$$svc{'ports'} || []
MC/DC0%0/1
$$sb{"name"} // ""
$$sb{"name"}
MC/DC0%0/1
$$_{"name"} // ""
$$_{"name"}
MC/DC0%0/1
$$svc{'ports'} || []
$$svc{'ports'}
Truth table50%1/2
A
A= $$sb{"name"}
Truth table50%1/2
A
A= $$_{"name"}
Truth table50%1/2
A
A= $$svc{'ports'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2084 | 1 | ▶ | !$sp ? '<error: service port not found>' : @e ? join( ',', map {"$_->{ip}:$sp->{target}"} @e ) : '' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2085 | 2 | ▶ | push @l, sprintf( ' %-5s %s:%s (%s)', $p->{path} // '/', $sb->{name} // '', $port, $ep ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$$p{"path"} // "/"
$$sb{"name"} // ""
MC/DC0%0/1
$$p{"path"} // "/"
$$p{"path"}
MC/DC0%0/1
$$sb{"name"} // ""
$$sb{"name"}
Truth table50%1/2
A
A= $$p{"path"}
Truth table50%1/2
A
A= $$sb{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2086 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2087 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2088 | 1 | push @l, 'Events: <none>'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2089 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2090 | ▶ | elsif ( $kind eq 'roles' || $kind eq 'clusterroles' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$kind eq "roles" or $kind eq "clusterroles"
MC/DC0%0/2
$kind eq "roles" or $kind eq "clusterroles"
$kind eq "roles"
$kind eq "clusterroles"
Truth table33%1/3
A or B
A= $kind eq "roles"B= $kind eq "clusterroles"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2091 | 0 | my @rows = ( [ 'Resources', 'Non-Resource URLs', 'Resource Names', 'Verbs' ], [ '---------', '-----------------', '--------------', '-----' ] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2092 | 0 | ▶ | for my $r ( @{ $x->{rules} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$x{'rules'} || []
MC/DC0%0/1
$$x{'rules'} || []
$$x{'rules'}
Truth table0%0/2
A
A= $$x{'rules'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2093 | 0 | ▶ | for my $res ( @{ $r->{resources} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$r{'resources'} || []
MC/DC0%0/1
$$r{'resources'} || []
$$r{'resources'}
Truth table0%0/2
A
A= $$r{'resources'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2094 | 0 | ▶ | push @rows, map { [ ( $_ eq '' ? $res : "$res.$_" ), '[]', '[' . join( ' ', @{ $r->{resourceNames} || [] } ) . ']', '[' . join( ' ', @{ $r->{verbs} || [] } ) . ']' ] } @{ $r->{apiGroups} || [''] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$$r{'resourceNames'} || []
$$r{'verbs'} || []
$$r{'apiGroups'} || ['']
MC/DC0%0/1
$$r{'resourceNames'} || []
$$r{'resourceNames'}
MC/DC0%0/1
$$r{'verbs'} || []
$$r{'verbs'}
MC/DC0%0/1
$$r{'apiGroups'} || ['']
$$r{'apiGroups'}
Truth table0%0/2
A
A= $$r{'resourceNames'}
Truth table0%0/2
A
A= $$r{'verbs'}
Truth table0%0/2
A
A= $$r{'apiGroups'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2095 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2096 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2097 | 0 | push @l, 'PolicyRule:', map {" $_"} split /\n/, _cols(@rows); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2098 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2099 | ▶ | elsif ( $kind eq 'rolebindings' || $kind eq 'clusterrolebindings' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$kind eq "rolebindings" or $kind eq "clusterrolebindings"
MC/DC0%0/2
$kind eq "rolebindings" or $kind eq "clusterrolebindings"
$kind eq "rolebindings"
$kind eq "clusterrolebindings"
Truth table33%1/3
A or B
A= $kind eq "rolebindings"B= $kind eq "clusterrolebindings"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2100 | 0 | ▶ | my $rr = $x->{roleRef} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$x{'roleRef'} || {}
MC/DC0%0/1
$$x{'roleRef'} || {}
$$x{'roleRef'}
Truth table0%0/2
A
A= $$x{'roleRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2101 | push @l, 'Role:', ' Kind: ' . ( $rr->{kind} // '' ), ' Name: ' . ( $rr->{name} // '' ), 'Subjects:', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2102 | 0 | ▶ | map {" $_"} split /\n/, _cols( [qw( Kind Name Namespace )], [qw( ---- ---- --------- )], map { [ $_->{kind} // '', $_->{name} // '', $_->{namespace} // '' ] } @{ $x->{subjects} || [] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/12
$$rr{"kind"} // ""
$$rr{"name"} // ""
$$_{"kind"} // ""
$$_{"name"} // ""
$$_{"namespace"} // ""
$$x{'subjects'} || []
MC/DC0%0/1
$$rr{"kind"} // ""
$$rr{"kind"}
MC/DC0%0/1
$$rr{"name"} // ""
$$rr{"name"}
MC/DC0%0/1
$$_{"kind"} // ""
$$_{"kind"}
MC/DC0%0/1
$$_{"name"} // ""
$$_{"name"}
MC/DC0%0/1
$$_{"namespace"} // ""
$$_{"namespace"}
MC/DC0%0/1
$$x{'subjects'} || []
$$x{'subjects'}
Truth table0%0/2
A
A= $$rr{"kind"}
Truth table0%0/2
A
A= $$rr{"name"}
Truth table0%0/2
A
A= $$_{"kind"}
Truth table0%0/2
A
A= $$_{"name"}
Truth table0%0/2
A
A= $$_{"namespace"}
Truth table0%0/2
A
A= $$x{'subjects'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2104 | elsif ( $kind eq 'serviceaccounts' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2105 | 0 | push @l, 'Image pull secrets: <none>', 'Mountable secrets: <none>', 'Tokens: <none>', 'Events: <none>'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2107 | elsif ( $kind eq 'certificates' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2108 | 0 | my $st = _cert_state( $k, $ns, $name, $x ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2109 | 0 | ▶ | my $ir = $s->{issuerRef} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$s{'issuerRef'} || {}
MC/DC0%0/1
$$s{'issuerRef'} || {}
$$s{'issuerRef'}
Truth table0%0/2
A
A= $$s{'issuerRef'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2110 | 0 | ▶ | push @l, 'API Version: cert-manager.io/v1', 'Kind: Certificate', 'Spec:', ' Dns Names:', ( map {" $_"} @{ $s->{dnsNames} || [] } ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/10
$$s{'dnsNames'} || []
$$ir{"group"} // "cert-manager.io"
$$ir{"kind"} // "Issuer"
$$ir{"name"} // ""
$$s{"secretName"} // ""
MC/DC0%0/1
$$s{'dnsNames'} || []
$$s{'dnsNames'}
MC/DC0%0/1
$$ir{"group"} // "cert-manager.io"
$$ir{"group"}
MC/DC0%0/1
$$ir{"kind"} // "Issuer"
$$ir{"kind"}
MC/DC0%0/1
$$ir{"name"} // ""
$$ir{"name"}
MC/DC0%0/1
$$s{"secretName"} // ""
$$s{"secretName"}
Truth table0%0/2
A
A= $$s{'dnsNames'}
Truth table0%0/2
A
A= $$ir{"group"}
Truth table0%0/2
A
A= $$ir{"kind"}
Truth table0%0/2
A
A= $$ir{"name"}
Truth table0%0/2
A
A= $$s{"secretName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2111 | ' Issuer Ref:', ' Group: ' . ( $ir->{group} // 'cert-manager.io' ), ' Kind: ' . ( $ir->{kind} // 'Issuer' ), ' Name: ' . ( $ir->{name} // '' ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2112 | ' Secret Name: ' . ( $s->{secretName} // '' ), 'Status:', ' Conditions:', ' Type: Ready', ' Status: ' . _cond_text( $st->{ready} ), " Reason: $st->{reason}", " Message: $st->{message}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2113 | 0 | ( $st->{ready} ? ( 'Events:', ' Type Reason Age From Message', ' ---- ------ ---- ---- -------', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2114 | " Normal Issuing 3d cert-manager-certificates-issuing The certificate has been successfully issued" ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2115 | : ( 'Events:', ' Type Reason Age From Message', ' ---- ------ ---- ---- -------', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2116 | " Normal Requested 12m cert-manager-certificates-request-manager Created new CertificateRequest resource \"$name-1\"" ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2118 | ▶ | elsif ( $kind eq 'issuers' || $kind eq 'clusterissuers' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$kind eq "issuers" or $kind eq "clusterissuers"
MC/DC0%0/2
$kind eq "issuers" or $kind eq "clusterissuers"
$kind eq "issuers"
$kind eq "clusterissuers"
Truth table33%1/3
A or B
A= $kind eq "issuers"B= $kind eq "clusterissuers"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2119 | 1 | ▶ | my ( $ok, $reason, $msg ) = _issuer_state( $k, $x, $kind eq 'issuers' ? $ns : _cm_ns($k) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2120 | 1 | my $spec = do { local $YAML::XS::Boolean = q{JSON::PP}; YAML::XS::Dump($s) } =~ s/\A---\n//r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2121 | 1 | push @l, "API Version: cert-manager.io/v1", "Kind: $GEN{$kind}[1]", 'Spec:', ( map {" $_"} split /\n/, $spec ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2122 | 'Status:', ' Conditions:', ' Type: Ready', ' Status: ' . _cond_text($ok), " Reason: $reason", " Message: $msg", 'Events: <none>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2124 | elsif ( $kind eq 'ingressclasses' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2125 | 0 | ▶ | push @l, 'Controller: ' . ( $s->{controller} // '' ), 'Events: <none>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$s{"controller"} // ""
MC/DC0%0/1
$$s{"controller"} // ""
$$s{"controller"}
Truth table0%0/2
A
A= $$s{"controller"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2127 | 2 | return ( join( "\n", @l ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2130 | # --- kubectl create fuer RBAC und TLS --------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2132 | 7 | ▶ | sub _create_more { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_create_more: called CC=50 SCAR=44.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2133 | 7 | my ( $k, $a, $o, $dev ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2134 | 7 | my ( $what, $name ) = @$a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2135 | 7 | ▶ | my $f = $o->{f} || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$o{'f'} || {}
MC/DC100%1/1
$$o{'f'} || {}
$$o{'f'}
Truth table100%2/2
A
A= $$o{'f'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2136 | 7 | my $ns = $o->{ns}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2137 | 7 | ▶ | my $split = sub { map { split /,/ } @{ $f->{ $_[0] } || [] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Condition100%2/2
$$f{$_[0]} || []
MC/DC100%1/1
$$f{$_[0]} || []
$$f{$_[0]}
Truth table100%2/2
A
A= $$f{$_[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2138 | 7 | ▶ | if ( $what =~ /\A(?:serviceaccount|sa)\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2139 | 1 | ▶ | return ( 'error: exactly one NAME is required, got 0', 0 ) unless defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2140 | 1 | ▶ | return ( qq{error: failed to create serviceaccount: serviceaccounts "$name" already exists}, 0 ) if $name eq 'default' || $k->{namespaces}{$ns}{serviceaccounts}{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$name eq "default" or $$k{"namespaces"}{$ns}{"serviceaccounts"}{$name}
MC/DC0%0/2
$name eq "default" or $$k{"namespaces"}{$ns}{"serviceaccounts"}{$name}
$name eq "default"
$$k{"namespaces"}{$ns}{"serviceaccounts"}{$name}
Truth table33%1/3
A or B
A= $name eq "default"B= $$k{"namespaces"}{$ns}{"serviceaccounts"}{$name}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2141 | 1 | $k->{namespaces}{$ns}{serviceaccounts}{$name} = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2142 | 1 | return ( "serviceaccount/$name created", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2144 | 6 | ▶ | if ( $what eq 'role' || $what eq 'clusterrole' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$what eq "role" or $what eq "clusterrole"
MC/DC50%1/2
$what eq "role" or $what eq "clusterrole"
$what eq "role"
$what eq "clusterrole"
Truth table66%2/3
A or B
A= $what eq "role"B= $what eq "clusterrole"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2145 | 2 | ▶ | my $kind = $what eq 'role' ? 'roles' : 'clusterroles'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2146 | 2 | ▶ | return ( 'error: exactly one NAME is required, got 0', 0 ) unless defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2147 | 2 | my @verbs = $split->('verb'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2148 | 2 | ▶ | return ( 'error: at least one verb must be specified', 0 ) unless @verbs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2149 | 2 | my @res = $split->('resource'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2150 | 2 | ▶ | return ( 'error: at least one resource must be specified', 0 ) unless @res; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2151 | 2 | my %g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2152 | my @order; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2153 | 2 | for my $r (@res) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2154 | 2 | my ( $p, $grp ) = _resource($r); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2155 | 2 | ▶ | return ( qq{error: the server doesn't have a resource type "$r"}, 0 ) unless defined $p; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2156 | 2 | ▶ | push @order, $grp unless $g{$grp}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2157 | 2 | push @{ $g{$grp} }, $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2159 | 2 | my @rn = $split->('resource-name'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2160 | 2 | my $t = _target( $k, $o, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2161 | 2 | ▶ | return ( qq{error: failed to create $what: $kind "$name" already exists}, 0 ) if $t->{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2162 | 2 | ▶ | $t->{$name} = { rules => [ map { { apiGroups => [$_], resources => $g{$_}, verbs => [@verbs], ( @rn ? ( resourceNames => [@rn] ) : () ) } } @order ] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2163 | 2 | return ( "$GEN{$kind}[3]/$name created", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2165 | 4 | ▶ | if ( $what eq 'rolebinding' || $what eq 'clusterrolebinding' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$what eq "rolebinding" or $what eq "clusterrolebinding"
MC/DC50%1/2
$what eq "rolebinding" or $what eq "clusterrolebinding"
$what eq "rolebinding"
$what eq "clusterrolebinding"
Truth table66%2/3
A or B
A= $what eq "rolebinding"B= $what eq "clusterrolebinding"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2166 | 3 | my $kind = "${what}s"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2167 | 3 | ▶ | return ( 'error: exactly one NAME is required, got 0', 0 ) unless defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2168 | 3 | ▶ | my ($role) = @{ $f->{role} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$f{'role'} || []
MC/DC100%1/1
$$f{'role'} || []
$$f{'role'}
Truth table100%2/2
A
A= $$f{'role'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2169 | 3 | ▶ | my ($cr) = @{ $f->{clusterrole} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$f{'clusterrole'} || []
MC/DC100%1/1
$$f{'clusterrole'} || []
$$f{'clusterrole'}
Truth table100%2/2
A
A= $$f{'clusterrole'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2170 | 3 | ▶ | return ( 'error: exactly one of clusterrole or role must be specified', 0 ) unless defined $role xor defined $cr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
defined $role xor defined $cr
MC/DC0%0/2
defined $role xor defined $cr
defined $role
defined $cr
Truth table50%2/4
A xor B
A= defined $roleB= defined $cr
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2171 | 3 | ▶ | return ( 'error: unknown flag: --role', 0 ) if $what eq 'clusterrolebinding' && defined $role; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$what eq "clusterrolebinding" and defined $role
MC/DC0%0/2
$what eq "clusterrolebinding" and defined $role
$what eq "clusterrolebinding"
defined $role
Truth table33%1/3
A and B
A= $what eq "clusterrolebinding"B= defined $role
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2172 | 3 | my @subj; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2173 | 3 | ▶ | for my $s ( @{ $f->{serviceaccount} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$f{'serviceaccount'} || []
MC/DC100%1/1
$$f{'serviceaccount'} || []
$$f{'serviceaccount'}
Truth table100%2/2
A
A= $$f{'serviceaccount'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2174 | 1 | my ( $sns, $sn ) = split /:/, $s, 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2175 | 1 | ▶ | return ( "error: serviceaccount must be <namespace>:<name>", 0 ) unless defined $sn && length $sns && length $sn; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $sn and length $sns and length $sn
defined $sn and length $sns
MC/DC0%0/3
defined $sn and length $sns and length $sn
defined $sn
length $sns
length $sn
Truth table25%1/4
A and B and C
A= defined $snB= length $snsC= length $sn
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2176 | 1 | push @subj, { kind => 'ServiceAccount', name => $sn, namespace => $sns }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2178 | 3 | ▶ | push @subj, map { { kind => 'User', apiGroup => 'rbac.authorization.k8s.io', name => $_ } } @{ $f->{user} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$f{'user'} || []
MC/DC100%1/1
$$f{'user'} || []
$$f{'user'}
Truth table100%2/2
A
A= $$f{'user'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2179 | 3 | ▶ | push @subj, map { { kind => 'Group', apiGroup => 'rbac.authorization.k8s.io', name => $_ } } @{ $f->{group} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$f{'group'} || []
MC/DC100%1/1
$$f{'group'} || []
$$f{'group'}
Truth table100%2/2
A
A= $$f{'group'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2180 | 3 | my $t = _target( $k, $o, $kind ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2181 | 3 | ▶ | return ( qq{error: failed to create $what: $kind "$name" already exists}, 0 ) if $t->{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2182 | 3 | ▶ | $t->{$name} = { roleRef => { apiGroup => 'rbac.authorization.k8s.io', kind => defined $role ? 'Role' : 'ClusterRole', name => $role // $cr }, ( @subj ? ( subjects => \@subj ) : () ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$role // $cr
MC/DC0%0/2
$role // $cr
$role
$cr
Truth table66%2/3
A // B
A= $roleB= $cr
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2183 | 3 | return ( "$GEN{$kind}[3]/$name created", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2185 | 1 | ▶ | if ( $what eq 'secret' && ( $name // '' ) eq 'tls' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
$what eq "secret" and ($name // "") eq "tls"
$name // ""
MC/DC0%0/2
$what eq "secret" and ($name // "") eq "tls"
$what eq "secret"
$name
Truth table33%1/3
A and B
A= $what eq "secret"B= $name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2186 | 1 | ▶ | my $sn = $a->[2] // return ( 'error: exactly one NAME is required, got 0', 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$a[2] // (return "error: exactly one NAME is required, got 0", 0)
MC/DC0%0/1
$$a[2] // (return "error: exactly one NAME is required, got 0", 0)
$$a[2]
Truth table50%1/2
A
A= $$a[2]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2187 | 1 | ▶ | my ($cert) = @{ $f->{cert} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$f{'cert'} || []
MC/DC0%0/1
$$f{'cert'} || []
$$f{'cert'}
Truth table50%1/2
A
A= $$f{'cert'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2188 | 1 | ▶ | my ($key) = @{ $f->{key} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$f{'key'} || []
MC/DC0%0/1
$$f{'key'} || []
$$f{'key'}
Truth table50%1/2
A
A= $$f{'key'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2189 | 1 | ▶ | return ( 'error: load key pair: open : no such file or directory', 0 ) unless defined $cert && defined $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $cert and defined $key
MC/DC0%0/2
defined $cert and defined $key
defined $cert
defined $key
Truth table33%1/3
A and B
A= defined $certB= defined $key
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2190 | 1 | my %t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2191 | 1 | for ( [ 'tls.crt', $cert ], [ 'tls.key', $key ] ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2192 | 2 | ▶ | my $fe = ( $dev->{files} || {} )->{ $_->[1] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dev{'files'} || {}
MC/DC0%0/1
$$dev{'files'} || {}
$$dev{'files'}
Truth table50%1/2
A
A= $$dev{'files'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2193 | 2 | ▶ | $fe = $fe->{content} if ref $fe eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2194 | 2 | ▶ | return ( "error: open $_->[1]: no such file or directory", 0 ) unless defined $fe; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2195 | 2 | $t{ $_->[0] } = $fe; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2197 | 1 | ▶ | return ( qq{error: failed to create secret secrets "$sn" already exists}, 0 ) if $k->{namespaces}{$ns}{secrets}{$sn}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2198 | 1 | $k->{namespaces}{$ns}{secrets}{$sn} = \%t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2199 | 1 | return ( "secret/$sn created", 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2201 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2202 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2203 | 0 | ▶ | sub _v_edit { push @GAPS, 'kubectl edit'; return ( 'error: Edit cancelled, no valid changes were saved.', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_edit: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2204 | 0 | ▶ | sub _v_explain { push @GAPS, 'kubectl explain'; return ( '', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_explain: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2205 | 0 | ▶ | sub _v_top { return ( 'error: Metrics API not available', 0 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_top: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2206 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2207 | # ReplicaSets der Deployments (das aktuelle je Deployment) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2208 | 2 | ▶ | sub _replicasets { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_replicasets: called CC=7 SCAR=19.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2209 | 2 | my ( $k, $ns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2210 | 2 | ▶ | my $o = $k->{namespaces}{$ns} or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2211 | 2 | my @p = _pods( $k, $ns ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2212 | 2 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2213 | 2 | ▶ | for my $d ( sort keys %{ $o->{deployments} || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$o{'deployments'} || {}
MC/DC0%0/1
$$o{'deployments'} || {}
$$o{'deployments'}
Truth table50%1/2
A
A= $$o{'deployments'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2214 | 8 | my $dep = $o->{deployments}{$d}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2215 | 8 | ▶ | my $h = _hash( [ $dep->{template}, $dep->{restarted_at} // '' ] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$$dep{"restarted_at"} // ""
MC/DC0%0/1
$$dep{"restarted_at"} // ""
$$dep{"restarted_at"}
Truth table50%1/2
A
A= $$dep{"restarted_at"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2216 | 8 | my @dp = grep { $_->{deployment} eq $d } @p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2217 | 8 | my $sa = $dep->{template}{service_account}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2218 | 8 | ▶ | push @r, { name => "$d-$h", deployment => $d, desired => $dep->{replicas} // 1, current => scalar @dp, ready => scalar( grep { $_->{ready} } @dp ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$$dep{"replicas"} // 1
MC/DC0%0/1
$$dep{"replicas"} // 1
$$dep{"replicas"}
Truth table50%1/2
A
A= $$dep{"replicas"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2219 | ( _sa_exists( $k, $ns, $sa ) ? () : ( failed => qq{Error creating: pods "$d-$h-" is forbidden: error looking up service account $ns/$sa: serviceaccount "$sa" not found} ) ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2221 | 2 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2224 | 1 | ▶ | sub _v_api_versions { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_api_versions: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2225 | 1 | return ( join( "\n", qw( acme.cert-manager.io/v1 admissionregistration.k8s.io/v1 apiextensions.k8s.io/v1 apps/v1 authorization.k8s.io/v1 autoscaling/v2 batch/v1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2226 | cert-manager.io/v1 coordination.k8s.io/v1 discovery.k8s.io/v1 events.k8s.io/v1 networking.k8s.io/v1 node.k8s.io/v1 policy/v1 rbac.authorization.k8s.io/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2227 | scheduling.k8s.io/v1 storage.k8s.io/v1 v1 ) ), 1 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2230 | 0 | ▶ | sub _v_api_resources { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_v_api_resources: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2231 | 0 | my @r = ( [qw( NAME SHORTNAMES APIVERSION NAMESPACED KIND )] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2232 | 0 | my %short = ( pods => 'po', services => 'svc', deployments => 'deploy', ingresses => 'ing', serviceaccounts => 'sa', certificates => 'cert,certs', persistentvolumeclaims => 'pvc', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2233 | networkpolicies => 'netpol', replicasets => 'rs', configmaps => 'cm', namespaces => 'ns', nodes => 'no', storageclasses => 'sc', certificaterequests => 'cr,crs', events => 'ev' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2234 | 0 | my %kind = ( %APIKIND, pods => 'Pod', replicasets => 'ReplicaSet', endpoints => 'Endpoints', nodes => 'Node', events => 'Event', certificaterequests => 'CertificateRequest', orders => 'Order', challenges => 'Challenge' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2235 | 0 | for my $int ( sort keys %kind ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2236 | 0 | ▶ | my $p = $API_PLURAL{$int} // $int; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$API_PLURAL{$int} // $int
MC/DC0%0/2
$API_PLURAL{$int} // $int
$API_PLURAL{$int}
$int
Truth table0%0/3
A // B
A= $API_PLURAL{$int}B= $int
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2237 | 0 | ▶ | my $g = $GROUP{$p} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$p} // ""
MC/DC0%0/1
$Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$p} // ""
$Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$p}
Truth table0%0/2
A
A= $Langertha::Holmgang::Sim::Linux::Kubernetes::GROUP{$p}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2238 | 0 | ▶ | push @r, [ $p, $short{$p} // '', ( $g eq '' ? 'v1' : "$g/v1" ), ( $CLUSTER{$int} ? 'false' : 'true' ), $kind{$int} ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/2
$short{$p} // ""
MC/DC0%0/1
$short{$p} // ""
$short{$p}
Truth table0%0/2
A
A= $short{$p}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2240 | 0 | return ( _cols(@r), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2243 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2245 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||