Skip to content

Commit

Permalink
clean some tests files, README and namespace in case of emptiness
Browse files Browse the repository at this point in the history
  • Loading branch information
yanc0 committed Oct 22, 2020
1 parent 62d00f0 commit 01f5f7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ configmap "django-config-g55mctg456" deleted
ingress.extensions "my-ingress" deleted
```

If you want to fail on untracked resources (exit status 1), you can use `-fail=true`:
If you want to fail on untracked resources (exit status 1), you can use `-fail`:

```
$ untrak -c untrak.yaml -fail=true
$ untrak -c untrak.yaml -fail
```

> **Caution**: please test this tool extensively before deleting resources. The software is provided "as is", without warranty of any kind.
6 changes: 6 additions & 0 deletions example/manifests/resources_in.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: app
namespace: app
---
apiVersion: v1
kind: Service
metadata:
labels:
Expand Down
5 changes: 5 additions & 0 deletions example/manifests/resources_out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ spec:
serviceName: django
servicePort: 80
path: /
---
apiVersion: v1
kind: Namespace
metadata:
name: app
2 changes: 1 addition & 1 deletion kubernetes/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// Metadata of kubernetes resource
type Metadata struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
Namespace string `yaml:"namespace,omitempty"`
}

// Resource is a minimal description of a kubernetes object
Expand Down

0 comments on commit 01f5f7e

Please sign in to comment.