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

Image rewriting fails #4486

Closed
ashconnell opened this issue Jul 16, 2020 · 2 comments · Fixed by #4488
Closed

Image rewriting fails #4486

ashconnell opened this issue Jul 16, 2020 · 2 comments · Fixed by #4488
Assignees
Labels
area/dev CRDs kind/bug Something isn't working

Comments

@ashconnell
Copy link

Expected behavior

When using Agones which introduces custom resource definitions (eg Fleet, Gameserver) the image specified should be rewritten the same as other pod specifications when using skaffold dev etc.

apiVersion: 'agones.dev/v1'
kind: Fleet
metadata:
  name: gameserver-fleet
spec:
  replicas: 2
  template:
    spec:
      ports:
        - name: default
          containerPort: 3002
      template:
        spec:
          containers:
            - name: gameserver
              image: gcr.io/company/gameserver
              ports:
                - containerPort: 3002

Actual behavior

Inspecting via minikube dashboard shows that the pod Agones creates moves into an ImagePullBackOff state and inspecting the manifest shows that the image value is still gcr.io/company/gameserver and has not been rewritten.

Information

  • Skaffold version: v1.9.1
  • Operating system: OSX
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta3
kind: Config
metadata:
  name: company
build:
  local:
    useDockerCLI: true
  artifacts:
    - image: gcr.io/company/gameserver
      context: ./packages/gameserver
      docker:
        target: development
      sync:
        infer:
          - 'src/**/*'
          - 'lib/**/*'
deploy:
  kubeContext: minikube
  kubectl:
    manifests:
      - k8s/*.yaml

I might be misunderstanding the issue i'm seeing but if this is correct are there any known workarounds to this that will let us continue development?

Cheers :D

@dgageot dgageot self-assigned this Jul 17, 2020
@dgageot dgageot added area/dev kind/bug Something isn't working labels Jul 17, 2020
@dgageot
Copy link
Contributor

dgageot commented Jul 17, 2020

@ashconnell The way Skaffold works right now is that it has an allow-list with all the kinds that can be transformed. This was added to avoid transforming every field named image on every random kind.

I think this is too restrictive since the only way to make Skaffold recognize a new kind is to release a new version.

I'll try to fix that. In the mean time, if you give me a list of all the kinds that Agones has, that have an image field, I'm happy to add those types to the allow-list.

@ashconnell
Copy link
Author

@dgageot Thanks for adding these, it works perfectly now.

Another option might be to inverse this to a Deny-List defined in user-land (via skaffold.yaml). That way all CRD's by default are supported. If you find skaffold is rewriting something it shouldn't, you just add it to your config.

Although i'm not sure what the original issues that lead to this are or how common they are, so.

Once again thanks for this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev CRDs kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants