dc's People
dc's Issues
Handle CRD(s) that are stuck due in Terminating state
Use case
Assume a CustomResource with finalizers. However, the logic/pod that removes the finalizers do not exist. When one tries to delete the CR the CR is stuck. When one tries to delete the CRD, this CRD is stuck as well. There should be a mechanism to detect such orphan/stale entries.
Check for existence of finalizer(s) for any k8s resource custom or native
Motivation
Avoid repetitive codebase such as follows:
// IsFinalizerExistsOnBDC returns true if the object with provided name contains the finalizer.
func (ops *Operations) IsFinalizerExistsOnBDC(bdcName, finalizer string) bool {
for i := 0; i < maxRetry; i++ {
bdcObj, err := ops.BDCClient.Get(bdcName, metav1.GetOptions{})
Expect(err).To(BeNil())
for _, f := range bdcObj.Finalizers {
if f == finalizer {
return true
}
}
time.Sleep(5 * time.Second)
}
return false
}
// IsSPCFinalizerExistsOnSPC returns true if the spc with provided name contains the spc finalizer.
func (ops *Operations) IsSPCFinalizerExistsOnSPC(spcName, spcFinalizer string) bool {
for i := 0; i < maxRetry; i++ {
gotSPC, err := ops.SPCClient.Get(spcName, metav1.GetOptions{})
Expect(err).To(BeNil())
for _, finalizer := range gotSPC.Finalizers {
if finalizer == spcFinalizer {
return true
}
}
time.Sleep(5 * time.Second)
}
return false
}
// IsSPCFinalizerExistsOnBDCs returns true if the all the BDCs( selected by provided list options)
// has spc finalizer on it.
func (ops *Operations) IsSPCFinalizerExistsOnBDCs(listOptions metav1.ListOptions, spcFinalizer string) bool {
for i := 0; i < maxRetry; i++ {
spcFinalizerPresent := true
gotBDCList, err := ops.BDCClient.List(listOptions)
Expect(err).To(BeNil())
for _, BDCObj := range gotBDCList.Items {
BDCObj := BDCObj
if !bdc.BuilderForAPIObject(&BDCObj).BDC.HasFinalizer(spcFinalizer) {
spcFinalizerPresent = false
}
}
if !spcFinalizerPresent {
time.Sleep(5 * time.Second)
} else {
return true
}
}
return false
}
Some Litmus/Ansible challenges
- Asynchronous task execution in ansible (do things in parallel)
- Ability to obtain on-going stdout of long running tasks, before task completion
- Ability to do diffs of json files/blocks
- Ability to execute "blocks of code" with complex conditionals (ansible can do this against an "imported" taskfile)
- Methods to perform an unit/bdd "test" of ansible playbooks
- Automated quality checks/bots against yaml/playbooks for github repos
- Method to speed up execution of litmusbooks
- Method to achieve idempotency using shell tasks (shell module)
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.