-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some Readme things Clean up Ceph/knative/enmasse destroy commands Comments Add Tensorflow destroy TODO More testing with Go-test for every command Make Destroy commands a bit more stable Add Gstreamer Tool
- Loading branch information
astoycos
committed
Apr 24, 2020
1 parent
edabaca
commit 7411e06
Showing
31 changed files
with
3,992 additions
and
193 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
Copyright © 2020 NAME HERE <EMAIL ADDRESS> | ||
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 cmd | ||
|
||
import ( | ||
"github.com/IoTCLI/cmd/utils" | ||
"github.com/spf13/cobra" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
"k8s.io/kubectl/pkg/cmd/delete" | ||
"log" | ||
//"time" | ||
) | ||
|
||
//Made from Instructions @https://opendatahub.io/docs/administration/advanced-installation/object-storage.html for installing | ||
//ceph object storage via the rook operator | ||
func cephDestroy() { | ||
//Make command options for Knative Setup | ||
co := utils.NewCommandOptions() | ||
|
||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/route.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object-user.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/toolbox.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/cluster.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/operator.yaml") | ||
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/scc.yaml") | ||
|
||
IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() | ||
|
||
//Switch Context and Reload Config Flags | ||
co.SwitchContext("rook-ceph-system") | ||
|
||
log.Println("Provision Knative Source") | ||
for _, command := range co.Commands { | ||
cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams) | ||
//Kubectl signals missing field, set validate to false to ignore this | ||
cmd.Flags().Set("validate", "false") | ||
err := cmd.Flags().Set("filename", command) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
cmd.Run(cmd, []string{}) | ||
log.Print(out.String()) | ||
out.Reset() | ||
|
||
} | ||
|
||
} | ||
|
||
// destroyCmd represents the destroy command | ||
var cephDestroyCmd = &cobra.Command{ | ||
Use: "destroy", | ||
Short: "A brief description of your command", | ||
Long: `A longer description that spans multiple lines and likely contains examples | ||
and usage of using your command. For example: | ||
Cobra is a CLI library for Go that empowers applications. | ||
This application is a tool to generate the needed files | ||
to quickly create a Cobra application.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
log.Println("destroy called") | ||
cephDestroy() | ||
}, | ||
} | ||
|
||
func init() { | ||
cephCmd.AddCommand(cephDestroyCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// destroyCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// destroyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
} |
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,72 @@ | ||
/* | ||
Copyright © 2020 NAME HERE <EMAIL ADDRESS> | ||
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 cmd | ||
|
||
import ( | ||
"github.com/IoTCLI/cmd/utils" | ||
"github.com/spf13/cobra" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
"k8s.io/kubectl/pkg/cmd/get" | ||
"log" | ||
) | ||
|
||
func getCredentials() { | ||
co := utils.NewCommandOptions() | ||
|
||
co.Commands = append(co.Commands, "secrets") | ||
|
||
IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() | ||
|
||
//Switch Context and Reload Config Flags | ||
co.SwitchContext("rook-ceph") | ||
|
||
log.Print("Get S3 secrets, save for possible later use:") | ||
cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) | ||
cmd.Flags().Set("output", "json") | ||
cmd.Run(cmd, []string{co.Commands[0], "rook-ceph-object-user-my-store-odh-user"}) | ||
log.Print(out.String()) | ||
out.Reset() | ||
} | ||
|
||
// secretsCmd represents the secrets command | ||
var cephSecretsCmd = &cobra.Command{ | ||
Use: "secrets", | ||
Short: "A brief description of your command", | ||
Long: `A longer description that spans multiple lines and likely contains examples | ||
and usage of using your command. For example: | ||
Cobra is a CLI library for Go that empowers applications. | ||
This application is a tool to generate the needed files | ||
to quickly create a Cobra application.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
log.Println("Ceph Secrets called") | ||
getCredentials() | ||
}, | ||
} | ||
|
||
func init() { | ||
cephCmd.AddCommand(cephSecretsCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// secretsCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// secretsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
} |
Oops, something went wrong.