Skip to content

Commit

Permalink
Merge pull request #7821 from phantomjinx/1.9.x
Browse files Browse the repository at this point in the history
BACKPORT: ENTESB-12645: Extend db backup to cover external databases
  • Loading branch information
phantomjinx committed Feb 5, 2020
2 parents 4b4d746 + dfe90bf commit 0a0879f
Show file tree
Hide file tree
Showing 105 changed files with 20,670 additions and 16,650 deletions.
5 changes: 3 additions & 2 deletions install/operator/go.mod
Expand Up @@ -13,14 +13,15 @@ require (
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
github.com/go-logr/logr v0.1.0
github.com/go-openapi/spec v0.19.4
github.com/google/go-cmp v0.3.2-0.20191028172631-481baca67f93 // indirect
github.com/imdario/mergo v0.3.8
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
github.com/openshift/api v3.9.1-0.20190927182313-d4a64ec2cbd8+incompatible
github.com/operator-framework/operator-sdk v0.15.0
github.com/pkg/errors v0.8.1
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.2.1
github.com/robfig/cron/v3 v3.0.1
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/spf13/cast v1.3.0
github.com/spf13/cobra v0.0.5
Expand Down
15 changes: 13 additions & 2 deletions install/operator/go.sum
Expand Up @@ -107,6 +107,7 @@ github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/cenk/backoff v2.0.0+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE=
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
Expand Down Expand Up @@ -370,6 +371,8 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.2-0.20191028172631-481baca67f93 h1:VvBteXw2zOXEgm0o3PgONTWf+bhUGsCaiNn3pbkU9LA=
github.com/google/go-cmp v0.3.2-0.20191028172631-481baca67f93/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v0.0.0-20150304233714-bbcb9da2d746/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
Expand All @@ -386,6 +389,7 @@ github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.0.0-20180520015035-48a0ecefe2e4/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
Expand Down Expand Up @@ -542,6 +546,7 @@ github.com/markbates/inflect v1.0.4 h1:5fh1gzTFhfae06u3hzHYO9xe3l3v3nW5Pwt3naLTP
github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs=
github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk=
github.com/martinlindhe/base36 v1.0.0/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8=
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a h1:+J2gw7Bw77w/fbK7wnNJJDKmw1IbWft2Ul5BzrG1Qm8=
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down Expand Up @@ -626,6 +631,8 @@ github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/
github.com/opencontainers/selinux v1.2.2/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs=
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible h1:6il8W875Oq9vycPkRV5TteLP9IfMEX3lyOl5yN+CtdI=
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
github.com/openshift/api v3.9.1-0.20190927182313-d4a64ec2cbd8+incompatible h1:YwFnUQ5RQ17CmkxHyjpQnWAQOGkLKXY0shOUEyqaCGk=
github.com/openshift/api v3.9.1-0.20190927182313-d4a64ec2cbd8+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b/go.mod h1:6rzn+JTr7+WYS2E1TExP4gByoABxMznR6y2SnUIkmxk=
github.com/openshift/origin v0.0.0-20160503220234-8f127d736703/go.mod h1:0Rox5r9C8aQn6j1oAOQ0c1uC86mYbUFObzjBRvUKHII=
github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw=
Expand Down Expand Up @@ -739,8 +746,8 @@ github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b h1:4kg1wyftSKxLtnPAvcRWakIPpokB9w780/KwrNLnfPA=
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/vfsgen v0.0.0-20180711163814-62bca832be04/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
Expand Down Expand Up @@ -913,6 +920,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -997,6 +1005,7 @@ gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmK
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 h1:ppLucX0K/60T3t6LPZQzTOkt5PytkEbQLIaSteq+TpE=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand All @@ -1017,6 +1026,7 @@ google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6 h1:UXl+Zk3jqqcbEVV7ace5lrt4YdA4tXiz3f/KbmD29Vo=
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
Expand All @@ -1026,6 +1036,7 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
Expand Down
87 changes: 87 additions & 0 deletions install/operator/pkg/apis/syndesis/v1beta1/object.go
@@ -0,0 +1,87 @@
/*
* Copyright (C) 2020 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package v1beta1

import (
"context"
"errors"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)

const DefaultNamespace string = "syndesis"

func NewSyndesis(namespace string) (*Syndesis, error) {
if len(namespace) == 0 {
return nil, errors.New("Creating a new Syndesis requires a namespace")
}

syndesis := &Syndesis{
TypeMeta: metav1.TypeMeta{
Kind: "Syndesis",
APIVersion: "syndesis.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
},
Spec: SyndesisSpec{
Components: ComponentsSpec{},
Addons: AddonsSpec{},
},
Status: SyndesisStatus{
TargetVersion: "latest",
},
}

return syndesis, nil
}

/*
* Look at the existing namespace and return the installed syndesis CR
*/
func InstalledSyndesis(ctx context.Context, c client.Client, namespace string) (*Syndesis, error) {
synList := &SyndesisList{}
// List restricted to the namespace as user not necessarily has
// permission to access all syndesises at the cluster level
err := c.List(ctx, synList, client.InNamespace(namespace))
if err != nil {
return nil, err
}

syndesis, _ := NewSyndesis(namespace)
for _, synRes := range synList.Items {
//
// TODO
// Should usually be 1
// In the event there is >1 then perhaps implement a choice switch to specify
// the name of the required resource
//

//
// Assign the uid and name of the syndesis CR
// Vital for the backup Job as it requires an
// owner reference and uses these credentials
//
syndesis.SetUID(synRes.GetUID())
syndesis.SetName(synRes.GetName())
return syndesis, nil
}

// None are installed
return nil, nil
}
59 changes: 51 additions & 8 deletions install/operator/pkg/cmd/internal/backup/backup.go
Expand Up @@ -17,19 +17,27 @@
package backup

import (
"errors"

"github.com/operator-framework/operator-sdk/pkg/log/zap"
"github.com/operator-framework/operator-sdk/pkg/restmapper"
"github.com/spf13/cobra"
"github.com/syndesisio/syndesis/install/operator/pkg/apis"
"github.com/syndesisio/syndesis/install/operator/pkg/apis/syndesis/v1beta1"
"github.com/syndesisio/syndesis/install/operator/pkg/cmd/internal"
"github.com/syndesisio/syndesis/install/operator/pkg/syndesis/backup"
"github.com/syndesisio/syndesis/install/operator/pkg/syndesis/configuration"
"github.com/syndesisio/syndesis/install/operator/pkg/util"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
)

type Backup struct {
*internal.Options
backupDir string
}

func New(parent *internal.Options) *cobra.Command {
func NewBackup(parent *internal.Options) *cobra.Command {
o := Backup{Options: parent}
cmd := cobra.Command{
Use: "backup",
Expand All @@ -38,21 +46,56 @@ func New(parent *internal.Options) *cobra.Command {
util.ExitOnError(o.Run())
},
}
cmd.PersistentFlags().StringVarP(&configuration.TemplateConfig, "operator-config", "", "/conf/config.yaml", "Path to the operator configuration file.")
cmd.Flags().StringVar(&o.backupDir, "backup", "backup", "The directory to store the back up in")
cmd.PersistentFlags().AddFlagSet(zap.FlagSet())
cmd.PersistentFlags().AddFlagSet(util.FlagSet)
return &cmd
}

func (o *Backup) prepare() (*v1beta1.Syndesis, client.Client, error) {
mgr, err := manager.New(o.GetClientConfig(), manager.Options{
Namespace: o.Namespace,
MapperProvider: restmapper.NewDynamicRESTMapper,
})
if err != nil {
return nil, nil, err
}

if err := apis.AddToScheme(mgr.GetScheme()); err != nil {
return nil, nil, err
}

cl, err := o.GetClient()
if err != nil {
return nil, nil, err
}

syndesis, err := v1beta1.InstalledSyndesis(o.Context, cl, o.Namespace)
if err != nil {
return nil, cl, err
}

if syndesis == nil {
return nil, cl, errors.New("No syndesis has been installed to backup its database")
}

return syndesis, cl, nil
}

func (o *Backup) Run() error {
b := backup.Backup{
Namespace: o.Namespace,
BackupDir: o.backupDir,
Context: o.Context,
Client: o.Client,
Delete: false,
LocalOnly: true,
syndesis, cl, err := o.prepare()
if err != nil {
return err
}

b, err := backup.NewBackup(o.Context, cl, syndesis, o.backupDir)
if err != nil {
return err
}

// Only backup to local location
b.SetLocalOnly(true)

return b.Run()
}
Expand Up @@ -14,43 +14,55 @@
* limitations under the License.
*/

package restore
package backup

import (
"github.com/operator-framework/operator-sdk/pkg/log/zap"
"github.com/spf13/cobra"
"github.com/syndesisio/syndesis/install/operator/pkg/cmd/internal"
"github.com/syndesisio/syndesis/install/operator/pkg/syndesis/backup"
"github.com/syndesisio/syndesis/install/operator/pkg/syndesis/configuration"
"github.com/syndesisio/syndesis/install/operator/pkg/util"
)

type Backup struct {
*internal.Options
backupDir string
type Restore struct {
*Backup
customOptions string
}

func New(parent *internal.Options) *cobra.Command {
o := Backup{Options: parent}
func NewRestore(parent *internal.Options) *cobra.Command {
o := Restore{
Backup: &Backup{
Options: parent,
},
}
cmd := cobra.Command{
Use: "restore",
Short: "restore the data that was previously backed up",
Run: func(_ *cobra.Command, _ []string) {
util.ExitOnError(o.Run())
},
}

cmd.PersistentFlags().StringVarP(&configuration.TemplateConfig, "operator-config", "", "/conf/config.yaml", "Path to the operator configuration file.")
cmd.Flags().StringVar(&o.backupDir, "backup", "/tmp/backup", "The directory where the backup is stored")
cmd.Flags().StringVar(&o.customOptions, "custom-options", "", "Set of custom options to provide to pg_restore (default: --no-password --clean --if-exists --create --verbose)")
cmd.PersistentFlags().AddFlagSet(zap.FlagSet())
cmd.PersistentFlags().AddFlagSet(util.FlagSet)
return &cmd
}

func (o *Backup) Run() error {
b := backup.Backup{
Namespace: o.Namespace,
BackupDir: o.backupDir,
Context: o.Context,
Client: o.Client,
func (o *Restore) Run() error {
syndesis, cl, err := o.prepare()
if err != nil {
return err
}

b, err := backup.NewBackup(o.Context, cl, syndesis, o.backupDir)
if err != nil {
return err
}

b.SetCustomOptions(o.customOptions)
return b.Restore()
}
16 changes: 1 addition & 15 deletions install/operator/pkg/cmd/internal/install/install_forge.go
Expand Up @@ -32,8 +32,6 @@ import (

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/yaml"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var exceptionalItems = []string{
Expand Down Expand Up @@ -164,19 +162,7 @@ func (o *Install) installForge() error {
// Create an empty syndesis CR which will
// be filled with parameters placeholder values
//
syndesis := &v1beta1.Syndesis{
ObjectMeta: metav1.ObjectMeta{
Namespace: convertToParam(string(EnvOpenShiftProject)),
},
Spec: v1beta1.SyndesisSpec{
Components: v1beta1.ComponentsSpec{},
Addons: v1beta1.AddonsSpec{},
},
Status: v1beta1.SyndesisStatus{
TargetVersion: "latest",
},
}

syndesis, _ := v1beta1.NewSyndesis(convertToParam(string(EnvOpenShiftProject)))
configuration, err := conf.GetProperties(conf.TemplateConfig, o.Context, nil, syndesis)
if err != nil {
return err
Expand Down

0 comments on commit 0a0879f

Please sign in to comment.