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 kompose.image-pull-secret invalid when use compose configs #1414

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

xingjianhui
Copy link
Contributor

kompose version: 1.23.0 (bc7d9f4)
compose version: 3.8

I found kompose.image-pull-secret will be invaild
when compose service has configs

@k8s-ci-robot
Copy link
Contributor

Welcome @xingjianhui!

It looks like this is your first PR to kubernetes/kompose 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kompose has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xingjianhui
To complete the pull request process, please assign hangyan after the PR has been reviewed.
You can assign the PR to them by writing /assign @hangyan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from kadel and sebgoa August 12, 2021 08:19
@xingjianhui xingjianhui reopened this Aug 12, 2021
@hangyan
Copy link
Contributor

hangyan commented Aug 12, 2021

@xingjianhui Can you add more description about the issue your PR is fixing? It's hard to understand based on your comment. May be some compose examples?

@xingjianhui
Copy link
Contributor Author

xingjianhui commented Aug 12, 2021

If docker-compose set configs,
then use kompose convert command,
the output hello-deployment.yaml will be lose imagePullSecrets.

Example source docker-compose.yaml

version: "3.8"

configs:
  appconfig:
    file: ./test.yml

services:
  hello:
    image: busybox
    configs:
      - source: appconfig
        target: /etc/config/test.yml
    environment:
      - SOME_ENV=xxxx
    labels:
      - kompose.image-pull-secret=regcred
      - kompose.service.type=loadbalancer

part of hello-deployment.yaml

spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: hello
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose -f test.yml convert
        kompose.image-pull-secret: regcred
        kompose.service.group: cdp
        kompose.service.type: loadbalancer
        kompose.version: 1.23.0 (bc7d9f4f)
      creationTimestamp: null
      labels:
        io.kompose.service: hello
    spec:
      containers:
        - env:
            - name: SOME_ENV
              value: xxxx
          image: busybox
          name: hello
          resources: {}
          volumeMounts:
            - mountPath: /etc/config/test.yml
              name: appconfig
              subPath: test.yml
      restartPolicy: Always
      volumes:
        - configMap:
            items:
              - key: test.yml
                path: test.yml
            name: appconfig
          name: appconfig
status: {}

@hangyan

@hangyan
Copy link
Contributor

hangyan commented Aug 12, 2021

/check-cla

@hangyan
Copy link
Contributor

hangyan commented Aug 12, 2021

codes look good. Please check the CI result for fix related issues @xingjianhui

@tk42
Copy link
Contributor

tk42 commented Aug 12, 2021

@xingjianhui
I found another. ImagePullSecrets in podSpec.go is called from nowhere. It should be also called from the indent inside MultipleContainerMode in kubernetes.go, otherwise images can’t be pulled with secret in --multiple-container-mode.

@xingjianhui
Copy link
Contributor Author

@xingjianhui
I found another. ImagePullSecrets in podSpec.go is called from nowhere. It should be also called from the indent inside MultipleContainerMode in kubernetes.go, otherwise images can’t be pulled with secret in --multiple-container-mode.

Hi, I found the problem so, and I found another problem when use --multiple-container-mode arg.
When use --multiple-container-mode to create a pod with mutiple containers, the out deployment will be lost all docker-compose configs.
So, I think fix ImagePullSecrets and lose configs within --multiple-container-mode need another PR

@xingjianhui
Copy link
Contributor Author

/check-cla

@xingjianhui
Copy link
Contributor Author

codes look good. Please check the CI result for fix related issues @xingjianhui

I fixed CI problem.

@hangyan
Copy link
Contributor

hangyan commented Aug 13, 2021

@xingjianhui cla still failed

@xingjianhui
Copy link
Contributor Author

/check-cla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 16, 2021
@hangyan
Copy link
Contributor

hangyan commented Aug 16, 2021

@xingjianhui still has ci issues

@xingjianhui
Copy link
Contributor Author

@xingjianhui still has ci issues

It exit 0 when i exec
golangci-lint run --out-format=github-actions --timeout 5m on iTerm command line

@hangyan
Copy link
Contributor

hangyan commented Aug 23, 2021

@xingjianhui A local golangci script will be added soon

@hangyan hangyan merged commit e8966d9 into kubernetes:master Aug 23, 2021
@hangyan
Copy link
Contributor

hangyan commented Aug 23, 2021

@xingjianhui Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants