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

java.lang.IllegalArgumentException: Item needs to be one of [Node, Deployment, ReplicaSet, StatefulSet, Pod, DeploymentConfig, ReplicationController], but was: [Deployment] #2404

Closed
own-idea opened this issue Aug 17, 2020 · 4 comments · Fixed by #2407
Labels

Comments

@own-idea
Copy link
Contributor

version: 4.10.2
Deployment class has two, but Readiness.isReady method only test one. So exception throwed.

@rohanKanojia
Copy link
Member

@own-idea : Thanks for you bug report. You're right. We're not handling extensions Deployment here:

public static boolean isReady(HasMetadata item) {
if (item instanceof Deployment) {
return isDeploymentReady((Deployment) item);
} else if (item instanceof ReplicaSet) {
return isReplicaSetReady((ReplicaSet) item);
} else if (item instanceof Pod) {
return isPodReady((Pod) item);
} else if (item instanceof DeploymentConfig) {
return isDeploymentConfigReady((DeploymentConfig) item);
} else if (item instanceof ReplicationController) {
return isReplicationControllerReady((ReplicationController) item);
} else if (item instanceof Endpoints) {
return isEndpointsReady((Endpoints) item);
} else if (item instanceof Node) {
return isNodeReady((Node) item);

Would you like to create a PR to fix this?

@own-idea
Copy link
Contributor Author

@own-idea : Thanks for you bug report. You're right. We're not handling extensions Deployment here:

public static boolean isReady(HasMetadata item) {
if (item instanceof Deployment) {
return isDeploymentReady((Deployment) item);
} else if (item instanceof ReplicaSet) {
return isReplicaSetReady((ReplicaSet) item);
} else if (item instanceof Pod) {
return isPodReady((Pod) item);
} else if (item instanceof DeploymentConfig) {
return isDeploymentConfigReady((DeploymentConfig) item);
} else if (item instanceof ReplicationController) {
return isReplicationControllerReady((ReplicationController) item);
} else if (item instanceof Endpoints) {
return isEndpointsReady((Endpoints) item);
} else if (item instanceof Node) {
return isNodeReady((Node) item);

Would you like to create a PR to fix this?

Yes. It's my first to create a PR. So i need know the PR process first.

@rohanKanojia
Copy link
Member

  1. Fork our Github repository
  2. Clone forked repository
  3. create new branch from master : git checkout -b pr/issue2404
  4. make changes to file vi kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/internal/readiness/Readiness.java
  5. Check if compilation is successful: cd kubernetes-client; mvn clean install
  6. Add tests(if possible) vi ./kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/readiness/ReadinessTest.java
  7. Commit changes: git add kubernetes-client/; git commit -m "your commit msg
  8. Push your changes: git push origin pr/issue2404
  9. Once your fix branch is pushed, create PR from Github UI against fabric8 kubernetes client master 🚀

@own-idea
Copy link
Contributor Author

Thanks. I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants