Git Product home page Git Product logo

Comments (3)

moxious avatar moxious commented on August 16, 2024

Major hint:

+ run_tester.py --namespace apptest-d4944478-a953-472d-8b61-e36c80033247 --manifest /data/tester.yaml
result: (1, '', 'Error from server (Invalid): error when creating "/data/tester.yaml": Pod "testrun-tester" is invalid: metadata.ownerReferences: Invalid value: []v1.OwnerReference{v1.OwnerReference{APIVersion:"app.k8s.io/v1alpha1", Kind:"Application", Name:"testrun", UID:"a8ffb8a5-73cf-11e8-81de-42010a80012f", Controller:(*bool)(0xc422751688), BlockOwnerDeletion:(*bool)(0xc422751689)}, v1.OwnerReference{APIVersion:"app.k8s.io/v1alpha1", Kind:"Application", Name:"testrun", UID:"a8ffb8a5-73cf-11e8-81de-42010a80012f", Controller:(*bool)(0xc42275168a), BlockOwnerDeletion:(*bool)(0xc42275168b)}}: Only one reference can have Controller set to true. Found "true" in references for testrun and testrun\nError from server (Invalid): error when creating "/data/tester.yaml": ConfigMap "testrun-test" is invalid: metadata.ownerReferences: Invalid value: []v1.OwnerReference{v1.OwnerReference{APIVersion:"app.k8s.io/v1alpha1", Kind:"Application", Name:"testrun", UID:"a8ffb8a5-73cf-11e8-81de-42010a80012f", Controller:(*bool)(0xc4223d9458), BlockOwnerDeletion:(*bool)(0xc4223d9459)}, v1.OwnerReference{APIVersion:"app.k8s.io/v1alpha1", Kind:"Application", Name:"testrun", UID:"a8ffb8a5-73cf-11e8-81de-42010a80012f", Controller:(*bool)(0xc4223d945a), BlockOwnerDeletion:(*bool)(0xc4223d945b)}}: Only one reference can have Controller set to true. Found "true" in references for testrun and testrun\n')
Traceback (most recent call last):
  File "/bin/run_tester.py", line 98, in <module>
    main()
  File "/bin/run_tester.py", line 38, in main
    '''.format(args.namespace, args.manifest)).text()
  File "/bin/bash_util.py", line 68, in text
    raise CommandException(self._error)

@vcanaa in this is a problem right here: https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/master/marketplace/deployer_util/run_tester.py#L34

When doing the "kubectl apply" for the test resources, the .text() function is never called on that Command object, meaning no data or process exit status is ever read, and the failure is silently swallowed, I think this needs to be fixed. I modified my local file to uncover the error above, which will let me keep debugging.

Immediate cause of this issue being reported is that kubectl apply is failing.

The money part of this error is this: Only one reference can have Controller set to true. Found "true" in references for testrun and testrun which is still obscure to me, but I'll keep looking.

from marketplace-k8s-app-tools.

moxious avatar moxious commented on August 16, 2024

OK so the error is caused by this bit of the emitted / expanded test YAML:

  ownerReferences:
  - apiVersion: app.k8s.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: Application
    name: testrun
    uid: ce8ef389-7336-11e8-81de-42010a80012f
  - apiVersion: app.k8s.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: Application
    name: testrun
    uid: ce8ef389-7336-11e8-81de-42010a80012f

That's why kubectl apply is failing it looks like.

Now suspicion goes to set_resource_ownership within separate_tester_resources.py here: https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/master/marketplace/deployer_util/separate_tester_resources.py#L51

Not sure how that's getting called twice but that looks like what's happening.

Local work-around: changing this line here to set ownerReferences to a one-element array instead of appending. This way I can keep moving without being able to spot the double call. https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/master/marketplace/deployer_util/resources.py#L31

from marketplace-k8s-app-tools.

vcanaa avatar vcanaa commented on August 16, 2024

That is nice investigation. This PR should address these 2 issues.

#138

from marketplace-k8s-app-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.