Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not prune by default #118

Merged
merged 4 commits into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Additional parameters are available for each positional argument. For example:

```
$ kapitan compile -h
usage: kapitan compile [-h] [--search-path JPATH] [--verbose] [--no-prune]
usage: kapitan compile [-h] [--search-path JPATH] [--verbose] [--prune]
[--quiet] [--output-path PATH] [--target-path PATH]
[--parallelism INT] [--secrets-path SECRETS_PATH]
[--reveal] [--inventory-path INVENTORY_PATH]
Expand All @@ -291,7 +291,7 @@ optional arguments:
--search-path JPATH, -J JPATH
set search path, default is "."
--verbose, -v set verbose mode
--no-prune do not prune jsonnet output
--prune prune jsonnet output
--quiet set quiet mode, only critical output
--output-path PATH set output path, default is "."
--targets TARGETS [TARGETS ...], -t TARGETS [TARGETS ...]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
labels:
name: minikube-es
name: minikube-es
namespace: minikube-es
spec: {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
name: default
name: default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ data:
MYSQL_ROOT_PASSWORD: ?{gpg:mysql/root/password:20632339}
kind: Secret
metadata:
annotations: {}
labels:
name: example-mysql
name: example-mysql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
name: example-mysql-jsonnet
name: example-mysql-jsonnet
namespace: minikube-mysql
spec:
clusterIP: None
loadBalancerSourceRanges: []
ports:
- name: mysql
port: 3306
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
annotations: {}
labels:
name: example-mysql
name: example-mysql
Expand All @@ -10,11 +11,13 @@ spec:
serviceName: example-mysql
template:
metadata:
annotations: {}
labels:
name: example-mysql
spec:
containers:
- env:
- args: []
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -26,6 +29,10 @@ spec:
ports:
- containerPort: 3306
name: mysql
volumeMounts: []
imagePullSecrets: []
initContainers: []
volumes: []
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
labels:
name: minikube-mysql
name: minikube-mysql
namespace: minikube-mysql
spec: {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
name: default
name: default
Expand Down
4 changes: 2 additions & 2 deletions kapitan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def main():
help='set search path, default is "."')
compile_parser.add_argument('--verbose', '-v', help='set verbose mode',
action='store_true', default=False)
compile_parser.add_argument('--no-prune', help='do not prune jsonnet output',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could keep it for a while and add a warning that it will be removed in the next version?

compile_parser.add_argument('--prune', help='prune jsonnet output',
action='store_true', default=False)
compile_parser.add_argument('--quiet', help='set quiet mode, only critical output',
action='store_true', default=False)
Expand Down Expand Up @@ -186,7 +186,7 @@ def main():

compile_targets(args.inventory_path, search_path, args.output_path,
args.parallelism, args.targets,
prune=(not args.no_prune), secrets_path=args.secrets_path,
prune=(args.prune), secrets_path=args.secrets_path,
secrets_reveal=args.reveal, indent=args.indent)

if not args.ignore_version_check:
Expand Down
4 changes: 2 additions & 2 deletions kapitan/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def compile_jsonnet(file_path, compile_path, search_path, ext_vars, **kwargs):
search_path and ext_vars will be passed as parameters to jsonnet_file()
kwargs:
output: default 'yaml', accepts 'json'
prune: default True, accepts False
prune: default False, accepts True
secrets_path: default None, set to access secrets backend
secrets_reveal: default False, set to reveal secrets on compile
target_name: default None, set to current target being compiled
Expand All @@ -249,7 +249,7 @@ def compile_jsonnet(file_path, compile_path, search_path, ext_vars, **kwargs):
json_output = json.loads(json_output)

output = kwargs.get('output', 'yaml')
prune = kwargs.get('prune', True)
prune = kwargs.get('prune', False)
secrets_path = kwargs.get('secrets_path', None)
secrets_reveal = kwargs.get('secrets_reveal', False)
target_name = kwargs.get('target_name', None)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
labels:
name: minikube-es
name: minikube-es
namespace: minikube-es
spec: {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
name: default
name: default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ data:
MYSQL_ROOT_PASSWORD: ?{gpg:mysql/root/password:20632339}
kind: Secret
metadata:
annotations: {}
labels:
name: example-mysql
name: example-mysql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
name: example-mysql-jsonnet
name: example-mysql-jsonnet
namespace: minikube-mysql
spec:
clusterIP: None
loadBalancerSourceRanges: []
ports:
- name: mysql
port: 3306
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
annotations: {}
labels:
name: example-mysql
name: example-mysql
Expand All @@ -10,11 +11,13 @@ spec:
serviceName: example-mysql
template:
metadata:
annotations: {}
labels:
name: example-mysql
spec:
containers:
- env:
- args: []
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -26,6 +29,10 @@ spec:
ports:
- containerPort: 3306
name: mysql
volumeMounts: []
imagePullSecrets: []
initContainers: []
volumes: []
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
labels:
name: minikube-mysql
name: minikube-mysql
namespace: minikube-mysql
spec: {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
name: default
name: default
Expand Down