forked from LaconicNetwork/kompose
delete objects based on label
This PR uses the "SelectorFromSet()" function which takes alabel or selector as an argument returns all the object that uses that label or selector. Once we get the object that uses a particular label we can further do the delete operation on them. This is similar to "kubectl delete <object> --selector=<key>=<value>". Also the label has been modified from service to io.kompose.service.
This commit is contained in:
@@ -37,6 +37,7 @@ import (
|
||||
)
|
||||
|
||||
const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||
const Selector = "io.kompose.service"
|
||||
|
||||
// RandStringBytes generates randomly n-character string
|
||||
func RandStringBytes(n int) string {
|
||||
@@ -116,7 +117,7 @@ func isPath(substring string) bool {
|
||||
|
||||
// ConfigLabels configures label
|
||||
func ConfigLabels(name string) map[string]string {
|
||||
return map[string]string{"service": name}
|
||||
return map[string]string{Selector: name}
|
||||
}
|
||||
|
||||
// ConfigAnnotations configures annotations
|
||||
|
||||
Reference in New Issue
Block a user