Skip to content

Commit

Permalink
Remove type field from stable blueprints (#1011)
Browse files Browse the repository at this point in the history
Since we are upgrading the CRDs to `v1` from `v1beta1`, and we
don't actually specify `type` field in our `types.go` we wont
have `types` field in the CR schema. And because of that if
we create a blueprint with `types` in it, the validation would
failed.

I see there would be a problem when these applications are being
called from k10, because it looks like k10 needs type for `delete`
action.

I still am looking into if we really need that or we can change that.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
viveksinghggits and mergify[bot] committed Jun 14, 2021
1 parent 936c938 commit 2de353a
Show file tree
Hide file tree
Showing 26 changed files with 4 additions and 65 deletions.
5 changes: 1 addition & 4 deletions examples/stable/cassandra/cassandra-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: cassandra-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
params:
keyValue:
Expand Down Expand Up @@ -90,7 +89,6 @@ actions:
- |
rm -rf {{ .Phases.getBackupPrefixLocation.Output.localSnapshotPrefixLocation }}
restore:
type: StatefulSet
inputArtifactNames:
- params
phases:
Expand Down Expand Up @@ -173,9 +171,8 @@ actions:
cd ..
done
fi
rm -rf {{ .ArtifactsIn.params.KeyValue.snapshotPrefix }}
rm -rf {{ .ArtifactsIn.params.KeyValue.snapshotPrefix }}
delete:
type: Namespace
inputArtifactNames:
- params
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ actions:
--force-updates
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `cbBackup.KopiaSnapshot`
Expand Down
1 change: 0 additions & 1 deletion examples/stable/couchbase/couchbase-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ actions:
--force-updates
delete:
type: Namespace
phases:
- func: KubeTask
name: deleteBackup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: elasticsearch-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
esBackup:
# Capture the kopia snapshot information for subsequent actions
Expand All @@ -31,7 +30,6 @@ actions:
gzip /backup
kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" /backup.gz
restore:
type: StatefulSet
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `esBackup.KopiaSnapshot`
Expand All @@ -55,7 +53,6 @@ actions:
kopia_snap='{{ .ArtifactsIn.esBackup.KopiaSnapshot }}'
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | gunzip | elasticdump --bulk=true --input=$ --output=http://${host_name}:9200
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `esBackup.KopiaSnapshot`
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/elasticsearch/elasticsearch-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: elasticsearch-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
cloudObject:
keyValue:
Expand All @@ -30,7 +29,6 @@ actions:
kando location push --profile '{{ toJson .Profile }}' /backup.gz --path $BACKUP_LOCATION
kando output backupLocation $BACKUP_LOCATION
restore:
type: StatefulSet
inputArtifactNames:
- cloudObject
phases:
Expand All @@ -50,7 +48,6 @@ actions:
host_name="{{ .Object.spec.serviceName }}.{{ .StatefulSet.Namespace }}.svc.cluster.local"
kando location pull --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsIn.cloudObject.KeyValue.backupLocation }}' - | gunzip | elasticdump --bulk=true --input=$ --output=http://${host_name}:9200
delete:
type: Namespace
inputArtifactNames:
- cloudObject
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ actions:
fdbrestore start --dest_cluster_file /var/dynamic-conf/fdb.cluster -r file:///data/restored/fdbbackup/$backupname -w
pkill -9 backup_agent
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `fdbBackup.KopiaSnapshot`
Expand Down
8 changes: 3 additions & 5 deletions examples/stable/foundationdb/foundationdb-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ actions:
- errexit
- -c
- |
#we are manually starting backup_aegnt here because fdb operator doesnt have support for
#we are manually starting backup_aegnt here because fdb operator doesnt have support for
# backup and restore right now. But they are planning to have it, going further.
# Once they have the support for backup and restore we will change this to accommodate upstream changes
/usr/bin/backup_agent -C /var/dynamic-conf/fdb.cluster &
Expand All @@ -33,7 +33,7 @@ actions:
fdbbackup start -d file:///data/fdbbackup -w
pkill -9 backup_agent
tar zcvf - -C /data/ fdbbackup | kando location push --profile '{{ toJson .Profile }}' --path '/foundationdb-backups/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15-04-05" }}/backup.tgz' -
rm -rf /data/fdbbackup
rm -rf /data/fdbbackup
restore:
kind: CustomResource
inputArtifactNames:
Expand All @@ -48,7 +48,7 @@ actions:
command:
- bash
- -o
- pipefail
- pipefail
- -o
- errexit
- -c
Expand All @@ -61,7 +61,6 @@ actions:
fdbrestore start --dest_cluster_file /var/dynamic-conf/fdb.cluster -r file:///data/restored/fdbbackup/$backupname -w
pkill -9 backup_agent
delete:
type: Namespace
phases:
- func: KubeTask
name: deleteBackup
Expand All @@ -78,4 +77,3 @@ actions:
- |
s3path='{{ .ArtifactsIn.fdbBackup.KeyValue.path }}'
kando location delete --profile '{{ toJson .Profile }}' --path ${s3path}
3 changes: 0 additions & 3 deletions examples/stable/maria/blueprint-v2/maria-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: maria-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
mariaBackup:
# Capture the kopia snapshot information for subsequent actions
Expand Down Expand Up @@ -41,7 +40,6 @@ actions:
dump_cmd="mysqldump -u root --password=${root_password} -h {{ .StatefulSet.Name }} --column-statistics=0 --single-transaction --databases ${dump_databases}"
${dump_cmd} | gzip - | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -
restore:
type: StatefulSet
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mariaBackup.KopiaSnapshot`
Expand Down Expand Up @@ -70,7 +68,6 @@ actions:
root_password="{{ index .Phases.restoreFromStore.Secrets.mariaSecret.Data "mariadb-root-password" | toString }}"
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | gunzip | mysql -u root --password=${root_password} -h {{ .StatefulSet.Name }}
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mariaBackup.KopiaSnapshot`
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/maria/maria-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: maria-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
mariaCloudDump:
keyValue:
Expand Down Expand Up @@ -39,7 +38,6 @@ actions:
mysqldump -u root --password=${root_password} -h {{ .StatefulSet.Name }} --column-statistics=0 --single-transaction --databases ${dump_databases} | gzip - | kando location push --profile '{{ toJson .Profile }}' --path ${s3_path} -
kando output s3path ${s3_path}
restore:
type: StatefulSet
inputArtifactNames:
- mariaCloudDump
phases:
Expand All @@ -65,7 +63,6 @@ actions:
root_password="{{ index .Phases.restoreFromBlobStore.Secrets.mariaSecret.Data "mariadb-root-password" | toString }}"
kando location pull --profile '{{ toJson .Profile }}' --path ${s3_path} - | gunzip | mysql -u root --password=${root_password} -h {{ .StatefulSet.Name }}
delete:
type: Namespace
inputArtifactNames:
- mariaCloudDump
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: DeploymentConfig
outputArtifacts:
mongoBackup:
# Capture the kopia snapshot information for subsequent actions
Expand Down Expand Up @@ -37,7 +36,6 @@ actions:
backup_file_path='rs_backup.gz'
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -
restore:
type: DeploymentConfig
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mongoBackup.KopiaSnapshot`
Expand Down Expand Up @@ -68,7 +66,6 @@ actions:
kopia_snap='{{ .ArtifactsIn.mongoBackup.KopiaSnapshot }}'
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mongoBackup.KopiaSnapshot`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: DeploymentConfig
outputArtifacts:
cloudObject:
keyValue:
Expand Down Expand Up @@ -34,7 +33,6 @@ actions:
echo $dump_cmd
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path '/mongodb-replicaset-backups/{{ .DeploymentConfig.Name }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15-04-05" }}/rs_backup.gz' -
restore:
type: DeploymentConfig
inputArtifactNames:
- cloudObject
phases:
Expand All @@ -61,7 +59,6 @@ actions:
restore_cmd="mongorestore --gzip --archive --drop --host ${host} -u admin -p ${dbPassword}"
kando location pull --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsIn.cloudObject.KeyValue.path }}' - | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
- cloudObject
phases:
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/mongodb-restic/mongodb-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
backupInfo:
keyValue:
Expand All @@ -18,7 +17,6 @@ actions:
includePath: /bitnami/mongodb
backupArtifactPrefix: "{{ .Profile.Location.Bucket }}/mongodb-backups/{{ .StatefulSet.Name }}/rs_backup"
restore:
type: StatefulSet
phases:
# Scale down mongodb replicas
- func: ScaleWorkload
Expand Down Expand Up @@ -77,7 +75,6 @@ actions:
replicas: 1

