forked from fabric8io/kubernetes-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fabric8io#5233: allowing schemaswap to have a configurable level
- Loading branch information
Showing
8 changed files
with
267 additions
and
17 deletions.
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
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
40 changes: 40 additions & 0 deletions
40
...rator/api/src/test/java/io/fabric8/crd/example/extraction/CollectionCyclicSchemaSwap.java
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,40 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.crd.example.extraction; | ||
|
||
import io.fabric8.crd.generator.annotation.SchemaSwap; | ||
import io.fabric8.kubernetes.api.model.AnyType; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
|
||
import java.util.List; | ||
|
||
@SchemaSwap(originalType = CollectionCyclicSchemaSwap.Level.class, fieldName = "levels", targetType = AnyType.class, depth = 2) | ||
public class CollectionCyclicSchemaSwap extends CustomResource<CollectionCyclicSchemaSwap.Spec, Void> { | ||
|
||
public static class Spec { | ||
private MyObject myObject; | ||
private List<Level> levels; | ||
} | ||
|
||
public static class Level { | ||
private MyObject myObject; | ||
private List<Level> levels; | ||
} | ||
|
||
public static class MyObject { | ||
private int value; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
crd-generator/api/src/test/java/io/fabric8/crd/example/extraction/CyclicSchemaSwap.java
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,40 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.crd.example.extraction; | ||
|
||
import io.fabric8.crd.generator.annotation.SchemaSwap; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
|
||
import java.util.List; | ||
|
||
@SchemaSwap(originalType = CyclicSchemaSwap.Level.class, fieldName = "level", depth = 0) | ||
public class CyclicSchemaSwap extends CustomResource<CyclicSchemaSwap.Spec, Void> { | ||
|
||
public static class Spec { | ||
private MyObject myObject; | ||
private Level level; | ||
private List<Level> levels; // should not interfere with the rendering depth of level of its sibling | ||
} | ||
|
||
public static class Level { | ||
private MyObject myObject; | ||
private Level level; | ||
} | ||
|
||
public static class MyObject { | ||
private int value; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
crd-generator/api/src/test/java/io/fabric8/crd/example/extraction/NestedSchemaSwap.java
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,37 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.crd.example.extraction; | ||
|
||
import io.fabric8.crd.generator.annotation.SchemaSwap; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
|
||
public class NestedSchemaSwap extends CustomResource<NestedSchemaSwap.Spec, Void> { | ||
|
||
@SchemaSwap(originalType = End.class, fieldName = "value", targetType = String.class) | ||
public static class Spec { | ||
private Intermediate one; | ||
private Intermediate another; | ||
} | ||
|
||
@SchemaSwap(originalType = End.class, fieldName = "value", targetType = Void.class) | ||
public static class Intermediate { | ||
private End one; | ||
} | ||
|
||
public static class End { | ||
private int value; | ||
} | ||
} |
Oops, something went wrong.