Skip to content

Commit

Permalink
ContainerMakerInterface, making kind() method final on manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-buchyn committed Dec 13, 2020
1 parent 3d4c034 commit 41f3e28
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Core/ConfigMap/AbstractConfigMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function binaryData(StringMap $binaryData): void
{
}

public static function kind(): string
final public static function kind(): string
{
return ConfigMap::KIND;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Container/ContainerMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
use Dealroadshow\K8S\Framework\Core\Container\VolumeMount\VolumeMountsConfigurator;
use Dealroadshow\K8S\Framework\Middleware\ContainerImageMiddlewareInterface;

class ContainerMaker
class ContainerMaker implements ContainerMakerInterface
{
/**
* @var ContainerImageMiddlewareInterface[]|iterable
* @var ContainerImageMiddlewareInterface[]
*/
private iterable $middlewares;

Expand Down
12 changes: 12 additions & 0 deletions src/Core/Container/ContainerMakerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Dealroadshow\K8S\Framework\Core\Container;

use Dealroadshow\K8S\Data\Collection\VolumeList;
use Dealroadshow\K8S\Data\Container;
use Dealroadshow\K8S\Framework\App\AppInterface;

interface ContainerMakerInterface
{
public function make(ContainerInterface $builder, VolumeList $volumes, AppInterface $app): Container;
}
2 changes: 1 addition & 1 deletion src/Core/CronJob/AbstractCronJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function configureCronJob(CronJob $cronJob): void
{
}

public static function kind(): string
final public static function kind(): string
{
return CronJob::KIND;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Core/Deployment/AbstractDeployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public function imagePullSecrets(ImagePullSecretsConfigurator $secrets): void
{
}

public static function kind(): string
{
return Deployment::KIND;
}

public function nodeSelector(StringMap $nodeSelector): void
{
}
Expand Down Expand Up @@ -66,4 +61,9 @@ public function progressDeadlineSeconds(): ?int
public function configureDeployment(Deployment $deployment): void
{
}

final public static function kind(): string
{
return Deployment::KIND;
}
}
2 changes: 1 addition & 1 deletion src/Core/Ingress/AbstractIngress.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function configureIngress(Ingress $ingress): void
{
}

public static function kind(): string
final public static function kind(): string
{
return Ingress::KIND;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Job/AbstractJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function configureJob(Job $job): void
{
}

public static function kind(): string
final public static function kind(): string
{
return Job::KIND;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Pod/PodSpecProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

use Dealroadshow\K8S\Data\PodSpec;
use Dealroadshow\K8S\Framework\App\AppInterface;
use Dealroadshow\K8S\Framework\Core\Container\ContainerMaker;
use Dealroadshow\K8S\Framework\Core\Container\ContainerMakerInterface;
use Dealroadshow\K8S\Framework\Core\Pod\Affinity\AffinityConfigurator;
use Dealroadshow\K8S\Framework\Core\Pod\Containers\PodContainers;
use Dealroadshow\K8S\Framework\Core\Pod\ImagePullSecrets\ImagePullSecretsConfigurator;
use Dealroadshow\K8S\Framework\Core\Pod\Volume\VolumesConfigurator;

class PodSpecProcessor
{
private ContainerMaker $containerMaker;
private ContainerMakerInterface $containerMaker;

public function __construct(ContainerMaker $containerMaker)
public function __construct(ContainerMakerInterface $containerMaker)
{
$this->containerMaker = $containerMaker;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Secret/AbstractSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function stringData(StringMap $stringData): void
{
}

public static function kind(): string
final public static function kind(): string
{
return Secret::KIND;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function configureService(Service $service): void
{
}

public static function kind(): string
final public static function kind(): string
{
return Service::KIND;
}
Expand Down

0 comments on commit 41f3e28

Please sign in to comment.