delete:
type: Namespace
phases:
- func: DeleteDataAll
name: deleteSnapshots
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/mongodb/7.8.10/mongo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
cloudObject:
keyValue:
Expand Down Expand Up @@ -33,7 +32,6 @@ actions:
dump_cmd="mongodump --oplog --gzip --archive --host ${host} -u root -p ${dbPassword}"
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path '/mongodb-replicaset-backups/{{ .StatefulSet.Name }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15-04-05" }}/rs_backup.gz' -
restore:
type: StatefulSet
inputArtifactNames:
- cloudObject
phases:
Expand All @@ -60,7 +58,6 @@ actions:
restore_cmd="mongorestore --gzip --archive --oplogReplay --drop --host ${host} -u root -p ${dbPassword}"
kando location pull --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsIn.cloudObject.KeyValue.path }}' - | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
- cloudObject
phases:
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/mongodb/blueprint-v2/mongo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
mongoBackup:
# Capture the kopia snapshot information for subsequent actions
Expand Down Expand Up @@ -36,7 +35,6 @@ actions:
backup_file_path='rs_backup.gz'
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -
restore:
type: StatefulSet
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mongoBackup.KopiaSnapshot`
Expand Down Expand Up @@ -67,7 +65,6 @@ actions:
kopia_snap='{{ .ArtifactsIn.mongoBackup.KopiaSnapshot }}'
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mongoBackup.KopiaSnapshot`
Expand Down
3 changes: 0 additions & 3 deletions examples/stable/mongodb/mongo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mongodb-blueprint
actions:
backup:
type: StatefulSet
outputArtifacts:
cloudObject:
keyValue:
Expand Down Expand Up @@ -33,7 +32,6 @@ actions:
dump_cmd="mongodump --oplog --gzip --archive --host ${host} -u root -p ${dbPassword}"
${dump_cmd} | kando location push --profile '{{ toJson .Profile }}' --path '/mongodb-replicaset-backups/{{ .StatefulSet.Name }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15-04-05" }}/rs_backup.gz' -
restore:
type: StatefulSet
inputArtifactNames:
- cloudObject
phases:
Expand All @@ -60,7 +58,6 @@ actions:
restore_cmd="mongorestore --gzip --archive --oplogReplay --drop --host ${host} -u root -p ${dbPassword}"
kando location pull --profile '{{ toJson .Profile }}' --path '{{ .ArtifactsIn.cloudObject.KeyValue.path }}' - | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
- cloudObject
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mysql-dep-config-blueprint
actions:
backup:
type: DeploymentConfig
outputArtifacts:
mysqlBackup:
# Capture the kopia snapshot information for subsequent actions
Expand Down Expand Up @@ -35,7 +34,6 @@ actions:
dump_cmd="mysqldump --column-statistics=0 -u root --password=${root_password} -h {{ .DeploymentConfig.Name }} --single-transaction --all-databases"
${dump_cmd} | gzip - | kando location push --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --output-name "kopiaOutput" -
restore:
type: DeploymentConfig
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mysqlBackup.KopiaSnapshot`
Expand Down Expand Up @@ -65,7 +63,6 @@ actions:
restore_cmd="mysql -u root --password=${root_password} -h {{ .DeploymentConfig.Name }}"
kando location pull --profile '{{ toJson .Profile }}' --path "${backup_file_path}" --kopia-snapshot "${kopia_snap}" - | gunzip | ${restore_cmd}
delete:
type: Namespace
inputArtifactNames:
# The kopia snapshot info created in backup phase can be used here
# Use the `--kopia-snapshot` flag in kando to pass in `mysqlBackup.KopiaSnapshot`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: mysql-dep-config-blueprint
actions:
backup:
type: DeploymentConfig
outputArtifacts:
mysqlCloudDump:
keyValue:
Expand Down Expand Up @@ -33,7 +32,6 @@ actions:
mysqldump --column-statistics=0 -u root --password=${root_password} -h {{ .DeploymentConfig.Name }} --single-transaction --all-databases | gzip - | kando location push --profile '{{ toJson .Profile }}' --path ${s3_path} -
kando output s3path ${s3_path}
restore:
type: DeploymentConfig
inputArtifactNames:
- mysqlCloudDump
phases:
Expand All @@ -59,7 +57,6 @@ actions:
root_password="{{ index .Phases.restoreFromBlobStore.Secrets.mysqlsecret.Data "database-root-password" | toString }}"
kando location pull --profile '{{ toJson .Profile }}' --path ${s3_path} - | gunzip | mysql -u root --password=${root_password} -h {{ .DeploymentConfig.Name }}
delete:
type: Namespace
inputArtifactNames:
- mysqlCloudDump
phases:
Expand Down

0 comments on commit 2de353a

Please sign in to comment.