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:
+16
-13
@@ -10,7 +10,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -36,7 +36,7 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -68,7 +68,7 @@
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -82,6 +82,10 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "etherpad"
|
||||
@@ -97,10 +101,6 @@
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "3306"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@@ -126,7 +126,7 @@
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -178,8 +178,8 @@
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
@@ -188,7 +188,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
|
||||
+40
-31
@@ -10,7 +10,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -36,7 +36,7 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -62,7 +62,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -90,13 +90,13 @@
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -110,14 +110,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "3306"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "etherpad"
|
||||
@@ -129,6 +121,14 @@
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "3306"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@@ -145,7 +145,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
@@ -172,13 +175,13 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {},
|
||||
"type": "Recreate"
|
||||
"type": "Recreate",
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
@@ -201,13 +204,13 @@
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -229,14 +232,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "etherpad"
|
||||
@@ -244,6 +239,14 @@
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "etherpad"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
@@ -266,7 +269,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
@@ -291,7 +297,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
|
||||
Reference in New Issue
Block a user