atomist / sdm-pack-k8s

Extension Pack for an Atomist SDM to integrate Kubernetes deployments
Apache License 2.0
3 stars 2 forks source link

Make fetch resource property filtering configurable with a function #64

Closed ddgenome closed 4 years ago

ddgenome commented 5 years ago

Currently when fetching resources from a cluster, we filter out common properties added by the system. This does not catch all properties in all resources. Unfortunately, it is difficult if not impossible to determine whether any given property was supplied by the creator or simply filled in by the system. If it is just a default, this isn't much of an issue, but if it is something like the service account secrets property, it could be harmful when trying to replicate or recreate a cluster. So let people replace the default property filter. One difficulty will be supplying that filter function when fetching from the command line since it can't be loaded from a JSON configuration.

ddgenome commented 5 years ago

The current filter function is cleanKubernetesSpec:

https://github.com/atomist/sdm-pack-k8s/blob/3e7e5da05a13ade00c824c99398877cb6d0fc83a/lib/kubernetes/fetch.ts#L311-L345