-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from subhamkrai/add-radosgw-admin
core: adding 'radosgw-admin' command support
- Loading branch information
Showing
6 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright 2024 The Rook Authors. All rights reserved. | ||
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 command | ||
|
||
import ( | ||
"github.com/rook/kubectl-rook-ceph/pkg/exec" | ||
"github.com/rook/kubectl-rook-ceph/pkg/logging" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// RadosgwCmd represents the radosgw command | ||
var RadosgwCmd = &cobra.Command{ | ||
Use: "radosgw-admin", | ||
Short: "call a 'radosgw-admin' CLI command", | ||
DisableFlagParsing: true, | ||
Args: cobra.MinimumNArgs(1), | ||
PreRun: func(cmd *cobra.Command, args []string) { | ||
verifyOperatorPodIsRunning(cmd.Context(), clientSets) | ||
}, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
logging.Info("running 'radosgw-admin' command with args: %v", args) | ||
_, err := exec.RunCommandInOperatorPod(cmd.Context(), clientSets, cmd.Use, args, operatorNamespace, cephClusterNamespace, false) | ||
if err != nil { | ||
logging.Fatal(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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,6 @@ func addcommands() { | |
command.SubvolumeCmd, | ||
command.RadosCmd, | ||
command.FlattenRBDPVCCmd, | ||
command.RadosgwCmd, | ||
) | ||
} |
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,18 @@ | ||
# radosgw-admin | ||
|
||
This runs any radosgw-admin CLI command with arbitrary args. | ||
|
||
## Examples | ||
|
||
```bash | ||
kubectl rook-ceph radosgw-admin user create --display-name="my user" --uid=myuser | ||
|
||
# Info: running 'radosgw-admin' command with args: [user create --display-name=my-user --uid=myuser] | ||
# { | ||
# "user_id": "myuser", | ||
# "display_name": "my user", | ||
# ... | ||
# ... | ||
# ... | ||
# } | ||
``` |
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