Skip to content

Commit 727893f

Browse files
clean-up
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
1 parent c8bb28f commit 727893f

File tree

4 files changed

+55
-14
lines changed

4 files changed

+55
-14
lines changed

client-org/active/org1.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
===== org1 =====
44
# datastore :
5-
mongodb.kubedb.com/mgs 4.4.26 Ready 4d1h
5+
mongodb.kubedb.com/mgs 4.4.26 Ready 4d16h
66
# pods :
7-
mgs-0 2/2 Running 0 4d1h
7+
mgs-0 2/2 Running 0 4d16h
88
# binding :
9-
mongodbbinding.catalog.appscode.com/mgs org1 mgs Current 4d1h
9+
mongodbbinding.catalog.appscode.com/mgs org1 mgs Current 4d16h
1010
# gateway :
11-
mongo-ui-3dc60439 org1 10.2.0.184 True 4d1h
11+
mongo-ui-3dc60439 org1 10.2.0.184 True 4d16h
1212

1313

1414
===== org1-monitoring =====
1515
# grafanadashboards :
16-
kubedb-redis-summary Redis / Summary Current 4d1h
16+
kubedb-redis-summary Redis / Summary Current 4d16h
1717

1818

1919
===== org1-gw =====
2020
# hr :
21-
org1 4d1h True Helm install succeeded for release org1-gw/org1.v1 with chart service-gateway@v2025.10.31
21+
org1 4d16h True Helm install succeeded for release org1-gw/org1.v1 with chart service-gateway@v2025.10.31
2222
# pods :
23-
org1-gw-seed-backend-5b84546bcc-ssd4q 1/1 Running 0 4d1h
23+
org1-gw-seed-backend-5b84546bcc-ssd4q 1/1 Running 0 4d16h
2424
# configmaps :
25-
kube-root-ca.crt 1 4d1h
25+
kube-root-ca.crt 1 4d16h
2626
# secrets :
27-
sh.helm.release.v1.org1.v1 helm.sh/release.v1 1 4d1h
27+
sh.helm.release.v1.org1.v1 helm.sh/release.v1 1 4d16h
2828
# gatewayconfigs :
29-
org1 4d1h
29+
org1 4d16h
3030
# gatewaypresets :
31-
org1 4d1h
31+
org1 4d16h
3232
# services :
33-
org1-gw-seed-backend ClusterIP 10.43.5.45 <none> 3000/TCP 4d1h
33+
org1-gw-seed-backend ClusterIP 10.43.5.45 <none> 3000/TCP 4d16h
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
3+
4+
Licensed under the AppsCode Community License 1.0.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package clientorg
18+
19+
import "gomodules.xyz/go-sh"
20+
21+
func (g *clientOrgOpts) cleanup() error {
22+
for _, org := range g.activeOrganizations { // TODO
23+
if !org.gwNamespace {
24+
continue
25+
}
26+
arg := []any{"delete", "services", "-n", org.clientOrgName + "-gw", "--all"}
27+
_, err := sh.Command(kubectlCommand, arg...).Command("/usr/bin/tail", "-1").Output()
28+
if err != nil {
29+
return err
30+
}
31+
32+
arg = []any{"delete", "deployments", "-n", org.clientOrgName + "-gw", "--all"}
33+
_, err = sh.Command(kubectlCommand, arg...).Command("/usr/bin/tail", "-1").Output()
34+
if err != nil {
35+
return err
36+
}
37+
}
38+
return nil
39+
}

pkg/cmds/debug/clientorg/client-org.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,7 @@ func (g *clientOrgOpts) run() error {
140140
if err != nil {
141141
return err
142142
}
143-
return nil
143+
144+
err = g.cleanup()
145+
return err
144146
}

pkg/cmds/debug/clientorg/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func makeArg(resource, namespace string) []any {
9494

9595
func makeArgYaml(resource, namespace string) []any {
9696
return []any{"get", resource, "-n", namespace}
97-
//return []any{"get", resource, "-n", namespace, "--output", "yaml"} // TODO
97+
// return []any{"get", resource, "-n", namespace, "--output", "yaml"} // TODO
9898
}
9999

100100
func getNSHeader(ns string) []byte {

0 commit comments

Comments
 (0)