-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
--delete-previous
option to tk export
Documented in `exporting.md`. This option allows us to delete the previously exported manifests for an environment. This is useful when exporting a single environment and merging the result with an existing GitOps repository, rather than re-exporting all environments. I also added benchmark and a test for the export code.
- Loading branch information
1 parent
0aba526
commit 372e749
Showing
7 changed files
with
328 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
pkg/tanka/testdata/test-export-envs/inline-envs/main.jsonnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[ | ||
{ | ||
apiVersion: 'tanka.dev/v1alpha1', | ||
kind: 'Environment', | ||
metadata: { | ||
name: env.namespace, | ||
labels: { | ||
type: 'inline', | ||
}, | ||
}, | ||
spec: { | ||
apiServer: 'https://localhost', | ||
namespace: env.namespace, | ||
}, | ||
data: | ||
{ | ||
deployment: { | ||
apiVersion: 'apps/v1', | ||
kind: 'Deployment', | ||
metadata: { | ||
name: 'my-deployment', | ||
}, | ||
}, | ||
service: { | ||
apiVersion: 'v1', | ||
kind: 'Service', | ||
metadata: { | ||
name: 'my-service', | ||
}, | ||
}, | ||
} + | ||
(if env.hasConfigMap then { | ||
configMap: { | ||
apiVersion: 'v1', | ||
kind: 'ConfigMap', | ||
metadata: { | ||
name: 'my-configmap', | ||
}, | ||
}, | ||
} else {}), | ||
} | ||
|
||
for env in [ | ||
{ | ||
namespace: 'inline-namespace1', | ||
hasConfigMap: true, | ||
}, | ||
{ | ||
namespace: 'inline-namespace2', | ||
hasConfigMap: false, | ||
}, | ||
] | ||
] |
Oops, something went wrong.