-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix #2399: Cannot change the type of the Service from ClusterIP to ExternalName #2472
Conversation
6f8cc09
to
87d288a
Compare
87d288a
to
03f942a
Compare
…rIP to ExternalName
03f942a
to
44ee47c
Compare
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (1.8.0_265) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
[merge] |
// When | ||
svc.getSpec().setType("ExternalName"); | ||
svc.getSpec().setExternalName("my.database.example.com"); | ||
svc.getSpec().setClusterIP(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No assertion for ClusterIP ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services of type ExternalName
don't need ClusterIP, API Servers enforces the ClusterIP field to be empty when editing the 'type' field from ClusterIP to ExternalName
} | ||
|
||
@Test | ||
public void testClusterIPCreateOrReplace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is a bit misleading.. can we change it to testClusterIpServiceCreateOrReplace ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll create a follow up PR with your suggested changes
} | ||
|
||
@Test | ||
public void testNodePortCreateOrReplace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing with the name
// Then | ||
assertNotNull(clusterIPSvc); | ||
assertEquals("NodePort", clusterIPSvc.getSpec().getType()); | ||
assertEquals(81, clusterIPSvc.getSpec().getPorts().get(0).getTargetPort().getIntVal().intValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check for the NodePort value created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this assertion to check whether what I modified in When phase is actually reflected or not. But yes, I can try doing something with NodePort too
} | ||
|
||
@Test | ||
public void testLoadBalancerCreateOrReplace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
} | ||
|
||
@Test | ||
public void testExternalNameCreateOrReplace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
This PR addresses review comments added in fabric8io#2472 which were added after PR actually got merged
} catch (Exception e) { | ||
throw KubernetesClientException.launderThrowable(forOperationType("patch"), e); | ||
} | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the patch
also work with ExternalName
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. Could you please create an issue for this?
Description
Fix #2399
Removes overridden replace() method in
ServiceOperationsImpl
Type of change
test, version modification, documentation, etc.)
Checklist