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

Explicit External IP check in Kubernetes Discovery Plugin [CN-296] #25324

Closed
wants to merge 1 commit into from

Conversation

semihbkgr
Copy link
Member

@semihbkgr semihbkgr commented Aug 29, 2023

The problem is that it assumes the service has a type of LoadBalancer first. If it cannot find ExternalIP there, it jumps into catch block, assumes it has a NodePort kind, and determines ExternalIP according to it.

The block needs to be improved in such way:
It needs to check the kind of the service, and use a specific method to determine External IP.

Checklist:

  • Labels (Team:, Type:, Source:, Module:) and Milestone set
  • Label Add to Release Notes or Not Release Notes content set
  • Request reviewers if possible
  • Send backports/forwardports if fix needs to be applied to past/future releases

@hz-devops-test
Copy link

The job Hazelcast-pr-compiler of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
---------ERRORS-----------
--------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.2.0:add-third-party (add-third-party) on project hazelcast-jet-s3: There are some forbidden licenses used, please check your dependencies. -> [Help 1]
--------------------------
[ERROR] 
--------------------------
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
--------------------------
[ERROR] 
--------------------------
[ERROR] For more information about the errors and possible solutions, please read the following articles:
--------------------------
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
--------------------------
[ERROR] 
--------------------------
[ERROR] After correcting the problems, you can resume the build with the command
--------------------------
[ERROR]   mvn  -rf :hazelcast-jet-s3
--------------------------

@@ -554,7 +584,7 @@ private static Integer extractNodePort(JsonObject serviceJson) {
return ports.get(0).asObject().get("nodePort").asInt();
}

