fix: Remove any leading and trailing whitespace from resource before

exporting

Signed-off-by: Yiannis <yiannistri@users.noreply.github.com>
This commit is contained in:
Yiannis
2023-03-23 19:44:01 +00:00
parent 883815cd53
commit b55f49b4fe
18 changed files with 1 additions and 17 deletions

View File

@ -122,5 +122,6 @@ func printExport(export interface{}) error {
func resourceToString(data []byte) string {
data = bytes.Replace(data, []byte(" creationTimestamp: null\n"), []byte(""), 1)
data = bytes.Replace(data, []byte("status: {}\n"), []byte(""), 1)
data = bytes.TrimSpace(data)
return string(data)
}

View File

@ -12,4 +12,3 @@ spec:
ref:
branch: master
url: https://github.com/stefanprodan/podinfo

View File

@ -7,4 +7,3 @@ metadata:
spec:
interval: 5m0s
url: https://stefanprodan.github.io/charts/podinfo

View File

@ -10,4 +10,3 @@ spec:
name: creds
type: oci
url: oci://ghcr.io/stefanprodan/charts/podinfo

View File

@ -8,4 +8,3 @@ spec:
interval: 5m0s
type: oci
url: oci://ghcr.io/stefanprodan/charts/podinfo

View File

@ -14,4 +14,3 @@ spec:
providerRef:
name: slack
summary: Slacktest Notification

View File

@ -11,4 +11,3 @@ spec:
provider: aws
region: us-east-1
timeout: 30s

View File

@ -13,4 +13,3 @@ spec:
name: flux-system
timeout: 1m0s
url: ssh://git@github.com/example/repo

View File

@ -15,4 +15,3 @@ spec:
namespace: {{ .fluxns }}
version: '*'
interval: 5m0s

View File

@ -9,4 +9,3 @@ spec:
provider: generic
timeout: 1m0s
url: https://stefanprodan.github.io/podinfo

View File

@ -10,4 +10,3 @@ spec:
policy:
semver:
range: 5.0.x

View File

@ -10,4 +10,3 @@ spec:
image: ghcr.io/test/podinfo
interval: 1m0s
provider: generic

View File

@ -17,4 +17,3 @@ spec:
update:
path: ./clusters/my-cluster
strategy: Setters

View File

@ -11,4 +11,3 @@ spec:
sourceRef:
kind: GitRepository
name: flux-system

View File

@ -8,4 +8,3 @@ spec:
address: https://hooks.slack.com/services/mock
channel: A channel with spacess
type: slack

View File

@ -15,4 +15,3 @@ spec:
secretRef:
name: webhook-token
type: github

View File

@ -9,4 +9,3 @@ spec:
ref:
tag: 6.3.5
url: oci://ghcr.io/stefanprodan/manifests/podinfo

View File

@ -11,4 +11,3 @@ spec:
secretRef:
name: creds
url: oci://ghcr.io/stefanprodan/manifests/podinfo