Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not add the image pull secret to the service IR if selected no authentication #929

Merged
merged 3 commits into from
Dec 8, 2022

Conversation

Akash-Nayak
Copy link
Contributor

@Akash-Nayak Akash-Nayak commented Dec 8, 2022

Fixes #928

The generated deployment yaml when selected no authentication.

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest4/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}

The generated deployment yaml when selected use an existing pull secret and gave all-icr-io as the pull secret.

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest3/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: all-icr-io
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}

Co-authored-by: Ashok Pon Kumar ashokponkumar@gmail.com
Signed-off-by: Akash Nayak akash19nayak@gmail.com

… existing pull secret

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Base: 15.34% // Head: 15.33% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (0d6a540) compared to base (6bef972).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head 0d6a540 differs from pull request most recent head 15470c2. Consider uploading reports for the commit 15470c2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #929      +/-   ##
==========================================
- Coverage   15.34%   15.33%   -0.02%     
==========================================
  Files          50       50              
  Lines        4581     4584       +3     
==========================================
  Hits          703      703              
- Misses       3702     3705       +3     
  Partials      176      176              
Impacted Files Coverage Δ
.../kubernetes/irpreprocessor/registrypreprocessor.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…se existing pull secret or docker credentials

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@Akash-Nayak Akash-Nayak changed the title fix: Add the image pull secret to the service IR only if selected use an existing pull secret fix: Do not add the image pull secret to the service IR if selected no authentication Dec 8, 2022
@Akash-Nayak
Copy link
Contributor Author

With no authentication

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest7/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}
$ ls latest/deploy/yamls/ 
latest-ingress.yaml    nodejs-deployment.yaml nodejs-service.yaml

With use an existing image pull secret

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest7/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: all-icr-io
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}
$ ls latest1/deploy/yamls/
latest1-ingress.yaml   nodejs-deployment.yaml nodejs-service.yaml

With username and password

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest7/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: quay-io-imagepullsecret
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}
$ ls latest2/deploy/yamls/
latest2-ingress.yaml                nodejs-service.yaml
nodejs-deployment.yaml              quay-io-imagepullsecret-secret.yaml

With use credentials from the docker config.json file

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/latest7/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: quay-io-imagepullsecret
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}
$ ls latest3/deploy/yamls/
latest3-ingress.yaml                nodejs-service.yaml
nodejs-deployment.yaml              quay-io-imagepullsecret-secret.yaml

…ected use existing pull secret or docker credentials

Co-authored-by: Ashok Pon Kumar <ashokponkumar@gmail.com>
Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The deployment yaml contains imagePullSecret field even with No authentication option selected
2 participants