Skip to content

Commit

Permalink
feat: add params.imagePullSecrets (#169)
Browse files Browse the repository at this point in the history
* feat: add params.imagePullSecrets

* Update templates/simple/package.json

Co-authored-by: Douglas Duteil <douglasduteil@gmail.com>

Co-authored-by: Douglas Duteil <douglasduteil@gmail.com>
  • Loading branch information
Julien Bouquillon and douglasduteil committed Sep 15, 2020
1 parent 9048b3c commit fda70c1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
Expand Up @@ -567,6 +567,8 @@ spec:
cert: wildcard
component: next
spec:
imagePullSecrets:
- name: some-secret
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/sample-next-app/www:8843083edb7f873cad1d1420731a60773594ffae
Expand Down
Expand Up @@ -567,6 +567,8 @@ spec:
cert: wildcard
component: next
spec:
imagePullSecrets:
- name: some-secret
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/sample-next-app/www:1.2.3
Expand Down
Expand Up @@ -553,6 +553,8 @@ spec:
cert: wildcard
component: next
spec:
imagePullSecrets:
- name: some-secret
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/sample-next-app/www:1.2.3
Expand Down
6 changes: 6 additions & 0 deletions src/utils/createDeployment.ts
@@ -1,4 +1,8 @@
/* eslint-disable simple-import-sort/sort */
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { IIoK8sApiCoreV1Container } from "kubernetes-models/_definitions/IoK8sApiCoreV1Container";
import { IIoK8sApiCoreV1LocalObjectReference } from "kubernetes-models/_definitions/IoK8sApiCoreV1LocalObjectReference";

import { Deployment } from "kubernetes-models/apps/v1/Deployment";

import { merge } from "./merge";
Expand All @@ -10,6 +14,7 @@ export interface DeploymentParams {
image: string;
labels?: Record<string, string>;
name: string;
imagePullSecrets?: IIoK8sApiCoreV1LocalObjectReference[];
}

export default (params: DeploymentParams): Deployment => {
Expand Down Expand Up @@ -48,6 +53,7 @@ export default (params: DeploymentParams): Deployment => {
),
},
spec: {
imagePullSecrets: params.imagePullSecrets,
containers: [
merge(
{
Expand Down
5 changes: 5 additions & 0 deletions templates/simple/components/www.ts
Expand Up @@ -18,6 +18,11 @@ const manifests = create("www", {
containerPort: 8080,
},
deployment: {
imagePullSecrets: [
{
name: "some-secret",
},
],
labels: {
component: "next",
},
Expand Down

0 comments on commit fda70c1

Please sign in to comment.