Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add object storage functions #74

Closed
wants to merge 0 commits into from
Closed

Conversation

mamclaughlin
Copy link
Contributor

Description

Related Issues

Checklist:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you linted your code locally prior to submission?
  • Have you successfully ran tests with your changes locally?

cmd/objectStorage.go Outdated Show resolved Hide resolved
cmd/objectStorage.go Outdated Show resolved Hide resolved
cmd/objectStorage.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@pgaskin pgaskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly just a few unchecked errors and missing newlines after formatted print statements.

cmd/objectStorage.go Outdated Show resolved Hide resolved
objstorage, err := client.ObjectStorage.Create(context.TODO(), objectStoreClusterID, label)

if err != nil {
fmt.Printf("error creating object storage : %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("error creating object storage : %v", err)
fmt.Printf("error creating object storage : %v\n", err)

os.Exit(1)
}

fmt.Printf("created object storage - ID : %v", objstorage.ID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("created object storage - ID : %v", objstorage.ID)
fmt.Printf("created object storage - ID : %v\n", objstorage.ID)

var objStorageLabelSet = &cobra.Command{
Use: "label <objectStorageID>",
Short: "change the label for object storage subscription",
Long: ``,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


err := client.ObjectStorage.SetLabel(context.TODO(), id, label)
if err != nil {
fmt.Printf("error setting label : %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("error setting label : %v", err)
fmt.Printf("error setting label : %v\n", err)

cluster, err := client.ObjectStorage.ListCluster(context.TODO())

if err != nil {
fmt.Printf("error getting object storage clusters : %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("error getting object storage clusters : %v", err)
fmt.Printf("error getting object storage clusters : %v\n", err)

Short: "regenerate the S3 API keys of an object storage subscription",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
id, _ := strconv.Atoi(args[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't checked either.

s3Keys, err := client.ObjectStorage.RegenerateKeys(context.TODO(), id, s3AccessKey)

if err != nil {
fmt.Printf("error regenerating object storage keys : %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("error regenerating object storage keys : %v", err)
fmt.Printf("error regenerating object storage keys : %v\n", err)

err := client.ObjectStorage.Delete(context.TODO(), id)

if err != nil {
fmt.Printf("error destroying object storage subscription : %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Printf("error destroying object storage subscription : %v", err)
fmt.Printf("error destroying object storage subscription : %v\n", err)

Short: "destroys an object storage subscription",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
id, _ := strconv.Atoi(args[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

@ddymko
Copy link
Contributor

ddymko commented Feb 19, 2020

@mamclaughlin

  • Can we create a get call and only allow the list call to just return a list
  • change list_cluster to list-cluster
  • change s3key_regenerate... to s3key-regenerate
  • camelcase things such as objstorage to objStorage
  • objStorageDestroy you should validate that we received the objectStorageID. Similar how its done in other spots such as the objStorageLabelSet call
  • ^^ also for objStorageS3KeyRegenerate

@ddymko ddymko added this to the v0.2.0 milestone Mar 2, 2020
@ddymko ddymko added the enhancement New feature or request label Mar 9, 2020
@ddymko ddymko closed this Mar 11, 2020
This was referenced Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants