migtools / crane

Tool for migrating Kubernetes workloads, and their data, between clusters.
https://www.konveyor.io/tools/crane/
Apache License 2.0
42 stars 23 forks source link

Allow restricting export using a label selector #142

Closed jmontleon closed 2 years ago

jmontleon commented 2 years ago
$ rm -rf export
$ crane export -l "app=mariadb-1" 2>/dev/null
$ ls export/resources/mediawiki/
Deployment_apps_v1_mediawiki_mariadb-1.yaml                       Pod__v1_mediawiki_mariadb-1-68bd8b966d-2rntb.yaml
EndpointSlice_discovery.k8s.io_v1_mediawiki_mariadb-1-6xrtw.yaml  ReplicaSet_apps_v1_mediawiki_mariadb-1-68bd8b966d.yaml
Endpoints__v1_mediawiki_mariadb-1.yaml                            Service__v1_mediawiki_mariadb-1.yaml

$ rm -rf export
$ crane export -l "app=mariadb-2,service=mariadb" 2>/dev/null
$ ls export/resources/mediawiki/
Deployment_apps_v1_mediawiki_mariadb-2.yaml                       Pod__v1_mediawiki_mariadb-2-64b44675c9-2blsp.yaml       Service__v1_mediawiki_mariadb-2.yaml
EndpointSlice_discovery.k8s.io_v1_mediawiki_mariadb-2-bcjzr.yaml  ReplicaSet_apps_v1_mediawiki_mariadb-2-64b44675c9.yaml
Endpoints__v1_mediawiki_mariadb-2.yaml                            ReplicaSet_apps_v1_mediawiki_mariadb-2-78bb6b6796.yaml

$ rm -rf export
$ crane export -l "service=mariadb" 2>/dev/null
$ ls export/resources/mediawiki/
Deployment_apps_v1_mediawiki_mariadb-1.yaml                       Pod__v1_mediawiki_mariadb-2-64b44675c9-2blsp.yaml
Deployment_apps_v1_mediawiki_mariadb-2.yaml                       ReplicaSet_apps_v1_mediawiki_mariadb-1-68bd8b966d.yaml
EndpointSlice_discovery.k8s.io_v1_mediawiki_mariadb-1-6xrtw.yaml  ReplicaSet_apps_v1_mediawiki_mariadb-2-64b44675c9.yaml
EndpointSlice_discovery.k8s.io_v1_mediawiki_mariadb-2-bcjzr.yaml  ReplicaSet_apps_v1_mediawiki_mariadb-2-78bb6b6796.yaml
Endpoints__v1_mediawiki_mariadb-1.yaml                            Service__v1_mediawiki_mariadb-1.yaml
Endpoints__v1_mediawiki_mariadb-2.yaml                            Service__v1_mediawiki_mariadb-2.yaml
openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmontleon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/konveyor/crane/blob/main/OWNERS)~~ [jmontleon] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
JaydipGabani commented 2 years ago

/lgtm