private String externalAddressForNode(String node) {
private String externalIpAddressForNode(String node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for this change? As I can see, the implementation hasn't changes, so we still return one IP address

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

address is referring to the Address class which is introduced in this PR.
ipAddress is referring to the raw IP address in string type.

@semihbkgr semihbkgr added run-discovery-tests Used to run discovery plugins tests and removed run-discovery-tests Used to run discovery plugins tests labels Sep 1, 2023
@hasancelik hasancelik self-requested a review September 13, 2023 11:20
@hasancelik hasancelik added run-discovery-tests Used to run discovery plugins tests and removed run-discovery-tests Used to run discovery plugins tests labels Sep 21, 2023
@semihbkgr semihbkgr added run-discovery-tests Used to run discovery plugins tests and removed run-discovery-tests Used to run discovery plugins tests labels Sep 21, 2023
@hz-devops-test
Copy link

The job Hazelcast-pr-compiler of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
---------ERRORS-----------
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-compiler/hazelcast/src/main/java/com/hazelcast/kubernetes/KubernetesClient.java:375: Line is longer than 130 characters (found 137). [LineLength]
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0:checkstyle (default) on project hazelcast: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There is 1 error reported by Checkstyle 9.3 with /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-compiler/checkstyle/checkstyle.xml ruleset. -> [Help 1]
--------------------------
[ERROR] 
--------------------------
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
--------------------------
[ERROR] 
--------------------------
[ERROR] For more information about the errors and possible solutions, please read the following articles:
--------------------------
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
--------------------------
[ERROR] 
--------------------------
[ERROR] After correcting the problems, you can resume the build with the command
--------------------------
[ERROR]   mvn  -rf :hazelcast
--------------------------

@hz-devops-test
Copy link

The job Hazelcast-pr-builder of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
---------ERRORS-----------
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder/hazelcast/src/main/java/com/hazelcast/kubernetes/KubernetesClient.java:375: Line is longer than 130 characters (found 137). [LineLength]
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0:checkstyle (default) on project hazelcast: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There is 1 error reported by Checkstyle 9.3 with /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder/checkstyle/checkstyle.xml ruleset. -> [Help 1]
--------------------------
[ERROR] 
--------------------------
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
--------------------------
[ERROR] 
--------------------------
[ERROR] For more information about the errors and possible solutions, please read the following articles:
--------------------------
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
--------------------------
[ERROR] 
--------------------------
[ERROR] After correcting the problems, you can resume the build with the command
--------------------------
[ERROR]   mvn  -rf :hazelcast
--------------------------

@hz-devops-test
Copy link

The job Hazelcast-pr-EE-compiler of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
--------------------------
---------SUMMARY----------
--------------------------
[ERROR] COMPILATION ERROR : 
--------------------------
[ERROR] /appdisk/jenkins/jenkins_slave/workspace/Hazelcast-pr-EE-compiler/hazelcast-enterprise/hazelcast-enterprise-native-memory/src/test/java/com/hazelcast/internal/memory/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[20,21] error: cannot find symbol
--------------------------
---------ERRORS-----------
--------------------------
[ERROR] COMPILATION ERROR : 
--------------------------
[ERROR] /appdisk/jenkins/jenkins_slave/workspace/Hazelcast-pr-EE-compiler/hazelcast-enterprise/hazelcast-enterprise-native-memory/src/test/java/com/hazelcast/internal/memory/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[20,21] error: cannot find symbol
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile (default-testCompile) on project hazelcast-enterprise-native-memory: Compilation failure
--------------------------
[ERROR] /appdisk/jenkins/jenkins_slave/workspace/Hazelcast-pr-EE-compiler/hazelcast-enterprise/hazelcast-enterprise-native-memory/src/test/java/com/hazelcast/internal/memory/NoMixedJUnitAnnotationsInOurTestSourcesTest.java:[20,21] error: cannot find symbol
--------------------------
[ERROR]   symbol:   variable NO_JUNIT_MIXING
--------------------------
[ERROR]   location: class ArchUnitRules
--------------------------
[ERROR] -> [Help 1]
--------------------------
[ERROR] 
--------------------------
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
--------------------------
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
--------------------------
[ERROR] 
--------------------------
[ERROR] For more information about the errors and possible solutions, please read the following articles:
--------------------------
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
--------------------------
[ERROR] 
--------------------------
[ERROR] After correcting the problems, you can resume the build with the command
--------------------------
[ERROR]   mvn  -rf :hazelcast-enterprise-native-memory
--------------------------

@semihbkgr semihbkgr added run-discovery-tests Used to run discovery plugins tests and removed run-discovery-tests Used to run discovery plugins tests labels Nov 30, 2023
@semihbkgr semihbkgr added run-discovery-tests Used to run discovery plugins tests and removed run-discovery-tests Used to run discovery plugins tests labels Dec 5, 2023
@devOpsHazelcast
Copy link
Collaborator

Internal PR hazelcast/hazelcast-mono#211
Internal message only. Nothing to see here, move along

@semihbkgr semihbkgr closed this Dec 20, 2023
devOpsHazelcast pushed a commit that referenced this pull request Dec 20, 2023
)

Import of #25324

**Original PR description:**

The problem is that it assumes the service has a type of LoadBalancer
first. If it cannot find ExternalIP there, it jumps into catch block,
assumes it has a NodePort kind, and determines ExternalIP according to
it.

The block needs to be improved in such way:
It needs to check the kind of the service, and use a specific method to
determine External IP.

Checklist:
- [x] Labels (`Team:`, `Type:`, `Source:`, `Module:`) and Milestone set
- [x] Label `Add to Release Notes` or `Not Release Notes content` set
- [x] Request reviewers if possible
- [ ] Send backports/forwardports if fix needs to be applied to
past/future releases

Imported changes:

- f63f7fa Explicit External IP check in
Kubernetes Discovery Plugin...

Closes #25324

Co-authored-by: semihbkgr <buyukgungorsemih@gmail.com>
GitOrigin-RevId: 2bb2877cfb1f876e9263616b64307ae3a1a386f8
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 this pull request may close these issues.

None yet

5 participants