-
Notifications
You must be signed in to change notification settings - Fork 219
feat: demonstrate contract-first CRDs #1524
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
Merged
metacosm
merged 4 commits into
operator-framework:main
from
derlin:1338-contract-first-crd
Oct 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 +1,10 @@ | ||
# Leader Election E2E Test | ||
|
||
The purpose of this module is to e2e test leader election feature. | ||
The purpose of this module is to e2e test leader election feature and to demonstrate contract-first CRDs. | ||
|
||
The deployment is using directly pods in order to better control some aspects in test. | ||
In real life this would be a Deployment. | ||
In real life this would be a Deployment. | ||
|
||
The custom resource definition (CRD) is defined in YAML in the folder `src/main/resources/kubernetes`. | ||
Upon build, the [java-generator-maven-plugin](https://github.com/fabric8io/kubernetes-client/blob/master/doc/java-generation-from-CRD.md) | ||
generates the Java code under `target/generated-sources/java`. |
This file contains hidden or 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
15 changes: 0 additions & 15 deletions
15
...on/src/main/java/io/javaoperatorsdk/operator/sample/LeaderElectionTestCustomResource.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
21 changes: 0 additions & 21 deletions
21
...r-election/src/main/java/io/javaoperatorsdk/operator/sample/LeaderElectionTestStatus.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...eader-election/src/main/resources/kubernetes/leaderelection.sample.javaoperatorsdk-v1.yml
This file contains hidden or 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,32 @@ | ||
# Custom Resource Definition that will be used to generate the Java classes in target/generated-sources/java | ||
# See https://github.com/fabric8io/kubernetes-client/blob/master/doc/java-generation-from-CRD.md | ||
# The Java classes will then be used to recreate this CR in target/classes/META-INF/fabric8 | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: leaderelection.sample.javaoperatorsdk | ||
spec: | ||
group: sample.javaoperatorsdk | ||
names: | ||
kind: LeaderElection | ||
singular: leaderelection | ||
plural: leaderelection | ||
shortNames: | ||
- le | ||
- les | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
status: | ||
properties: | ||
reconciledBy: | ||
items: | ||
type: string | ||
type: array | ||
type: object | ||
type: object | ||
served: true | ||
storage: true |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
While this probably isn't a big deal, I think that if we try to follow the CRD generator file name format here, then this file should be named with
leaderelections
(plural form) instead ofleaderelection
(singular).