lib/IO/K8s/Role/HelmManaged.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 4 / 4 totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
from_repo
1.0
set_version
1.0
CRAP 1.0
« lib/IO/K8s/PrometheusOperator/V1alpha1/WorkloadBinding.pm ↑ Summary lib/IO/K8s/Role/ResourceMap.pm »
1 package IO::K8s::Role::HelmManaged;
2 # ABSTRACT: Role for K3s Helm chart management
3 8 our $VERSION = '1.112';
4 8 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # The fluent setters below build the spec through IO::K8s::Role::SpecBuilder
7 # rather than by hand, so that role is a hard dependency of this one (k103).
8 # IO::K8s::Role::APIObject composes SpecBuilder for every top-level Kind, so
9 # these are satisfied for anything built with IO::K8s::APIObject; a class
10 # that composes this role without them now fails at composition time,
11 # naming the missing method, instead of at the first setter call.
12 8 requires qw( spec_hash spec_set );
13  
14  
15 4 ▶sub from_repo {
Subroutine from_repo: called CC=1 SCAR=0.0
Pod documented
16 4 my ($self, $repo_url, $chart_name) = @_;
17 4 $self->spec_set('repo', $repo_url);
18 4 $self->spec_set('chart', $chart_name);
19 4 return $self;
20 }
21  
22  
23 4 ▶sub set_version {
Subroutine set_version: called CC=1 SCAR=0.0
Pod documented
24 4 my ($self, $version) = @_;
25 4 $self->spec_set('version', $version);
26 4 return $self;
27 }
28  
29  
30 6 ▶sub set_values {
Subroutine set_values: called CC=1 SCAR=0.0
Pod documented
31 6 my ($self, %values) = @_;
32 # Helm keys carry dots (image.tag), so they must not travel through a
33 # dotted spec path: fetch the map once and write into it directly.
34 6 my $set = $self->spec_hash('set');
35 6 @{$set}{keys %values} = values %values;
36 6 return $self;
37 }
38  
39  
40 4 ▶sub set_values_yaml {
Subroutine set_values_yaml: called CC=1 SCAR=0.0
Pod documented
41 4 my ($self, $yaml_str) = @_;
42 4 $self->spec_set('valuesContent', $yaml_str);
43 4 return $self;
44 }
45  
46 8 1;
47  
48 __END__
« lib/IO/K8s/PrometheusOperator/V1alpha1/WorkloadBinding.pm ↑ Summary lib/IO/K8s/Role/ResourceMap.pm »