-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 #16438 from juanvallejo/jvallejo/prevent-oc-rollou…
…t-panic Automatic merge from submit-queue (batch tested with PRs 16861, 16438). Prevent `oc rollout` panic when resource given is not a dc Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1493071 Prevents nil pointer dereference by skipping command logic when given resource is not of type *deployapi.DeploymentConfig. **Before** ``` $ oc rollout cancel rc/my-rc-1 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x189 pc=0x3821780] ... ``` **After** ``` $ oc rollout cancel rc/my-rc-1 error: expected deployment configuration, got *api.ReplicationController ``` cc @openshift/cli-review
- Loading branch information
Showing
5 changed files
with
90 additions
and
1 deletion.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
test/integration/testdata/test-replication-controller.yaml
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,31 @@ | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
annotations: | ||
openshift.io/deployment-config.latest-version: "1" | ||
openshift.io/deployment-config.name: test-deployment | ||
openshift.io/deployment.phase: Complete | ||
optnshift.io/deployment.replicas: "1" | ||
name: test-replication-controller | ||
spec: | ||
replicas: 1 | ||
selector: | ||
deployment: test-deployment | ||
deploymentconfig: test-deployment | ||
template: | ||
metadata: | ||
labels: | ||
deployment: test-deployment | ||
deploymentconfig: test-deployment | ||
spec: | ||
containers: | ||
- image: openshift/origin-pod | ||
imagePullPolicy: IfNotPresent | ||
name: ruby-helloworld | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
resources: {} | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
status: {} |