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

Skaffold fails to label API objects created with multi-document JSON k8s manifest #920

Closed
nkubala opened this issue Aug 22, 2018 · 1 comment
Assignees
Labels
area/labels good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@nkubala
Copy link
Contributor

nkubala commented Aug 22, 2018

Expected behavior

Skaffold correctly labels all API objects in kubernetes

Actual behavior

Labeling on the API objects created through the JSON manifests fails. The objects are created successfully (aka deployment succeeds), but labeling fails with:

Starting deploy...
service/leeroy-app created
deployment.apps/leeroy-app created
service/leeroy-app unchanged
deployment.apps/leeroy-app unchanged
service/leeroy-web created
deployment.apps/leeroy-web created
WARN[0005] error adding label to runtime object: getting metadata accessor: object does not implement the Object interfaces 
Deploy complete in 2.248206572s

I deployed to GKE, so inspecting the Service in the cloud console, I can see that there are no labels on the leeroy-app service, but they are there on leeroy-web (which was deployed from YAML).

Information

  • Skaffold version: v0.12.0
  • Operating system: Debian 4.9.82
  • Contents of skaffold.yaml: see examples/microservices/skaffold.yaml

Steps to reproduce the behavior

  1. In the microservices example in Skaffold, rewrite the leeroy-app/kubernetes/deployment.yaml to deployment.json as follows (abbreviated since this is just a rewrite of the bundled example):
{
    "apiVersion": "v1",
    "kind": "List",
    "metadata": {},
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Service",
            ...
        },
        {
            "apiVersion": "apps/v1",
            "kind": "Deployment",
            "metadata": {
                "name": "leeroy-app",
                "labels": {
                    "app": "leeroy-app"
                }
            },
            "spec": {
                "replicas": 1,
                "selector": {
                    "matchLabels": {
                        "app": "leeroy-app"
                    }
                },
               ...
            }
        }
    ]
}

  1. Do a skaffold dev or skaffold run.

My guess is this has something to do with using kind: List since JSON doesn't support the k8s document separator (---).

@dgageot dgageot self-assigned this Aug 23, 2018
@dgageot dgageot added the kind/bug Something isn't working label Aug 23, 2018
@dgageot dgageot removed their assignment Aug 23, 2018
@balopat balopat added the priority/p0 Highest priority. We are actively looking at delivering it. label Sep 4, 2018
@balopat balopat added good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors priority/p2 May take a couple of releases and removed priority/p0 Highest priority. We are actively looking at delivering it. labels Nov 13, 2018
@dgageot dgageot self-assigned this Jan 11, 2019
@dgageot
Copy link
Contributor

dgageot commented Feb 5, 2019

This was fixed by a combination of #1451 and #1489

@dgageot dgageot closed this as completed Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/labels good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

3 participants