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

kubectl apply should be able to take a List #19639

Closed
ghodss opened this issue Jan 14, 2016 · 13 comments · Fixed by #20948
Closed

kubectl apply should be able to take a List #19639

ghodss opened this issue Jan 14, 2016 · 13 comments · Fixed by #20948
Assignees
Labels
area/app-lifecycle area/kubectl kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@ghodss
Copy link
Contributor

ghodss commented Jan 14, 2016

kubectl create, delete, etc. can already take a List object. kubectl apply can take the list object when it does creation, but it gives an (ugly) error when it's configuring the objects.

$ cat rcs.yaml
apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: ReplicationController
  metadata:
    name: nginx
  spec:
    replicas: 1
    selector:
      run: nginx
    template:
      metadata:
        labels:
          run: nginx
      spec:
        containers:
        - image: nginx
          name: nginx
- apiVersion: v1
  kind: ReplicationController
  metadata:
    name: nginx-2
  spec:
    replicas: 1
    selector:
      run: nginx-2
    template:
      metadata:
        labels:
          run: nginx-2
      spec:
        containers:
        - image: nginx
          name: nginx-2
$ kubectl create -f rcs.yaml
replicationcontroller "nginx" created
replicationcontroller "nginx-2" created
$ kubectl delete -f rcs.yaml
replicationcontroller "nginx" deleted
replicationcontroller "nginx-2" deleted
$ kubectl apply -f rcs.yaml
replicationcontroller "nginx" created
replicationcontroller "nginx-2" created

Then... expected:

$ kubectl apply -f rcs.yaml
replicationcontroller "nginx" configured
replicationcontroller "nginx-2" configured
$

Actual:

$ kubectl apply -f rcs.yaml
expected a struct, but received a %!t(string=nil)
expected a struct, but received a %!t(string=nil)
$
@adohe-zz
Copy link

@ghodss what's you kubelet version?

@ghodss
Copy link
Contributor Author

ghodss commented Jan 15, 2016

1.2.0-alpha.5

@bgrant0607 bgrant0607 added area/app-lifecycle help-wanted kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Jan 23, 2016
@bgrant0607 bgrant0607 added this to the next-candidate milestone Jan 23, 2016
@bgrant0607
Copy link
Member

Sounds like a bug. Are you interested in taking a look @adohe?

@adohe-zz
Copy link

@bgrant0607 sure I will take a look during this weekend.

@adohe-zz
Copy link

@bgrant0607 @ghodss I think the root cause is here, the dataStruct actually is info.VersionedObject, in the origin FileVisitor.StreamVisitor, VersionedObject is not nil, but after the FlattenListVisitor, this object is nil. Would you like to double check this?

@jackgr
Copy link
Contributor

jackgr commented Jan 27, 2016

I'll take a look.

@jackgr jackgr self-assigned this Jan 27, 2016
@adohe-zz
Copy link

@jackgr if you have make sure about this, please let me know. Thanks :)

@bgrant0607 bgrant0607 modified the milestones: v1.2, v1.2-candidate Jan 29, 2016
@bgrant0607 bgrant0607 modified the milestones: next-candidate, v1.2 Feb 8, 2016
@ghodss
Copy link
Contributor Author

ghodss commented Feb 9, 2016

@bgrant0607 Is there any ways we could get this into 1.2? It's actually making our config generation quite painful to have to make a separate file for every object. It looks like @adohe got pretty far? @adohe would you like to make a PR that we can review?

@bgrant0607
Copy link
Member

@ghodss I don't see how. It could have made 1.2 if a PR had been sent within a few days of the issue being filed.

@bgrant0607
Copy link
Member

@jackgr I unassigned all issues assigned to you. Please only assign issues that are actively being worked on, so that others can know which issues are available to be picked up.

@jackgr
Copy link
Contributor

jackgr commented Feb 9, 2016

@ghodss My apologies. If I'm not mistaken, this issue was filed after the code freeze for 1.2. I didn't realize that it was time critical or that it could make the release at that time. However, I should have asked. Sorry for the inconvenience.

@bgrant0607 Thank you. I still plan to address those issues for the next release, as discussed, but will assign each one to myself as I work on it.

@ghodss
Copy link
Contributor Author

ghodss commented Feb 10, 2016

@bgrant0607 I created #20948 which fixes this. I'm really hoping we can get this into 1.2 since it's a pretty small, isolated fix but a pretty big bug that is complicating our config generation system. Let me know what else I can do to help.

@bgrant0607
Copy link
Member

@ghodss Thanks for the PR. We're short on reviewer bandwidth at the moment. I assigned it to Clayton for review or delegation.

ghodss pushed a commit to ghodss/kubernetes that referenced this issue Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/app-lifecycle area/kubectl kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants