Comments (5)
It's possible to work with CustomResourceDefinition
without knowing its type and thus delete it. But I'm not sure that will work for all CustomResources
.
from xtf.
Could you reference some example of working with CustomResourceDefinition
? Anyway it is cluster scoped resource. I would expect OpenShift.clean()
cleans only namespace scoped resources.
from xtf.
Some examples can be found in fabric8io/kubernetes-client
repository.
Working with CustomResourceDefinitions
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDLoadExample.java
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ListCustomResourceDefinitions.java
The first approach with POJOs:
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDExample.java
The newer API levering raw approach without POJOs:
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/RawCustomResourceExample.java
AFAIK, there's no definitive and good answer from client devs. They're working on simplifying the whole process. Anyway the former approach required to define POJOs for CustomResources
to allow serialization/deserializationa and CRUD operations. There's no way for java client to have a model of custom resource available and the way it's implemented it can manipulate (CRUD) on such resources either.
In Kafka Operator (Java based operator) they do generate class model the same way as in kubernetes-client
, because they also leverage the client directly.
IMO the raw approach seems a bit more promising and easier to impl/maintain, but I haven't tried it yet.
Anyway I don't think we can/should add a direct support to XTF for any of the specific CRDs, CRs. That'd make it even more obscure to work with.
@Crumby @maschmid probably something like a clean hook (Java SPI) to be executed afterwards to extend clean capability?
from xtf.
It should be possible to use a dynamic client (just for deletion), as you don't have to know anything about the CRDs to delete its CRs. You only need to know the Group, Version and Resource to get the list of CRs and to delete them. (so we could have something like
openshift.clean(new GroupVersionResource("cool.io","v1alpha1", "foos"), new GroupVersionResource("cool.io","v1alpha1", "bars"), ...);
To have clean delete all "all"s, it would only have to list all CRDs that list "all" as its category.. (note that it doesn't necessary mean "all CRDs that exist") , not sure if "oc" use some special API for it (as apparently it knows the list even if the user cannot list CRDs... )
from xtf.
Resolved by #299. Closing.
from xtf.
Related Issues (20)
- ClusterVersionInfo doesn't work well with nightly builds of OCP HOT 4
- Blocking errors if oc binary in OCP 4 is not found in mirrors
- Add configuration for connection waiting time HOT 5
- Optional configuration for downloading ocp binary client from working cluster HOT 1
- Extend tests and description of EventList* classes to include multiline messages matching
- If parameterized tests fail then OpenShiftRecorderService throws java.nio.file.FileAlreadyExistsException when overriding files from build namespace
- Drop OCP 3 support as it is "End of Maintenance Support"
- Introduce tech preview/experimental features HOT 2
- support mountTrustedCA attribute for BuildConfigs
- Add support for `HELM_KUBEINSECURE_SKIP_TLS_VERIFY` in Helm Client HOT 1
- Inclusive language
- ImageContent needs to support PodSecurity with OCP 4.11+ HOT 1
- Ideas - Refactor XTF to better handle running tests in separate namespaces
- Non-GA OCP versions not being matched HOT 1
- No fallback when OCP version does not match
- StartupProbes support
- XTF does not support custom Kubeconfig with cert/key file for OpenShiftBinary HOT 15
- XTF code formating
- Is BuildManager wrongly creating a system:image-puller RoleBinding?
- Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]
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 xtf.