Skip to content

Commit

Permalink
Merge pull request #524 from parth-gr/external-healtcheker
Browse files Browse the repository at this point in the history
Bug 2242269: external: fix client health checker user keyring return
  • Loading branch information
travisn authored Oct 9, 2023
2 parents 214e8dc + 0162bd0 commit 3d0539d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 12 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/canary-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ jobs:
# print existing client auth
kubectl -n rook-ceph exec $toolbox -- ceph auth ls
- name: test re-running of external script should result in same output
run: |
toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}')
kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name=replicapool | tee output1.txt
kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name=replicapool | tee output2.txt
if cmp output1.txt output2.txt; then
echo "files have same output"
rm output1.txt
rm output2.txt
else
echo "re-run with same flags changed the output, result in failure"
rm output1.txt
rm output2.txt
exit 1
fi
- name: dry run external script create-external-cluster-resources.py
run: |
toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}')
Expand Down Expand Up @@ -157,7 +173,7 @@ jobs:
kubectl -n rook-ceph exec $toolbox -- ceph auth ls
# update the existing non-restricted client auth with the new ones
kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade
# print ugraded client auth
# print upgraded client auth
kubectl -n rook-ceph exec $toolbox -- ceph auth ls
- name: test the upgrade flag for restricted auth user
Expand All @@ -168,7 +184,7 @@ jobs:
# restricted auth user need to provide --rbd-data-pool-name,
# --cluster-name and --run-as-user flag while upgrading
kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --upgrade --rbd-data-pool-name replicapool --cluster-name rookstorage --run-as-user client.csi-rbd-node-rookstorage-replicapool
# print ugraded client auth
# print upgraded client auth
kubectl -n rook-ceph exec $toolbox -- ceph auth get client.csi-rbd-node-rookstorage-replicapool
- name: validate-rgw-endpoint
Expand Down Expand Up @@ -1277,7 +1293,7 @@ jobs:
# snaps=$(kubectl -n rook-ceph exec deploy/rook-ceph-fs-mirror -- ceph --admin-daemon /var/run/ceph/$mirror_daemon fs mirror peer status myfs@1 $clusterfsid|jq -r '."/volumes/_nogroup/testsubvolume"."snaps_synced"')
# echo "snapshots: $snaps"
# if [ $num_snaps_target = $snaps ]
# then echo "Snaphots have synced."
# then echo "Snapshots have synced."
# else echo "Snaps have not synced. NEEDS INVESTIGATION"
# fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ kubectl create -f object-multisite-pull-realm.yaml
## Scaling a Multisite

Scaling the number of gateways that run the synchronization thread to 2 or more can increase the latency of the
replication of each S3 object. The recommended way to scale a mutisite configuration is to dissociate the gateway dedicated
replication of each S3 object. The recommended way to scale a multisite configuration is to dissociate the gateway dedicated
to the synchronization from gateways that serve clients.

The two types of gateways can be deployed by creating two CephObjectStores associated with the same CephObjectZone. The
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Storage-Configuration/ceph-teardown.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ partprobe $DISK
```

Ceph can leave LVM and device mapper data that can lock the disks, preventing the disks from being
used again. These steps can help to free up old Ceph disks for re-use. Note that this only needs to
used again. These steps can help to free up old Ceph disks for reuse. Note that this only needs to
be run once on each node. If you have **only one** Rook cluster and **all** Ceph disks are
being wiped, run the following command.

Expand Down
2 changes: 1 addition & 1 deletion cmd/rook/rook/rook.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func GetInternalOrExternalClient() kubernetes.Interface {
for _, kConf := range strings.Split(kubeconfig, ":") {
restConfig, err = clientcmd.BuildConfigFromFlags("", kConf)
if err == nil {
logger.Debugf("attmepting to create kube clientset from kube config file %q", kConf)
logger.Debugf("attempting to create kube clientset from kube config file %q", kConf)
clientset, err = kubernetes.NewForConfig(restConfig)
if err == nil {
logger.Infof("created kube client interface from kube config file %q present in KUBECONFIG environment variable", kConf)
Expand Down
8 changes: 5 additions & 3 deletions deploy/examples/create-external-cluster-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
try:
# for 2.7.x
from urlparse import urlparse
from urllib import urlencode as urlencode
except ModuleNotFoundError:
# for 3.x
from urllib.parse import urlparse
from urllib.parse import urlencode as urlencode

try:
from base64 import encodestring
Expand Down Expand Up @@ -555,7 +557,7 @@ def _check_conflicting_options(self):
)

def _invalid_endpoint(self, endpoint_str):
# seprating port, by getting last split of `:` delimiter
# separating port, by getting last split of `:` delimiter
try:
endpoint_str_ip, port = endpoint_str.rsplit(":", 1)
except ValueError:
Expand Down Expand Up @@ -1160,7 +1162,7 @@ def create_checkerKey(self, user):
# check if user already exist
user_key = self.check_user_exist(entity)
if user_key != "":
return user_key, f"{entity.split('.', 1)[1]}"
return user_key

ret_val, json_out, err_msg = self._common_cmd_json_gen(cmd_json)
# if there is an unsuccessful attempt,
Expand Down Expand Up @@ -1363,7 +1365,7 @@ def get_rgw_fsid(self, base_url, verify):
rgw_endpoint = self._arg_parser.rgw_endpoint
base_url = base_url + "://" + rgw_endpoint + "/admin/info?"
params = {"format": "json"}
request_url = base_url + urllib.parse.urlencode(params)
request_url = base_url + urlencode(params)

try:
r = requests.get(
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/multus/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (s *getExpectedNumberOfImagePullPodsState) Run(
}

/*
* Re-usable state to verify that expected number of pods are "Running" but not necessarily "Ready"
* Reusable state to verify that expected number of pods are "Running" but not necessarily "Ready"
* > Verify all image pull pods are running
* -- next state --> Delete image pull daemonset
* > Verify all client pods are running
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/ceph/object/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func CommitConfigChanges(c *Context) error {
return errorOrIsNotFound(err, "failed to get the current RGW configuration period to see if it needs changed")
}

// this stages the current config changees and returns what the new period config will look like
// this stages the current config changes and returns what the new period config will look like
// without committing the changes
stagedPeriod, err := runAdminCommand(c, true, "period", "update")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/clients/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CreateBlockOperation(k8shelp *utils.K8sHelper, manifests installer.CephMani
// BlockCreate Function to create a Block using Rook
// Input parameters -
// manifest - pod definition that creates a pvc in k8s - yaml should describe name and size of pvc being created
// size - not user for k8s implementation since its descried on the pvc yaml definition
// size - not user for k8s implementation since its described on the pvc yaml definition
// Output - k8s create pvc operation output and/or error
func (b *BlockOperation) Create(manifest string, size int) (string, error) {
args := []string{"apply", "-f", "-"}
Expand Down

0 comments on commit 3d0539d

Please sign in to comment.