-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
15,226 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>certmanager-extension-pom</artifactId> | ||
<version>5.5-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>certmanager-client</artifactId> | ||
<packaging>bundle</packaging> | ||
<name>Fabric8 :: Cert Manager :: Client</name> | ||
|
||
<properties> | ||
<osgi.require-capability> | ||
osgi.extender; | ||
filter:="(osgi.extender=osgi.serviceloader.registrar)" | ||
</osgi.require-capability> | ||
<osgi.provide-capability> | ||
osgi.serviceloader; | ||
osgi.serviceloader=io.fabric8.kubernetes.client.ResourceHandler | ||
</osgi.provide-capability> | ||
<osgi.import> | ||
io.fabric8.kubernetes.api.builder, | ||
!io.fabric8.certmanager.client.*, | ||
* | ||
</osgi.import> | ||
<osgi.export> | ||
io.fabric8.certmanager.client.* | ||
</osgi.export> | ||
<osgi.include.resources> | ||
/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter=target/classes/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter, | ||
/META-INF/services/io.fabric8.kubernetes.client.ResourceHandler=target/classes/META-INF/services/io.fabric8.kubernetes.client.ResourceHandler | ||
</osgi.include.resources> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.sundr</groupId> | ||
<artifactId>builder-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.sundr</groupId> | ||
<artifactId>transform-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>certmanager-model-v1alpha2</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>certmanager-model-v1alpha3</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>certmanager-model-v1beta1</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>certmanager-model-v1</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>kubernetes-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-migrationsupport</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-release-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<configuration> | ||
<passphrase>4uds0n</passphrase> | ||
<useAgent>true</useAgent> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
36 changes: 36 additions & 0 deletions
36
...ons/certmanager/client/src/main/java/io/fabric8/certmanager/client/CertManagerClient.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,36 @@ | ||
/** | ||
* 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.certmanager.client; | ||
|
||
|
||
import io.fabric8.certmanager.client.dsl.V1APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1alpha2APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1alpha3APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1beta1APIGroupDSL; | ||
import io.fabric8.kubernetes.client.Client; | ||
|
||
/** | ||
* Main interface for CertManager Client library. | ||
*/ | ||
public interface CertManagerClient extends Client { | ||
V1APIGroupDSL v1(); | ||
|
||
V1alpha2APIGroupDSL v1alpha2(); | ||
|
||
V1alpha3APIGroupDSL v1alpha3(); | ||
|
||
V1beta1APIGroupDSL v1beta1(); | ||
} |
47 changes: 47 additions & 0 deletions
47
...nager/client/src/main/java/io/fabric8/certmanager/client/CertManagerExtensionAdapter.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,47 @@ | ||
/** | ||
* 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.certmanager.client; | ||
|
||
import io.fabric8.kubernetes.client.ExtensionAdapterSupport; | ||
import io.fabric8.kubernetes.client.Client; | ||
import io.fabric8.kubernetes.client.ExtensionAdapter; | ||
import okhttp3.OkHttpClient; | ||
|
||
import java.net.URL; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.ConcurrentMap; | ||
|
||
public class CertManagerExtensionAdapter extends ExtensionAdapterSupport implements ExtensionAdapter<CertManagerClient> { | ||
|
||
static final ConcurrentMap<URL, Boolean> IS_VOLUME_SNAPSHOT = new ConcurrentHashMap<>(); | ||
static final ConcurrentMap<URL, Boolean> USES_VOLUME_SNAPSHOT_APIGROUPS = new ConcurrentHashMap<>(); | ||
public static final String API_GROUP = "cert-manager.io"; | ||
|
||
@Override | ||
public Class<CertManagerClient> getExtensionType() { | ||
return CertManagerClient.class; | ||
} | ||
|
||
@Override | ||
public Boolean isAdaptable(Client client) { | ||
return isAdaptable(client, IS_VOLUME_SNAPSHOT, USES_VOLUME_SNAPSHOT_APIGROUPS, API_GROUP); | ||
} | ||
|
||
@Override | ||
public CertManagerClient adapt(Client client) { | ||
return new DefaultCertManagerClient(client.adapt(OkHttpClient.class), client.getConfiguration()); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
extensions/certmanager/client/src/main/java/io/fabric8/certmanager/client/CodeGen.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.certmanager.client; | ||
|
||
import io.sundr.codegen.annotations.ResourceSelector; | ||
import io.sundr.transform.annotations.VelocityTransformation; | ||
import io.sundr.transform.annotations.VelocityTransformations; | ||
|
||
@VelocityTransformations( | ||
value = { | ||
@VelocityTransformation("/resource-operation.vm"), | ||
@VelocityTransformation("/resource-handler.vm"), | ||
@VelocityTransformation(value = "/resource-handler-services.vm", gather = true, outputPath = "META-INF/services/io.fabric8.kubernetes.client.ResourceHandler") | ||
}, | ||
resources = { | ||
@ResourceSelector("model-v1.properties"), | ||
@ResourceSelector("model-v1alpha2.properties"), | ||
@ResourceSelector("model-v1alpha3.properties"), | ||
@ResourceSelector("model-v1beta1.properties") | ||
} | ||
|
||
) | ||
public class CodeGen { | ||
} |
77 changes: 77 additions & 0 deletions
77
...tmanager/client/src/main/java/io/fabric8/certmanager/client/DefaultCertManagerClient.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,77 @@ | ||
/** | ||
* 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.certmanager.client; | ||
|
||
import io.fabric8.certmanager.client.dsl.V1APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1alpha2APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1alpha3APIGroupDSL; | ||
import io.fabric8.certmanager.client.dsl.V1beta1APIGroupDSL; | ||
import io.fabric8.kubernetes.client.*; | ||
import io.fabric8.kubernetes.client.dsl.FunctionCallable; | ||
import okhttp3.OkHttpClient; | ||
|
||
public class DefaultCertManagerClient extends BaseClient implements NamespacedCertManagerClient { | ||
|
||
public DefaultCertManagerClient() { | ||
super(); | ||
} | ||
|
||
public DefaultCertManagerClient(Config configuration) { | ||
super(configuration); | ||
} | ||
|
||
public DefaultCertManagerClient(OkHttpClient httpClient, Config configuration) { | ||
super(httpClient, configuration); | ||
} | ||
|
||
@Override | ||
public NamespacedCertManagerClient inAnyNamespace() { | ||
return inNamespace(null); | ||
} | ||
|
||
@Override | ||
public NamespacedCertManagerClient inNamespace(String namespace) { | ||
Config updated = new ConfigBuilder(getConfiguration()) | ||
.withNamespace(namespace) | ||
.build(); | ||
|
||
return new DefaultCertManagerClient(getHttpClient(), updated); | ||
} | ||
|
||
@Override | ||
public FunctionCallable<NamespacedCertManagerClient> withRequestConfig(RequestConfig requestConfig) { | ||
return new WithRequestCallable<>(this, requestConfig); | ||
} | ||
|
||
@Override | ||
public V1APIGroupDSL v1() { return adapt(V1APIGroupClient.class); } | ||
|
||
@Override | ||
public V1alpha2APIGroupDSL v1alpha2() { | ||
return adapt(V1alpha2APIGroupClient.class); | ||
} | ||
|
||
@Override | ||
public V1alpha3APIGroupDSL v1alpha3() { | ||
return adapt(V1alpha3APIGroupClient.class); | ||
} | ||
|
||
@Override | ||
public V1beta1APIGroupDSL v1beta1() { | ||
return adapt(V1beta1APIGroupClient.class); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...tmanager/client/src/main/java/io/fabric8/certmanager/client/GenericCertManagerClient.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,27 @@ | ||
/** | ||
* 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.certmanager.client; | ||
|
||
import io.fabric8.kubernetes.client.Client; | ||
import io.fabric8.kubernetes.client.dsl.AnyNamespaceable; | ||
import io.fabric8.kubernetes.client.dsl.Namespaceable; | ||
import io.fabric8.kubernetes.client.dsl.RequestConfigurable; | ||
|
||
public interface GenericCertManagerClient<C extends Client> extends Client, CertManagerClient, | ||
Namespaceable<C>, | ||
AnyNamespaceable<C>, | ||
RequestConfigurable<C> { | ||
} |
19 changes: 19 additions & 0 deletions
19
...nager/client/src/main/java/io/fabric8/certmanager/client/NamespacedCertManagerClient.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,19 @@ | ||
/** | ||
* 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.certmanager.client; | ||
|
||
public interface NamespacedCertManagerClient extends CertManagerClient, GenericCertManagerClient<NamespacedCertManagerClient> { | ||
} |
Oops, something went wrong.