Comments (3)
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.
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.
That is nice investigation. This PR should address these 2 issues.
from marketplace-k8s-app-tools.
Related Issues (20)
- options for managing dependencies
- Support CRD and CR ordering HOT 1
- `mpdev doctor` says `kubectl` isn't installed HOT 1
- RBAC Role rules for namespaces outside of the app itself
- The test runner "bashTest" does not show stderr and stdout on failure HOT 1
- The update from v1beta1 to v1 broke our old deployer images
- Integrating cert-manager with Google PrivateCA
- Add support for Helm v3 test hook HOT 2
- The application uid should no be displayed in the Marketplace UI
- Creating KSA with annotation
- arm64 builds - gcr.io/cloud-marketplace-tools/k8s/dev & gcr.io/cloud-marketplace-tools/k8s/deployer_helm
- `mpdev doctor` command says `kubectl is not installed` when it is HOT 1
- exception: Set of resources includes multiple Applications even though there is only 1 application HOT 1
- KUBECONFIG should be used instead of KUBE_CONFIG
- Unknown field "spec.selector.matchLabels.app.kubernetes.io/name" on GKE 1.25 HOT 2
- Helm template Capabilities.ApiVersions.Has behavior different than helm install
- FB.com
- How to use RWX storage class in schema.yaml
- Support for multiple charts for helm deployer
- Fail at build time with chart directory not seen as a directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marketplace-k8s-app-tools.