-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(usage): add nil checks to avoid panic (#1720)
Once a PVC create request is processed by the CAST, the response is inspected to fetch the PVC name and other details to generate an analytics log. This was done as part of the PR: #1708 This commit adds a nil check to handle the case of an error response to avoid a panic. Signed-off-by: kmova <kiran.mova@mayadata.io>
- Loading branch information
Showing
7 changed files
with
94 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fix(apiserver): panic when PVC is created with name containing greater than 63 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,11 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: jiva-pvc-more-than-63-chars-long-due-helm-sub-chart-insallation-or-some-crazy-logic | ||
spec: | ||
storageClassName: openebs-jiva-default | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "5G" |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: cstor-testvolume-pvc | ||
name: jiva-testvolume-pvc | ||
namespace: openebs | ||
spec: | ||
storageClassName: openebs-jiva-default | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "5G" | ||
storage: "5G" |
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,34 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: device-pvc-more-than-63-chars-long-due-helm-sub-chart-insallation-or-some-crazy-logic | ||
spec: | ||
storageClassName: openebs-device | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "5G" | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: busybox-device | ||
namespace: default | ||
spec: | ||
containers: | ||
- command: | ||
- sh | ||
- -c | ||
- 'date > /mnt/store1/date.txt; hostname >> /mnt/store1/hostname.txt; sync; sleep 5; sync; tail -f /dev/null;' | ||
image: busybox | ||
imagePullPolicy: Always | ||
name: busybox | ||
volumeMounts: | ||
- mountPath: /mnt/store1 | ||
name: demo-vol1 | ||
volumes: | ||
- name: demo-vol1 | ||
persistentVolumeClaim: | ||
claimName: device-pvc-more-than-63-chars-long-due-helm-sub-chart-insallation-or-some-crazy-logic | ||
--- |
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,34 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: hostpath-pvc-more-than-63-chars-long-due-helm-sub-chart-insallation-or-some-crazy-logic | ||
spec: | ||
storageClassName: openebs-hostpath | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "5G" | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: busybox-hp | ||
namespace: default | ||
spec: | ||
containers: | ||
- command: | ||
- sh | ||
- -c | ||
- 'date > /mnt/store1/date.txt; hostname >> /mnt/store1/hostname.txt; sync; sleep 5; sync; tail -f /dev/null;' | ||
image: busybox | ||
imagePullPolicy: Always | ||
name: busybox | ||
volumeMounts: | ||
- mountPath: /mnt/store1 | ||
name: demo-vol1 | ||
volumes: | ||
- name: demo-vol1 | ||
persistentVolumeClaim: | ||
claimName: hostpath-pvc-more-than-63-chars-long-due-helm-sub-chart-insallation-or-some-crazy-logic | ||
--- |