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:
+24
-18
@@ -10,7 +10,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -41,7 +41,7 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -78,7 +78,7 @@
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -95,10 +95,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "openshift"
|
||||
@@ -114,6 +110,10 @@
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@@ -139,7 +139,7 @@
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -170,10 +170,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "openshift"
|
||||
@@ -185,6 +181,10 @@
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
@@ -204,8 +204,8 @@
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
@@ -214,7 +214,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
@@ -233,7 +236,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim1",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim1"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -41,7 +41,7 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
@@ -72,7 +72,7 @@
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -100,13 +100,13 @@
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -123,6 +123,14 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "openshift"
|
||||
@@ -134,14 +142,6 @@
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@@ -158,7 +158,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
@@ -185,12 +188,12 @@
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"type": "Recreate",
|
||||
"type": "Recreate",
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
@@ -214,13 +217,13 @@
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
@@ -251,10 +254,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "openshift"
|
||||
@@ -266,6 +265,10 @@
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
@@ -292,7 +295,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
@@ -317,7 +323,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
@@ -336,7 +345,10 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim1",
|
||||
"creationTimestamp": null
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim1"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
|
||||
Reference in New Issue
Block a user