-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spin datamgr to datamgr_install and datamgr_server
- Loading branch information
1 parent
b90d103
commit 642a208
Showing
12 changed files
with
106 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright 2020 the Velero contributors. | ||
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 main | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/cmd" | ||
"github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/cmd/datamgr_install" | ||
|
||
"k8s.io/klog" | ||
) | ||
|
||
func main() { | ||
defer klog.Flush() | ||
|
||
baseName := filepath.Base(os.Args[0]) | ||
|
||
err := datamgr_install.NewCommand(baseName).Execute() | ||
cmd.CheckError(err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Copyright 2020 the Velero contributors. | ||
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 datamgr_install | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/vmware-tanzu/velero-plugin-for-vsphere/pkg/cmd/datamgr_install/cli/install" | ||
"github.com/spf13/cobra" | ||
"k8s.io/klog" | ||
|
||
"github.com/vmware-tanzu/velero/pkg/client" | ||
//"github.com/vmware-tanzu/velero/pkg/features" | ||
) | ||
|
||
func NewCommand(name string) *cobra.Command { | ||
// Load the config here so that we can extract features from it. | ||
config, err := client.LoadConfig() | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "WARNING: Error reading config file: %v\n", err) | ||
} | ||
|
||
c := &cobra.Command{ | ||
Use: name, | ||
Short: "Upload and download snapshots of persistent volume on vSphere kubernetes cluster", | ||
Long: `Data manager is a component in Velero vSphere plugin for | ||
moving local snapshotted data from/to remote durable persistent storage. | ||
Specifically, the data manager component is supposed to be running | ||
in separate container from the velero server`, | ||
} | ||
|
||
f := client.NewFactory(name, config) | ||
f.BindFlags(c.PersistentFlags()) | ||
|
||
c.AddCommand( | ||
install.NewCommand(f), | ||
) | ||
|
||
// init and add the klog flags | ||
klog.InitFlags(flag.CommandLine) | ||
c.PersistentFlags().AddGoFlagSet(flag.CommandLine) | ||
|
||
return c | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters