diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6403b03d1..693f8748057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * Fix #2507: Add a test for creating a Job with generateName * Fix #2509: Reversed order + Add Kubernetes 1.16.0 + OpenShift 4.5.14 to Compatibility matrix * Add cache in github actions for integration tests +* Eliminated the use of Doneables and simplified the internal DSL implementation. #### Dependency Upgrade * Fix #2513: Update Kubernetes Model to v1.19.1 diff --git a/README.md b/README.md index 28f580c964e..0d45a2d1ac1 100644 --- a/README.md +++ b/README.md @@ -144,35 +144,35 @@ Service myservice = client.services().inNamespace("default").withName("myservice Editing resources uses the inline builders from the Kubernetes Model: ```java -Namespace myns = client.namespaces().withName("myns").edit() +Namespace myns = client.namespaces().withName("myns").edit(n -> new NamespaceBuilder(n)) .editMetadata() .addToLabels("a", "label") .endMetadata() - .done(); + .build()); -Service myservice = client.services().inNamespace("default").withName("myservice").edit() +Service myservice = client.services().inNamespace("default").withName("myservice").edit(s -> new ServiceBuilder(s)) .editMetadata() .addToLabels("another", "label") .endMetadata() - .done(); + .build()); ``` In the same spirit you can inline builders to create: ```java -Namespace myns = client.namespaces().createNew() +Namespace myns = client.namespaces().create(new NamespaceBuilder() .withNewMetadata() .withName("myns") .addToLabels("a", "label") .endMetadata() - .done(); + .build()); -Service myservice = client.services().inNamespace("default").createNew() +Service myservice = client.services().inNamespace("default").create(new ServiceBuilder() .withNewMetadata() .withName("myservice") .addToLabels("another", "label") .endMetadata() - .done(); + .build()); ``` You can also set the apiVersion of the resource like in the case of SecurityContextConstraints : diff --git a/doc/CHEATSHEET.md b/doc/CHEATSHEET.md index b1c72d2d74f..84a8c50ca2b 100644 --- a/doc/CHEATSHEET.md +++ b/doc/CHEATSHEET.md @@ -1879,8 +1879,8 @@ CustomResourceDefinitionContext context = new CustomResourceDefinitionContext.Bu .withPlural("crontabs") .withKind("CronTab") .build() -MixedOperation> cronTabClient = client - .customResources(cronTabCrd, CronTab.class, CronTabList.class, DoneableCronTab.class); +MixedOperation> cronTabClient = client + .customResources(cronTabCrd, CronTab.class, CronTabList.class); ``` - Register your `CustomResource` to `KubernetesDeserializer`: ``` diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/DefaultKnativeClient.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/DefaultKnativeClient.java index 204c4ddca5a..d318796be98 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/DefaultKnativeClient.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/DefaultKnativeClient.java @@ -42,61 +42,40 @@ import io.fabric8.knative.client.sources.v1beta1.internal.SinkBindingOperationsImpl; import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSource; import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceList; -import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.DoneableAwsSqsSource; import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.CouchDbSource; import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.CouchDbSourceList; -import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.DoneableCouchDbSource; -import io.fabric8.knative.eventing.contrib.github.v1alpha1.DoneableGitHubBinding; -import io.fabric8.knative.eventing.contrib.github.v1alpha1.DoneableGitHubSource; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubBinding; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubBindingList; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubSource; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubSourceList; -import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.DoneableGitLabBinding; -import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.DoneableGitLabSource; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabBinding; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabBindingList; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabSource; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabSourceList; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaBinding; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaChannel; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaSource; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaBinding; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaBindingList; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaChannel; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaChannelList; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaSource; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaSourceList; -import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.DoneablePrometheusSource; import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.PrometheusSource; import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.PrometheusSourceList; import io.fabric8.knative.eventing.v1.Broker; import io.fabric8.knative.eventing.v1.BrokerList; -import io.fabric8.knative.eventing.v1.DoneableBroker; -import io.fabric8.knative.eventing.v1.DoneableTrigger; import io.fabric8.knative.eventing.v1.Trigger; import io.fabric8.knative.eventing.v1.TriggerList; -import io.fabric8.knative.eventing.v1beta1.DoneableEventType; import io.fabric8.knative.eventing.v1beta1.EventType; import io.fabric8.knative.eventing.v1beta1.EventTypeList; -import io.fabric8.knative.flows.v1.DoneableSequence; import io.fabric8.knative.flows.v1.Sequence; import io.fabric8.knative.flows.v1.SequenceList; import io.fabric8.knative.messaging.v1.Channel; import io.fabric8.knative.messaging.v1.ChannelList; -import io.fabric8.knative.messaging.v1.DoneableChannel; -import io.fabric8.knative.messaging.v1.DoneableInMemoryChannel; -import io.fabric8.knative.messaging.v1.DoneableSubscription; import io.fabric8.knative.messaging.v1.InMemoryChannel; import io.fabric8.knative.messaging.v1.InMemoryChannelList; import io.fabric8.knative.messaging.v1.Subscription; import io.fabric8.knative.messaging.v1.SubscriptionList; import io.fabric8.knative.serving.v1.Configuration; import io.fabric8.knative.serving.v1.ConfigurationList; -import io.fabric8.knative.serving.v1.DoneableConfiguration; -import io.fabric8.knative.serving.v1.DoneableRevision; -import io.fabric8.knative.serving.v1.DoneableRoute; -import io.fabric8.knative.serving.v1.DoneableService; import io.fabric8.knative.serving.v1.Revision; import io.fabric8.knative.serving.v1.RevisionList; import io.fabric8.knative.serving.v1.Route; @@ -107,10 +86,6 @@ import io.fabric8.knative.sources.v1beta1.ApiServerSourceList; import io.fabric8.knative.sources.v1beta1.ContainerSource; import io.fabric8.knative.sources.v1beta1.ContainerSourceList; -import io.fabric8.knative.sources.v1beta1.DoneableApiServerSource; -import io.fabric8.knative.sources.v1beta1.DoneableContainerSource; -import io.fabric8.knative.sources.v1beta1.DoneablePingSource; -import io.fabric8.knative.sources.v1beta1.DoneableSinkBinding; import io.fabric8.knative.sources.v1beta1.PingSource; import io.fabric8.knative.sources.v1beta1.PingSourceList; import io.fabric8.knative.sources.v1beta1.SinkBinding; @@ -157,127 +132,127 @@ public FunctionCallable withRequestConfig(RequestConfig } @Override - public MixedOperation> services() { + public MixedOperation> services() { return new ServiceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> routes() { + public MixedOperation> routes() { return new RouteOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> revisions() { + public MixedOperation> revisions() { return new RevisionOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> configurations() { + public MixedOperation> configurations() { return new ConfigurationOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> brokers() { + public MixedOperation> brokers() { return new BrokerOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> triggers() { + public MixedOperation> triggers() { return new TriggerOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> channels() { + public MixedOperation> channels() { return new ChannelOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> subscriptions() { + public MixedOperation> subscriptions() { return new SubscriptionOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> eventTypes() { + public MixedOperation> eventTypes() { return new EventTypeOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> sequences() { + public MixedOperation> sequences() { return new SequenceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> inMemoryChannels() { + public MixedOperation> inMemoryChannels() { return new InMemoryChannelOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> pingSources() { + public MixedOperation> pingSources() { return new PingSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> sinkBindings() { + public MixedOperation> sinkBindings() { return new SinkBindingOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> containerSources() { + public MixedOperation> containerSources() { return new ContainerSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> apiServerSources() { + public MixedOperation> apiServerSources() { return new ApiServerSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> awsSqsSources() { + public MixedOperation> awsSqsSources() { return new AwsSqsSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> couchDbSources() { + public MixedOperation> couchDbSources() { return new CouchDbSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> gitHubSources() { + public MixedOperation> gitHubSources() { return new GitHubSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> gitHubBindings() { + public MixedOperation> gitHubBindings() { return new GitHubBindingOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> gitLabSources() { + public MixedOperation> gitLabSources() { return new GitLabSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> gitLabBindings() { + public MixedOperation> gitLabBindings() { return new GitLabBindingOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> prometheusSources() { + public MixedOperation> prometheusSources() { return new PrometheusSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> kafkaChannels() { + public MixedOperation> kafkaChannels() { return new KafkaChannelOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> kafkasSources() { + public MixedOperation> kafkasSources() { return new KafkaSourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> kafkaBindings() { + public MixedOperation> kafkaBindings() { return new KafkaBindingOperationsImpl(this.getHttpClient(), this.getConfiguration()); } } diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/KnativeClient.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/KnativeClient.java index bd56627c102..2b3de3e0cf5 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/KnativeClient.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/KnativeClient.java @@ -17,61 +17,40 @@ import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSource; import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceList; -import io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.DoneableAwsSqsSource; import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.CouchDbSource; import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.CouchDbSourceList; -import io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.DoneableCouchDbSource; -import io.fabric8.knative.eventing.contrib.github.v1alpha1.DoneableGitHubBinding; -import io.fabric8.knative.eventing.contrib.github.v1alpha1.DoneableGitHubSource; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubBinding; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubBindingList; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubSource; import io.fabric8.knative.eventing.contrib.github.v1alpha1.GitHubSourceList; -import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.DoneableGitLabBinding; -import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.DoneableGitLabSource; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabBinding; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabBindingList; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabSource; import io.fabric8.knative.eventing.contrib.gitlab.v1alpha1.GitLabSourceList; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaBinding; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaChannel; -import io.fabric8.knative.eventing.contrib.kafka.v1beta1.DoneableKafkaSource; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaBinding; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaBindingList; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaChannel; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaChannelList; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaSource; import io.fabric8.knative.eventing.contrib.kafka.v1beta1.KafkaSourceList; -import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.DoneablePrometheusSource; import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.PrometheusSource; import io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.PrometheusSourceList; import io.fabric8.knative.eventing.v1.Broker; import io.fabric8.knative.eventing.v1.BrokerList; -import io.fabric8.knative.eventing.v1.DoneableBroker; -import io.fabric8.knative.eventing.v1.DoneableTrigger; import io.fabric8.knative.eventing.v1.Trigger; import io.fabric8.knative.eventing.v1.TriggerList; -import io.fabric8.knative.eventing.v1beta1.DoneableEventType; import io.fabric8.knative.eventing.v1beta1.EventType; import io.fabric8.knative.eventing.v1beta1.EventTypeList; -import io.fabric8.knative.flows.v1.DoneableSequence; import io.fabric8.knative.flows.v1.Sequence; import io.fabric8.knative.flows.v1.SequenceList; import io.fabric8.knative.messaging.v1.Channel; import io.fabric8.knative.messaging.v1.ChannelList; -import io.fabric8.knative.messaging.v1.DoneableChannel; -import io.fabric8.knative.messaging.v1.DoneableInMemoryChannel; -import io.fabric8.knative.messaging.v1.DoneableSubscription; import io.fabric8.knative.messaging.v1.InMemoryChannel; import io.fabric8.knative.messaging.v1.InMemoryChannelList; import io.fabric8.knative.messaging.v1.Subscription; import io.fabric8.knative.messaging.v1.SubscriptionList; import io.fabric8.knative.serving.v1.Configuration; import io.fabric8.knative.serving.v1.ConfigurationList; -import io.fabric8.knative.serving.v1.DoneableConfiguration; -import io.fabric8.knative.serving.v1.DoneableRevision; -import io.fabric8.knative.serving.v1.DoneableRoute; -import io.fabric8.knative.serving.v1.DoneableService; import io.fabric8.knative.serving.v1.Revision; import io.fabric8.knative.serving.v1.RevisionList; import io.fabric8.knative.serving.v1.Route; @@ -82,10 +61,6 @@ import io.fabric8.knative.sources.v1beta1.ApiServerSourceList; import io.fabric8.knative.sources.v1beta1.ContainerSource; import io.fabric8.knative.sources.v1beta1.ContainerSourceList; -import io.fabric8.knative.sources.v1beta1.DoneableApiServerSource; -import io.fabric8.knative.sources.v1beta1.DoneableContainerSource; -import io.fabric8.knative.sources.v1beta1.DoneablePingSource; -import io.fabric8.knative.sources.v1beta1.DoneableSinkBinding; import io.fabric8.knative.sources.v1beta1.PingSource; import io.fabric8.knative.sources.v1beta1.PingSourceList; import io.fabric8.knative.sources.v1beta1.SinkBinding; @@ -105,28 +80,28 @@ public interface KnativeClient extends Client { * * @return MixedOperation for Service class */ - MixedOperation> services(); + MixedOperation> services(); /** * API entrypoint for Route(serving.knative.dev/v1) * * @return MixedOperation for Route class */ - MixedOperation> routes(); + MixedOperation> routes(); /** * API entrypoint for Revision(serving.knative.dev/v1) * * @return MixedOperation for Revision class */ - MixedOperation> revisions(); + MixedOperation> revisions(); /** * API entrypoint for Configuration(serving.knative.dev/v1) * * @return MixedOperation for Configuration class */ - MixedOperation> configurations(); + MixedOperation> configurations(); //Eventing @@ -135,19 +110,19 @@ public interface KnativeClient extends Client { * * @return MixedOperation for Broker class */ - MixedOperation> brokers(); + MixedOperation> brokers(); /** * API entrypoint for Trigger(eventing.knative.dev/v1) * * @return MixedOperation for Trigger class */ - MixedOperation> triggers(); + MixedOperation> triggers(); /** * API entrypoint for EventType(eventing.knative.dev/v1) * * @return MixedOperation for EventType class */ - MixedOperation> eventTypes(); + MixedOperation> eventTypes(); //Messaging /** @@ -155,25 +130,25 @@ public interface KnativeClient extends Client { * * @return MixedOperation for Channel class */ - MixedOperation> channels(); + MixedOperation> channels(); /** * API entrypoint for Subscription(messaging.knative.dev/v1) * * @return MixedOperation for Subscription class */ - MixedOperation> subscriptions(); + MixedOperation> subscriptions(); /** * API entrypoint for Sequence(messaging.knative.dev/v1) * * @return MixedOperation for Sequence class */ - MixedOperation> sequences(); + MixedOperation> sequences(); /** * API entrypoint for InMemoryChannel(messaging.knative.dev/v1) * * @return MixedOperation for InMemoryChannel class */ - MixedOperation> inMemoryChannels(); + MixedOperation> inMemoryChannels(); // Eventing Sources @@ -181,24 +156,24 @@ public interface KnativeClient extends Client { * API entrypoint for PingSource(sources.knative.dev/v1beta1) * @return MixedOperation for PingSource class */ - MixedOperation> pingSources(); + MixedOperation> pingSources(); /** * API entrypoint for SinkBinding(sources.knative.dev/v1beta1) * @return MixedOperation for SinkBinding class */ - MixedOperation> sinkBindings(); + MixedOperation> sinkBindings(); /** * API entrypoint for ContainerSource(sources.knative.dev/v1beta1) * @return MixedOperation for ContainerSource class */ - MixedOperation> containerSources(); + MixedOperation> containerSources(); /** * API entrypoint for ApiServerSource(sources.knative.dev/v1beta1) * @return MixedOperation for ApiServerSource class */ - MixedOperation> apiServerSources(); + MixedOperation> apiServerSources(); // Eventing Contrib @@ -206,50 +181,50 @@ public interface KnativeClient extends Client { * API entrypoint for AwsSqsSource(sources.knative.dev/v1alpha1) * @return MixedOperation for AwsSqsSource class */ - MixedOperation> awsSqsSources(); + MixedOperation> awsSqsSources(); /** * API entrypoint for CouchDbSource(sources.knative.dev/v1alpha1) * @return MixedOperation for CouchDbSource class */ - MixedOperation> couchDbSources(); + MixedOperation> couchDbSources(); /** * API entrypoint for GitHubSource(sources.knative.dev/v1alpha1) * @return MixedOperation for GitHubSource class */ - MixedOperation> gitHubSources(); + MixedOperation> gitHubSources(); /** * API entrypoint for GitHubBinding(bindings.knative.dev/v1alpha1) * @return MixedOperation for GitHubBinding class */ - MixedOperation> gitHubBindings(); + MixedOperation> gitHubBindings(); /** * API entrypoint for GitLabSource(sources.knative.dev/v1alpha1) * @return MixedOperation for GitLabSource class */ - MixedOperation> gitLabSources(); + MixedOperation> gitLabSources(); /** * API entrypoint for GitLabBinding(bindings.knative.dev/v1alpha1) * @return MixedOperation for GitLabBinding class */ - MixedOperation> gitLabBindings(); + MixedOperation> gitLabBindings(); /** * API entrypoint for PrometheusSource(sources.knative.dev/v1alpha1) * @return MixedOperation for PrometheusSource class */ - MixedOperation> prometheusSources(); + MixedOperation> prometheusSources(); /** * API entrypoint for KafkaChannel(messaging.knative.dev/v1beta) * @return MixedOperation for KafkaChannel class */ - MixedOperation> kafkaChannels(); + MixedOperation> kafkaChannels(); /** * API entrypoint for KafkaSource(sources.knative.dev/v1beta1) * @return MixedOperation for KafkaSource class */ - MixedOperation> kafkasSources(); + MixedOperation> kafkasSources(); /** * API entrypoint for KafkaBinding(bindings.knative.dev/v1beta1) * @return MixedOperation for KafkaBinding class */ - MixedOperation> kafkaBindings(); + MixedOperation> kafkaBindings(); } diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/DefaultServingV1Client.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/DefaultServingV1Client.java index d4b116e24e9..417997fe4d1 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/DefaultServingV1Client.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/DefaultServingV1Client.java @@ -60,22 +60,22 @@ public FunctionCallable withRequestConfig(RequestConf } @Override - public MixedOperation> services() { + public MixedOperation> services() { return new ServiceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> routes() { + public MixedOperation> routes() { return new RouteOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> revisions() { + public MixedOperation> revisions() { return new RevisionOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> configurations() { + public MixedOperation> configurations() { return new ConfigurationOperationsImpl(this.getHttpClient(), this.getConfiguration()); } diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/ServingV1Client.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/ServingV1Client.java index dd1e3b5129e..d535be95bc9 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/ServingV1Client.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1/ServingV1Client.java @@ -24,9 +24,9 @@ public interface ServingV1Client extends Client { // Serving - MixedOperation> services(); - MixedOperation> routes(); - MixedOperation> revisions(); - MixedOperation> configurations(); + MixedOperation> services(); + MixedOperation> routes(); + MixedOperation> revisions(); + MixedOperation> configurations(); } diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/DefaultServingV1Beta1Client.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/DefaultServingV1Beta1Client.java index 666bdd7ba95..2da06785e54 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/DefaultServingV1Beta1Client.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/DefaultServingV1Beta1Client.java @@ -60,22 +60,22 @@ public FunctionCallable withRequestConfig(Reques } @Override - public MixedOperation> services() { + public MixedOperation> services() { return new ServiceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> routes() { + public MixedOperation> routes() { return new RouteOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> revisions() { + public MixedOperation> revisions() { return new RevisionOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> configurations() { + public MixedOperation> configurations() { return new ConfigurationOperationsImpl(this.getHttpClient(), this.getConfiguration()); } diff --git a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/ServingV1Beta1Client.java b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/ServingV1Beta1Client.java index 7c62d3efede..d328db1213e 100644 --- a/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/ServingV1Beta1Client.java +++ b/extensions/knative/client/src/main/java/io/fabric8/knative/client/serving/v1beta1/ServingV1Beta1Client.java @@ -24,9 +24,8 @@ public interface ServingV1Beta1Client extends Client { // Serving - MixedOperation> services(); - MixedOperation> routes(); - MixedOperation> revisions(); - MixedOperation> configurations(); - + MixedOperation> services(); + MixedOperation> routes(); + MixedOperation> revisions(); + MixedOperation> configurations(); } diff --git a/extensions/knative/client/src/main/resources/resource-operation.vm b/extensions/knative/client/src/main/resources/resource-operation.vm index 528e50da9ba..f9e27c95f48 100644 --- a/extensions/knative/client/src/main/resources/resource-operation.vm +++ b/extensions/knative/client/src/main/resources/resource-operation.vm @@ -44,16 +44,14 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); @@ -65,7 +63,6 @@ public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.na .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) { diff --git a/extensions/knative/tests/src/test/java/io/fabric8/knative/test/RouteTest.java b/extensions/knative/tests/src/test/java/io/fabric8/knative/test/RouteTest.java index 8a4324790dc..5d837df76ac 100644 --- a/extensions/knative/tests/src/test/java/io/fabric8/knative/test/RouteTest.java +++ b/extensions/knative/tests/src/test/java/io/fabric8/knative/test/RouteTest.java @@ -59,7 +59,7 @@ void testCreateOrReplace() { KnativeClient kn = server.getKnativeClient(); // When - route = kn.routes().createOrReplaceWithNew() + route = kn.routes().createOrReplace(new RouteBuilder() .withNewMetadata() .withName("helloworld-nodejs-red-blue1") .addToAnnotations("foo", "bar") @@ -71,7 +71,7 @@ void testCreateOrReplace() { .withPercent(100L) .endTraffic() .endSpec() - .done(); + .build()); // Then assertNotNull(route); diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/DefaultServiceCatalogClient.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/DefaultServiceCatalogClient.java index a22594d43d0..3ca01db5b16 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/DefaultServiceCatalogClient.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/DefaultServiceCatalogClient.java @@ -20,14 +20,6 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceBroker; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceClass; -import io.fabric8.servicecatalog.api.model.DoneableClusterServicePlan; -import io.fabric8.servicecatalog.api.model.DoneableServiceBinding; -import io.fabric8.servicecatalog.api.model.DoneableServiceBroker; -import io.fabric8.servicecatalog.api.model.DoneableServiceClass; -import io.fabric8.servicecatalog.api.model.DoneableServiceInstance; -import io.fabric8.servicecatalog.api.model.DoneableServicePlan; import io.fabric8.servicecatalog.client.internal.*; import io.fabric8.servicecatalog.api.model.*; import okhttp3.OkHttpClient; @@ -46,38 +38,38 @@ public DefaultServiceCatalogClient(OkHttpClient httpClient, Config configuration super(httpClient, configuration); } - public NonNamespaceOperation clusterServiceBrokers() { + public NonNamespaceOperation clusterServiceBrokers() { return new ClusterServiceBrokerOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public NonNamespaceOperation clusterServiceClasses() { + public NonNamespaceOperation clusterServiceClasses() { return new ClusterServiceClassOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public NonNamespaceOperation clusterServicePlans() { + public NonNamespaceOperation clusterServicePlans() { return new ClusterServicePlanOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public MixedOperation serviceInstances() { + public MixedOperation serviceInstances() { return new ServiceInstanceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public MixedOperation serviceBindings() { + public MixedOperation serviceBindings() { return new ServiceBindingOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> serviceBrokers() { + public MixedOperation> serviceBrokers() { return new ServiceBrokerOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> serviceClasses() { + public MixedOperation> serviceClasses() { return new ServiceClassOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> servicePlans() { + public MixedOperation> servicePlans() { return new ServicePlanOperationsImpl(this.getHttpClient(), this.getConfiguration()); } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/ServiceCatalogClient.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/ServiceCatalogClient.java index 0d2ac2c0cd8..83c4c7deffa 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/ServiceCatalogClient.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/ServiceCatalogClient.java @@ -26,14 +26,6 @@ import io.fabric8.servicecatalog.api.model.ClusterServiceClassList; import io.fabric8.servicecatalog.api.model.ClusterServicePlan; import io.fabric8.servicecatalog.api.model.ClusterServicePlanList; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceBroker; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceClass; -import io.fabric8.servicecatalog.api.model.DoneableClusterServicePlan; -import io.fabric8.servicecatalog.api.model.DoneableServiceBinding; -import io.fabric8.servicecatalog.api.model.DoneableServiceBroker; -import io.fabric8.servicecatalog.api.model.DoneableServiceClass; -import io.fabric8.servicecatalog.api.model.DoneableServiceInstance; -import io.fabric8.servicecatalog.api.model.DoneableServicePlan; import io.fabric8.servicecatalog.api.model.ServiceBinding; import io.fabric8.servicecatalog.api.model.ServiceBindingList; import io.fabric8.servicecatalog.api.model.ServiceBroker; @@ -60,55 +52,55 @@ public interface ServiceCatalogClient extends Client { * * @return NonNamespaceOperation for ClusterServiceBroker class */ - NonNamespaceOperation clusterServiceBrokers(); + NonNamespaceOperation clusterServiceBrokers(); /** * API entrypoint for ClusterServiceClass(servicecatalog.k8s.io/v1beta1) * * @return NonNamespaceOperation for ClusterServiceClass class */ - NonNamespaceOperation clusterServiceClasses(); + NonNamespaceOperation clusterServiceClasses(); /** * API entrypoint for ClusterServicePlan(servicecatalog.k8s.io/v1beta1) * * @return NonNamespaceOperation for ClusterServicePlan class */ - NonNamespaceOperation clusterServicePlans(); + NonNamespaceOperation clusterServicePlans(); /** * API entrypoint for ServiceInstance(servicecatalog.k8s.io/v1beta1) * * @return MixedOperation for ServiceInstance class */ - MixedOperation serviceInstances(); + MixedOperation serviceInstances(); /** * API entrypoint for ServiceBinding(servicecatalog.k8s.io/v1beta1) * * @return MixedOperation for ServiceBinding class */ - MixedOperation serviceBindings(); + MixedOperation serviceBindings(); /** * API entrypoint for ServiceBroker(servicecatalog.k8s.io/v1beta1) * * @return MixedOperation for ServiceBroker class */ - MixedOperation> serviceBrokers(); + MixedOperation> serviceBrokers(); /** * API entrypoint for ServiceClass(servicecatalog.k8s.io/v1beta1) * * @return MixedOperation for ServiceClass class */ - MixedOperation> serviceClasses(); + MixedOperation> serviceClasses(); /** * API entrypoint for ServicePlan(servicecatalog.k8s.io/v1beta1) * * @return MixedOperation for ServicePlan class */ - MixedOperation> servicePlans(); + MixedOperation> servicePlans(); } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerOperationsImpl.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerOperationsImpl.java index 9617abefbfd..fa4eac23750 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerOperationsImpl.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerOperationsImpl.java @@ -20,7 +20,6 @@ import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceBroker; import okhttp3.OkHttpClient; import java.util.HashMap; @@ -28,7 +27,7 @@ import java.util.Map; -public class ClusterServiceBrokerOperationsImpl extends HasMetadataOperation implements ClusterServiceBrokerResource { +public class ClusterServiceBrokerOperationsImpl extends HasMetadataOperation implements ClusterServiceBrokerResource { public ClusterServiceBrokerOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -38,11 +37,10 @@ public ClusterServiceBrokerOperationsImpl(OperationContext context) { super(context.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterservicebrokers")); this.type=ClusterServiceBroker.class; this.listType= ClusterServiceBrokerList.class; - this.doneableType= DoneableClusterServiceBroker.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new ClusterServiceBrokerOperationsImpl(context); } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerResource.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerResource.java index 17abc4b316e..d4cece21ed5 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerResource.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceBrokerResource.java @@ -19,9 +19,8 @@ import io.fabric8.servicecatalog.api.model.ClusterServiceBroker; import io.fabric8.servicecatalog.api.model.ClusterServiceClassList; import io.fabric8.servicecatalog.api.model.ClusterServicePlanList; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceBroker; -public interface ClusterServiceBrokerResource extends Resource { +public interface ClusterServiceBrokerResource extends Resource { /** diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassOperationsImpl.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassOperationsImpl.java index 83fab385a34..026d6105df5 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassOperationsImpl.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassOperationsImpl.java @@ -20,7 +20,6 @@ import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceClass; import okhttp3.OkHttpClient; import java.util.HashMap; @@ -28,7 +27,7 @@ import java.util.Map; -public class ClusterServiceClassOperationsImpl extends HasMetadataOperation implements ClusterServiceClassResource { +public class ClusterServiceClassOperationsImpl extends HasMetadataOperation implements ClusterServiceClassResource { public ClusterServiceClassOperationsImpl(OkHttpClient client, Config config) { @@ -39,12 +38,11 @@ public ClusterServiceClassOperationsImpl(OperationContext ctx) { super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterserviceclasses")); this.type=ClusterServiceClass.class; this.listType=ClusterServiceClassList.class; - this.doneableType= DoneableClusterServiceClass.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new ClusterServiceClassOperationsImpl(context); } @@ -80,7 +78,7 @@ public ClusterServicePlanResource usePlan(String externalName) { public ServiceInstance instantiate(String instanceName, String plan) { ClusterServiceClass item = get(); return new ServiceInstanceOperationsImpl(context) - .createNew() + .create(new ServiceInstanceBuilder() .withNewMetadata() .withName(instanceName) .endMetadata() @@ -88,6 +86,6 @@ public ServiceInstance instantiate(String instanceName, String plan) { .withClusterServiceClassExternalName(item.getMetadata().getName()) .withClusterServicePlanExternalName(plan) .endSpec() - .done(); + .build()); } } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassResource.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassResource.java index dba79f6b927..28886542637 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassResource.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServiceClassResource.java @@ -17,9 +17,8 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableClusterServiceClass; -public interface ClusterServiceClassResource extends Resource { +public interface ClusterServiceClassResource extends Resource { ClusterServicePlanList listPlans(); diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanOperationsImpl.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanOperationsImpl.java index cb4bf620aaa..4ff29f961fd 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanOperationsImpl.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanOperationsImpl.java @@ -20,11 +20,10 @@ import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableClusterServicePlan; import okhttp3.OkHttpClient; -public class ClusterServicePlanOperationsImpl extends HasMetadataOperation +public class ClusterServicePlanOperationsImpl extends HasMetadataOperation implements ClusterServicePlanResource { public ClusterServicePlanOperationsImpl(OkHttpClient client, Config config) { @@ -35,11 +34,10 @@ public ClusterServicePlanOperationsImpl(OperationContext ctx) { super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterserviceplans")); this.type=ClusterServicePlan.class; this.listType=ClusterServicePlanList.class; - this.doneableType= DoneableClusterServicePlan.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new ClusterServicePlanOperationsImpl(context); } @@ -66,7 +64,7 @@ public ServiceInstance instantiate(String... args) { ClusterServicePlan item = get(); return new ServiceInstanceOperationsImpl(context.withItem(null)) - .createNew() + .create(new ServiceInstanceBuilder() .withNewMetadata() .withName(instanceName) .withNamespace(instanceNamespace) @@ -75,7 +73,7 @@ public ServiceInstance instantiate(String... args) { .withClusterServiceClassName(item.getSpec().getClusterServiceClassRef().getName()) .withClusterServicePlanName(item.getMetadata().getName()) .endSpec() - .done(); + .build()); } @Override diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanResource.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanResource.java index 3dacb213e32..f24e1edf33e 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanResource.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ClusterServicePlanResource.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableClusterServicePlan; -public interface ClusterServicePlanResource extends Resource { +public interface ClusterServicePlanResource extends Resource { /** * Instantiate the {@link ClusterServicePlan}. diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingOperationsImpl.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingOperationsImpl.java index 76f615f7f11..91441107490 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingOperationsImpl.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingOperationsImpl.java @@ -23,11 +23,10 @@ import io.fabric8.kubernetes.client.dsl.internal.core.v1.SecretOperationsImpl; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableServiceBinding; import okhttp3.OkHttpClient; -public class ServiceBindingOperationsImpl extends HasMetadataOperation implements ServiceBindingResource { +public class ServiceBindingOperationsImpl extends HasMetadataOperation implements ServiceBindingResource { public ServiceBindingOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -37,15 +36,14 @@ public ServiceBindingOperationsImpl(OperationContext ctx) { super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("servicebindings")); this.type=ServiceBinding.class; this.listType=ServiceBindingList.class; - this.doneableType= DoneableServiceBinding.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new ServiceBindingOperationsImpl(context); } - @Override + @Override public boolean isResourceNamespaced() { return true; } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingResource.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingResource.java index 48eb649b693..ec3984337f0 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingResource.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceBindingResource.java @@ -18,9 +18,8 @@ import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableServiceBinding; -public interface ServiceBindingResource extends Resource { +public interface ServiceBindingResource extends Resource { Secret getSecret(); } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceOperationsImpl.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceOperationsImpl.java index 2617a5286e5..4cd4343f6e1 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceOperationsImpl.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceOperationsImpl.java @@ -20,10 +20,9 @@ import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableServiceInstance; import okhttp3.OkHttpClient; -public class ServiceInstanceOperationsImpl extends HasMetadataOperation implements ServiceInstanceResource { +public class ServiceInstanceOperationsImpl extends HasMetadataOperation implements ServiceInstanceResource { public ServiceInstanceOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -33,11 +32,10 @@ public ServiceInstanceOperationsImpl(OperationContext ctx) { super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("serviceinstances")); this.type=ServiceInstance.class; this.listType=ServiceInstanceList.class; - this.doneableType= DoneableServiceInstance.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new ServiceInstanceOperationsImpl(context); } @@ -50,7 +48,7 @@ public boolean isResourceNamespaced() { public ServiceBinding bind(String secretName) { ServiceInstance item = get(); return new ServiceBindingOperationsImpl(context.withItem(null)) - .createNew() + .create(new ServiceBindingBuilder() .withNewMetadata() .withName(item.getMetadata().getName()) .endMetadata() @@ -58,6 +56,6 @@ public ServiceBinding bind(String secretName) { .withSecretName(secretName) .withNewInstanceRef(item.getMetadata().getName()) .endSpec() - .done(); + .build()); } } diff --git a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceResource.java b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceResource.java index 6e3ca230dad..65ce21a1a00 100644 --- a/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceResource.java +++ b/extensions/service-catalog/client/src/main/java/io/fabric8/servicecatalog/client/internal/ServiceInstanceResource.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.servicecatalog.api.model.*; -import io.fabric8.servicecatalog.api.model.DoneableServiceInstance; -public interface ServiceInstanceResource extends Resource { +public interface ServiceInstanceResource extends Resource { ServiceBinding bind(String secretName); } diff --git a/extensions/service-catalog/client/src/main/resources/resource-operation.vm b/extensions/service-catalog/client/src/main/resources/resource-operation.vm index e6e9acdd4d3..848becebf6b 100644 --- a/extensions/service-catalog/client/src/main/resources/resource-operation.vm +++ b/extensions/service-catalog/client/src/main/resources/resource-operation.vm @@ -44,16 +44,14 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); @@ -65,7 +63,6 @@ public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.na .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) { diff --git a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBinding.java b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBinding.java index 13f4901c155..cf5596171b8 100644 --- a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBinding.java +++ b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBinding.java @@ -15,6 +15,7 @@ */ import io.fabric8.servicecatalog.api.model.ServiceBinding; +import io.fabric8.servicecatalog.api.model.ServiceBindingBuilder; import io.fabric8.servicecatalog.client.ServiceCatalogClient; @@ -23,14 +24,14 @@ public class CreateBinding { public static void main(String[] args) { ServiceCatalogClient client = ClientFactory.newClient(args); System.out.println("Creating a service binding"); - ServiceBinding binding = client.serviceBindings().inNamespace("iocanel").createNew() + ServiceBinding binding = client.serviceBindings().inNamespace("iocanel").create(new ServiceBindingBuilder() .withNewMetadata() .withName("mybinding") .endMetadata() .withNewSpec() .withNewInstanceRef("myservice") .withSecretName("mysercret") - .endSpec() - .done(); + .endSpec().build()); + } } diff --git a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBroker.java b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBroker.java index 072e7b1e7fc..71c339e2176 100644 --- a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBroker.java +++ b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/CreateBroker.java @@ -15,19 +15,20 @@ */ import io.fabric8.servicecatalog.api.model.ClusterServiceBroker; +import io.fabric8.servicecatalog.api.model.ClusterServiceBrokerBuilder; import io.fabric8.servicecatalog.client.ServiceCatalogClient; public class CreateBroker { public static void main(String[] args) { ServiceCatalogClient client = ClientFactory.newClient(args); - ClusterServiceBroker broker = client.clusterServiceBrokers().createNew() + ClusterServiceBroker broker = client.clusterServiceBrokers().create(new ClusterServiceBrokerBuilder() .withNewMetadata() .withName("mybroker") .endMetadata() .withNewSpec() .withUrl("http://url.to.service.broker") .endSpec() - .done(); + .build()); } } diff --git a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/ProvisionService.java b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/ProvisionService.java index 3adb3da1848..c709baadcc8 100644 --- a/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/ProvisionService.java +++ b/extensions/service-catalog/examples/src/main/java/io/fabric8/servicecatalog/examples/ProvisionService.java @@ -15,6 +15,7 @@ */ import io.fabric8.servicecatalog.api.model.ServiceInstance; +import io.fabric8.servicecatalog.api.model.ServiceInstanceBuilder; import io.fabric8.servicecatalog.client.ServiceCatalogClient; public class ProvisionService { @@ -22,7 +23,7 @@ public class ProvisionService { public static void main(String[] args) { ServiceCatalogClient client = ClientFactory.newClient(args); System.out.println("Provisioning a service"); - ServiceInstance instance = client.serviceInstances().inNamespace("iocanel").createNew() + ServiceInstance instance = client.serviceInstances().inNamespace("iocanel").create(new ServiceInstanceBuilder() .withNewMetadata() .withName("myserivce") .endMetadata() @@ -30,7 +31,7 @@ public static void main(String[] args) { .withClusterServiceClassExternalName("jenkins-ephemeral") .withClusterServicePlanExternalName("default") .endSpec() - .done(); + .build()); System.out.println("Done"); } } diff --git a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceBrokerTest.java b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceBrokerTest.java index 0d16bd5ed8d..5c16ec83cae 100644 --- a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceBrokerTest.java +++ b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceBrokerTest.java @@ -85,11 +85,11 @@ void testCrud() { assertNotNull(r1); //Update - ClusterServiceBroker u1 = client.clusterServiceBrokers().withName("broker1").edit() + ClusterServiceBroker u1 = client.clusterServiceBrokers().withName("broker1").edit(c -> new ClusterServiceBrokerBuilder(c) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceClassTest.java b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceClassTest.java index 02f9f1a6e00..e5dc22540d6 100644 --- a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceClassTest.java +++ b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServiceClassTest.java @@ -82,11 +82,11 @@ void testCrud() { assertNotNull(r1); //Update - ClusterServiceClass u1 = client.clusterServiceClasses().withName("class1").edit() + ClusterServiceClass u1 = client.clusterServiceClasses().withName("class1").edit(c -> new ClusterServiceClassBuilder(c) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServicePlanTest.java b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServicePlanTest.java index c852f2c76d9..401a4ea15a1 100644 --- a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServicePlanTest.java +++ b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ClusterServicePlanTest.java @@ -84,11 +84,11 @@ void testCrud() { assertNotNull(r1); //Update - ClusterServicePlan u1 = client.clusterServicePlans().withName("plan1").edit() + ClusterServicePlan u1 = client.clusterServicePlans().withName("plan1").edit(c -> new ClusterServicePlanBuilder(c) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceBindingTest.java b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceBindingTest.java index d9591f0c59b..bd66de39de8 100644 --- a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceBindingTest.java +++ b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceBindingTest.java @@ -103,11 +103,11 @@ void testCrud() { assertNotNull(r1); //Update - ServiceBinding u1 = client.serviceBindings().inNamespace("testns").withName("binding1").edit() + ServiceBinding u1 = client.serviceBindings().inNamespace("testns").withName("binding1").edit(s -> new ServiceBindingBuilder(s) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceInstanceTest.java b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceInstanceTest.java index 77e9b1636eb..7008e3e82bf 100644 --- a/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceInstanceTest.java +++ b/extensions/service-catalog/tests/src/test/java/io/fabric8/servicecatalog/test/crud/ServiceInstanceTest.java @@ -103,11 +103,11 @@ void testCrud() { assertNotNull(r1); //Update - ServiceInstance u1 = client.serviceInstances().inNamespace("testns").withName("instance1").edit() + ServiceInstance u1 = client.serviceInstances().inNamespace("testns").withName("instance1").edit(s -> new ServiceInstanceBuilder(s) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1alpha1APIGroupClient.java b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1alpha1APIGroupClient.java index d12d94f3ec8..b5ba4d1dade 100644 --- a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1alpha1APIGroupClient.java +++ b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1alpha1APIGroupClient.java @@ -26,12 +26,6 @@ import io.fabric8.tekton.pipeline.v1alpha1.ClusterTaskList; import io.fabric8.tekton.pipeline.v1alpha1.Condition; import io.fabric8.tekton.pipeline.v1alpha1.ConditionList; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableClusterTask; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableCondition; -import io.fabric8.tekton.pipeline.v1alpha1.DoneablePipeline; -import io.fabric8.tekton.pipeline.v1alpha1.DoneablePipelineRun; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableTask; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableTaskRun; import io.fabric8.tekton.pipeline.v1alpha1.Pipeline; import io.fabric8.tekton.pipeline.v1alpha1.PipelineList; import io.fabric8.tekton.pipeline.v1alpha1.PipelineRun; @@ -40,14 +34,9 @@ import io.fabric8.tekton.pipeline.v1alpha1.TaskList; import io.fabric8.tekton.pipeline.v1alpha1.TaskRun; import io.fabric8.tekton.pipeline.v1alpha1.TaskRunList; -import io.fabric8.tekton.resource.v1alpha1.DoneablePipelineResource; import io.fabric8.tekton.resource.v1alpha1.PipelineResource; import io.fabric8.tekton.resource.v1alpha1.PipelineResourceList; import io.fabric8.tekton.triggers.v1alpha1.*; -import io.fabric8.tekton.triggers.v1alpha1.DoneableClusterTriggerBinding; -import io.fabric8.tekton.triggers.v1alpha1.DoneableEventListener; -import io.fabric8.tekton.triggers.v1alpha1.DoneableTriggerBinding; -import io.fabric8.tekton.triggers.v1alpha1.DoneableTriggerTemplate; import okhttp3.OkHttpClient; public class V1alpha1APIGroupClient extends BaseClient implements V1alpha1APIGroupDSL { @@ -60,57 +49,57 @@ public V1alpha1APIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> pipelines() { + public MixedOperation> pipelines() { return new PipelineOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> pipelineRuns() { + public MixedOperation> pipelineRuns() { return new PipelineRunOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> pipelineResources() { + public MixedOperation> pipelineResources() { return new PipelineResourceOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> tasks() { + public MixedOperation> tasks() { return new TaskOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> taskRuns() { + public MixedOperation> taskRuns() { return new TaskRunOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> conditions() { + public MixedOperation> conditions() { return new ConditionOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> triggerTemplates() { + public MixedOperation> triggerTemplates() { return new TriggerTemplateOperationsImpl(this.getHttpClient(),this.getConfiguration()); } @Override - public MixedOperation> triggerBindings() { + public MixedOperation> triggerBindings() { return new TriggerBindingOperationsImpl(this.getHttpClient(),this.getConfiguration()); } @Override - public MixedOperation> eventListeners() { + public MixedOperation> eventListeners() { return new EventListenerOperationsImpl(this.getHttpClient(),this.getConfiguration()); } @Override - public NonNamespaceOperation> clusterTasks() { + public NonNamespaceOperation> clusterTasks() { return new ClusterTaskOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public NonNamespaceOperation> clusterTriggerBindings() { + public NonNamespaceOperation> clusterTriggerBindings() { return new ClusterTriggerBindingOperationsImpl(this.getHttpClient(),this.getConfiguration()); } } diff --git a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1beta1APIGroupClient.java b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1beta1APIGroupClient.java index faa56c20257..6de7da55a97 100644 --- a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1beta1APIGroupClient.java +++ b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/V1beta1APIGroupClient.java @@ -27,11 +27,6 @@ import io.fabric8.tekton.client.internal.v1beta1.TaskRunOperationsImpl; import io.fabric8.tekton.pipeline.v1beta1.ClusterTask; import io.fabric8.tekton.pipeline.v1beta1.ClusterTaskList; -import io.fabric8.tekton.pipeline.v1beta1.DoneableClusterTask; -import io.fabric8.tekton.pipeline.v1beta1.DoneablePipeline; -import io.fabric8.tekton.pipeline.v1beta1.DoneablePipelineRun; -import io.fabric8.tekton.pipeline.v1beta1.DoneableTask; -import io.fabric8.tekton.pipeline.v1beta1.DoneableTaskRun; import io.fabric8.tekton.pipeline.v1beta1.Pipeline; import io.fabric8.tekton.pipeline.v1beta1.PipelineList; import io.fabric8.tekton.pipeline.v1beta1.PipelineRun; @@ -53,27 +48,27 @@ public V1beta1APIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> pipelines() { + public MixedOperation> pipelines() { return new PipelineOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> pipelineRuns() { + public MixedOperation> pipelineRuns() { return new PipelineRunOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> tasks() { + public MixedOperation> tasks() { return new TaskOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public MixedOperation> taskRuns() { + public MixedOperation> taskRuns() { return new TaskRunOperationsImpl(this.getHttpClient(), this.getConfiguration()); } @Override - public NonNamespaceOperation> clusterTasks() { + public NonNamespaceOperation> clusterTasks() { return new ClusterTaskOperationsImpl(this.getHttpClient(), this.getConfiguration()); } } diff --git a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1alpha1APIGroupDSL.java b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1alpha1APIGroupDSL.java index 10b81db1023..45323ec7216 100644 --- a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1alpha1APIGroupDSL.java +++ b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1alpha1APIGroupDSL.java @@ -21,14 +21,8 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.tekton.pipeline.v1alpha1.Condition; import io.fabric8.tekton.pipeline.v1alpha1.ConditionList; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableCondition; import io.fabric8.tekton.pipeline.v1alpha1.ClusterTask; import io.fabric8.tekton.pipeline.v1alpha1.ClusterTaskList; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableClusterTask; -import io.fabric8.tekton.pipeline.v1alpha1.DoneablePipeline; -import io.fabric8.tekton.pipeline.v1alpha1.DoneablePipelineRun; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableTask; -import io.fabric8.tekton.pipeline.v1alpha1.DoneableTaskRun; import io.fabric8.tekton.pipeline.v1alpha1.Pipeline; import io.fabric8.tekton.pipeline.v1alpha1.PipelineList; import io.fabric8.tekton.pipeline.v1alpha1.PipelineRun; @@ -37,14 +31,9 @@ import io.fabric8.tekton.pipeline.v1alpha1.TaskList; import io.fabric8.tekton.pipeline.v1alpha1.TaskRun; import io.fabric8.tekton.pipeline.v1alpha1.TaskRunList; -import io.fabric8.tekton.resource.v1alpha1.DoneablePipelineResource; import io.fabric8.tekton.resource.v1alpha1.PipelineResource; import io.fabric8.tekton.resource.v1alpha1.PipelineResourceList; import io.fabric8.tekton.triggers.v1alpha1.*; -import io.fabric8.tekton.triggers.v1alpha1.DoneableClusterTriggerBinding; -import io.fabric8.tekton.triggers.v1alpha1.DoneableEventListener; -import io.fabric8.tekton.triggers.v1alpha1.DoneableTriggerBinding; -import io.fabric8.tekton.triggers.v1alpha1.DoneableTriggerTemplate; public interface V1alpha1APIGroupDSL extends Client { /** @@ -52,75 +41,75 @@ public interface V1alpha1APIGroupDSL extends Client { * * @return MixedOperation for Pipeline class */ - MixedOperation> pipelines(); + MixedOperation> pipelines(); /** * API entrypoint for PipelineRun(tekton.dev/v1alpha1) * * @return MixedOperation for PipelineRun class */ - MixedOperation> pipelineRuns(); + MixedOperation> pipelineRuns(); /** * API entrypoint for PipelineResource(tekton.dev/v1alpha1) * * @return MixedOperation for PipelineResource class */ - MixedOperation> pipelineResources(); + MixedOperation> pipelineResources(); /** * API entrypoint for Task(tekton.dev/v1alpha1) * * @return MixedOperation for Task class */ - MixedOperation> tasks(); + MixedOperation> tasks(); /** * API entrypoint for TaskRun(tekton.dev/v1alpha1) * * @return MixedOperation for TaskRun class */ - MixedOperation> taskRuns(); + MixedOperation> taskRuns(); /** * API entrypoint for Condition(tekton.dev/v1alpha1) * * @return MixedOperation for Condition class */ - MixedOperation> conditions(); + MixedOperation> conditions(); /** * API entrypoint for TriggerTemplate(triggers.tekton.dev/v1alpha1) * * @return MixedOperation for TriggerTemplate class */ - MixedOperation> triggerTemplates(); + MixedOperation> triggerTemplates(); /** * API entrypoint for TriggerBinding(triggers.tekton.dev/v1alpha1) * * @return MixedOperation for TriggerBinding class */ - MixedOperation> triggerBindings(); + MixedOperation> triggerBindings(); /** * API entrypoint for EventListener(triggers.tekton.dev/v1alpha1) * * @return MixedOperation for EventListener class */ - MixedOperation> eventListeners(); + MixedOperation> eventListeners(); /** * API entrypoint for ClusterTask(tekton.dev/v1alpha1) * * @return MixedOperation for ClusterTask class */ - NonNamespaceOperation> clusterTasks(); + NonNamespaceOperation> clusterTasks(); /** * API entrypoint for ClusterTriggerBinding(triggers.tekton.dev/v1alpha1) * * @return MixedOperation for ClusterTriggerBinding class */ - NonNamespaceOperation> clusterTriggerBindings(); + NonNamespaceOperation> clusterTriggerBindings(); } diff --git a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1beta1APIGroupDSL.java b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1beta1APIGroupDSL.java index bd79f0a837a..d60b9555523 100644 --- a/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1beta1APIGroupDSL.java +++ b/extensions/tekton/client/src/main/java/io/fabric8/tekton/client/dsl/V1beta1APIGroupDSL.java @@ -21,11 +21,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.tekton.pipeline.v1beta1.ClusterTask; import io.fabric8.tekton.pipeline.v1beta1.ClusterTaskList; -import io.fabric8.tekton.pipeline.v1beta1.DoneableClusterTask; -import io.fabric8.tekton.pipeline.v1beta1.DoneablePipeline; -import io.fabric8.tekton.pipeline.v1beta1.DoneablePipelineRun; -import io.fabric8.tekton.pipeline.v1beta1.DoneableTask; -import io.fabric8.tekton.pipeline.v1beta1.DoneableTaskRun; import io.fabric8.tekton.pipeline.v1beta1.Pipeline; import io.fabric8.tekton.pipeline.v1beta1.PipelineList; import io.fabric8.tekton.pipeline.v1beta1.PipelineRun; @@ -41,34 +36,34 @@ public interface V1beta1APIGroupDSL extends Client { * * @return MixedOperation for Pipeline class */ - MixedOperation> pipelines(); + MixedOperation> pipelines(); /** * API entrypoint for PipelineRun(tekton.dev/v1beta1) * * @return MixedOperation for PipelineRun class */ - MixedOperation> pipelineRuns(); + MixedOperation> pipelineRuns(); /** * API entrypoint for Task(tekton.dev/v1beta1) * * @return MixedOperation for Task class */ - MixedOperation> tasks(); + MixedOperation> tasks(); /** * API entrypoint for TaskRun(tekton.dev/v1beta1) * * @return MixedOperation for TaskRun class */ - MixedOperation> taskRuns(); + MixedOperation> taskRuns(); /** * API entrypoint for ClusterTask(tekton.dev/v1beta1) * * @return MixedOperation for ClusterTask class */ - NonNamespaceOperation> clusterTasks(); + NonNamespaceOperation> clusterTasks(); } diff --git a/extensions/tekton/client/src/main/resources/resource-operation.vm b/extensions/tekton/client/src/main/resources/resource-operation.vm index 7139a92310b..f86b3d4c1ca 100644 --- a/extensions/tekton/client/src/main/resources/resource-operation.vm +++ b/extensions/tekton/client/src/main/resources/resource-operation.vm @@ -44,16 +44,14 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); @@ -65,7 +63,6 @@ public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.na .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) { diff --git a/extensions/tekton/model-v1alpha1/src/main/java/io/fabric8/tekton/pipeline/v1alpha1/ArrayOrString.java b/extensions/tekton/model-v1alpha1/src/main/java/io/fabric8/tekton/pipeline/v1alpha1/ArrayOrString.java index d7895fc30f3..425693fc6f6 100644 --- a/extensions/tekton/model-v1alpha1/src/main/java/io/fabric8/tekton/pipeline/v1alpha1/ArrayOrString.java +++ b/extensions/tekton/model-v1alpha1/src/main/java/io/fabric8/tekton/pipeline/v1alpha1/ArrayOrString.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.Inline; @@ -44,7 +43,7 @@ @JsonSerialize(using = ArrayOrString.Serializer.class) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder") public class ArrayOrString implements KubernetesResource { private static final String TYPE_STRING = "string"; diff --git a/extensions/tekton/model-v1beta1/src/main/java/io/fabric8/tekton/pipeline/v1beta1/ArrayOrString.java b/extensions/tekton/model-v1beta1/src/main/java/io/fabric8/tekton/pipeline/v1beta1/ArrayOrString.java index 4fb9bef5719..4a7b772dd8e 100644 --- a/extensions/tekton/model-v1beta1/src/main/java/io/fabric8/tekton/pipeline/v1beta1/ArrayOrString.java +++ b/extensions/tekton/model-v1beta1/src/main/java/io/fabric8/tekton/pipeline/v1beta1/ArrayOrString.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.Inline; @@ -44,7 +43,7 @@ @JsonSerialize(using = ArrayOrString.Serializer.class) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder") public class ArrayOrString implements KubernetesResource { private static final String TYPE_STRING = "string"; diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/DefaultVolumeSnapshotClient.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/DefaultVolumeSnapshotClient.java index dbcc389f6a7..9527ffe547c 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/DefaultVolumeSnapshotClient.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/DefaultVolumeSnapshotClient.java @@ -23,9 +23,6 @@ import io.fabric8.kubernetes.client.dsl.FunctionCallable; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshot; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotClass; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotContent; import io.fabric8.volumesnapshot.api.model.VolumeSnapshot; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClassList; @@ -54,15 +51,15 @@ public DefaultVolumeSnapshotClient(OkHttpClient httpClient, Config configuration super(httpClient, configuration); } - public NonNamespaceOperation volumeSnapshotClasses() { + public NonNamespaceOperation volumeSnapshotClasses() { return new VolumeSnapshotClassOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public NonNamespaceOperation volumeSnapshotContents() { + public NonNamespaceOperation volumeSnapshotContents() { return new VolumeSnapshotContentOperationsImpl(this.getHttpClient(), this.getConfiguration()); } - public MixedOperation volumeSnapshots() { + public MixedOperation volumeSnapshots() { return new VolumeSnapshotOperationsImpl(this.getHttpClient(), this.getConfiguration()); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/VolumeSnapshotClient.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/VolumeSnapshotClient.java index 6d1cdb30beb..4cc76553e0c 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/VolumeSnapshotClient.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/VolumeSnapshotClient.java @@ -19,9 +19,6 @@ import io.fabric8.kubernetes.client.Client; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshot; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotClass; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotContent; import io.fabric8.volumesnapshot.api.model.VolumeSnapshot; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClassList; @@ -42,19 +39,19 @@ public interface VolumeSnapshotClient extends Client { * * @return NonNamespaceOperation for VolumeSnapshotClass class */ - NonNamespaceOperation volumeSnapshotClasses(); + NonNamespaceOperation volumeSnapshotClasses(); /** * API entrypoint for dealing with VolumeSnapshotContent(snapshot.storage.k8s.io/v1beta1) * * @return NonNamespaceOperation for VolumeSnapshotContent class */ - NonNamespaceOperation volumeSnapshotContents(); + NonNamespaceOperation volumeSnapshotContents(); /** * API entrypoint for dealing with VolumeSnapshot(snapshot.storage.k8s.io/v1beta1) * * @return MixedOperation for VolumeSnapshot class */ - MixedOperation volumeSnapshots(); + MixedOperation volumeSnapshots(); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassOperationsImpl.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassOperationsImpl.java index d1eb612c0b8..c0240eaefa0 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassOperationsImpl.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassOperationsImpl.java @@ -19,7 +19,6 @@ import io.fabric8.kubernetes.client.dsl.base.BaseOperation; import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClassList; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotList; @@ -29,7 +28,7 @@ import java.util.Map; -public class VolumeSnapshotClassOperationsImpl extends HasMetadataOperation implements VolumeSnapshotClassResource { +public class VolumeSnapshotClassOperationsImpl extends HasMetadataOperation implements VolumeSnapshotClassResource { public VolumeSnapshotClassOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -39,11 +38,10 @@ public VolumeSnapshotClassOperationsImpl(OperationContext context) { super(context.withApiGroupName("snapshot.storage.k8s.io").withApiGroupVersion("v1beta1").withPlural("volumesnapshotclasses")); this.type = VolumeSnapshotClass.class; this.listType = VolumeSnapshotClassList.class; - this.doneableType = DoneableVolumeSnapshotClass.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new VolumeSnapshotClassOperationsImpl(context); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassResource.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassResource.java index 187c3adb24f..7db08bdf257 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassResource.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotClassResource.java @@ -16,10 +16,9 @@ package io.fabric8.volumesnapshot.client.internal; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClass; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotList; -public interface VolumeSnapshotClassResource extends Resource { +public interface VolumeSnapshotClassResource extends Resource { VolumeSnapshotList listSnapshots(); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentOperationsImpl.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentOperationsImpl.java index 14ded75d562..3258e2ed5b5 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentOperationsImpl.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentOperationsImpl.java @@ -19,13 +19,12 @@ import io.fabric8.kubernetes.client.dsl.base.BaseOperation; import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotContent; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotContent; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotContentList; import okhttp3.OkHttpClient; -public class VolumeSnapshotContentOperationsImpl extends HasMetadataOperation implements VolumeSnapshotContentResource { +public class VolumeSnapshotContentOperationsImpl extends HasMetadataOperation implements VolumeSnapshotContentResource { public VolumeSnapshotContentOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -35,11 +34,10 @@ public VolumeSnapshotContentOperationsImpl(OperationContext context) { super(context.withApiGroupName("snapshot.storage.k8s.io").withApiGroupVersion("v1beta1").withPlural("volumesnapshotcontents")); this.type = VolumeSnapshotContent.class; this.listType = VolumeSnapshotContentList.class; - this.doneableType = DoneableVolumeSnapshotContent.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new VolumeSnapshotContentOperationsImpl(context); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentResource.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentResource.java index f13abf79a25..761a8539b67 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentResource.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotContentResource.java @@ -16,9 +16,8 @@ package io.fabric8.volumesnapshot.client.internal; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshotContent; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotContent; -public interface VolumeSnapshotContentResource extends Resource { +public interface VolumeSnapshotContentResource extends Resource { } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotOperationsImpl.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotOperationsImpl.java index 1201e91cc9d..0f116ea757b 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotOperationsImpl.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotOperationsImpl.java @@ -19,12 +19,11 @@ import io.fabric8.kubernetes.client.dsl.base.BaseOperation; import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshot; import io.fabric8.volumesnapshot.api.model.VolumeSnapshot; import io.fabric8.volumesnapshot.api.model.VolumeSnapshotList; import okhttp3.OkHttpClient; -public class VolumeSnapshotOperationsImpl extends HasMetadataOperation implements VolumeSnapshotResource { +public class VolumeSnapshotOperationsImpl extends HasMetadataOperation implements VolumeSnapshotResource { public VolumeSnapshotOperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -34,11 +33,10 @@ public VolumeSnapshotOperationsImpl(OperationContext ctx) { super(ctx.withApiGroupName("snapshot.storage.k8s.io").withApiGroupVersion("v1beta1").withPlural("volumesnapshots")); this.type = VolumeSnapshot.class; this.listType = VolumeSnapshotList.class; - this.doneableType = DoneableVolumeSnapshot.class; } @Override - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new VolumeSnapshotOperationsImpl(context); } diff --git a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotResource.java b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotResource.java index 711f48c674c..f3a7540f3b4 100644 --- a/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotResource.java +++ b/extensions/volumesnapshot/client/src/main/java/io/fabric8/volumesnapshot/client/internal/VolumeSnapshotResource.java @@ -16,9 +16,8 @@ package io.fabric8.volumesnapshot.client.internal; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.volumesnapshot.api.model.DoneableVolumeSnapshot; import io.fabric8.volumesnapshot.api.model.VolumeSnapshot; -public interface VolumeSnapshotResource extends Resource { +public interface VolumeSnapshotResource extends Resource { } diff --git a/extensions/volumesnapshot/client/src/main/resources/resource-operation.vm b/extensions/volumesnapshot/client/src/main/resources/resource-operation.vm index d3b901de6cd..fadf7166e72 100644 --- a/extensions/volumesnapshot/client/src/main/resources/resource-operation.vm +++ b/extensions/volumesnapshot/client/src/main/resources/resource-operation.vm @@ -44,16 +44,14 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, Config config) { this(new OperationContext().withOkhttpClient(client).withConfig(config).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); @@ -65,7 +63,6 @@ public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.na .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) { diff --git a/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshot.java b/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshot.java index 24f77321fe1..da5892c91cc 100644 --- a/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshot.java +++ b/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshot.java @@ -16,6 +16,7 @@ package io.fabric8.volumesnapshot.examples; import io.fabric8.volumesnapshot.client.VolumeSnapshotClient; +import io.fabric8.volumesnapshot.api.model.VolumeSnapshotBuilder; @SuppressWarnings("java:S106") public class CreateVolumeSnapshot { @@ -23,7 +24,7 @@ public class CreateVolumeSnapshot { public static void main(String[] args) { try (VolumeSnapshotClient client = ClientFactory.newClient(args)) { System.out.println("Creating a volume snapshot"); - client.volumeSnapshots().inNamespace("default").createNew() + client.volumeSnapshots().inNamespace("default").create(new VolumeSnapshotBuilder() .withNewMetadata() .withName("my-snapshot") .endMetadata() @@ -32,7 +33,7 @@ public static void main(String[] args) { .withNewPersistentVolumeClaimName("my-pvc") .endSource() .endSpec() - .done(); + .build()); } } } diff --git a/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshotClass.java b/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshotClass.java index bbdc910ba50..a63097329a2 100644 --- a/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshotClass.java +++ b/extensions/volumesnapshot/examples/src/main/java/io/fabric8/volumesnapshot/examples/CreateVolumeSnapshotClass.java @@ -16,18 +16,19 @@ package io.fabric8.volumesnapshot.examples; import io.fabric8.volumesnapshot.client.VolumeSnapshotClient; - +import io.fabric8.volumesnapshot.api.model.VolumeSnapshotClassBuilder; + public class CreateVolumeSnapshotClass { public static void main(String[] args) { try (VolumeSnapshotClient client = ClientFactory.newClient(args)) { - client.volumeSnapshotClasses().createNew() + client.volumeSnapshotClasses().create(new VolumeSnapshotClassBuilder() .withNewMetadata() .withName("my-snapshot-class") .endMetadata() .withNewDriver("my-csi-driver") .withDeletionPolicy("Delete") - .done(); + .build()); } } } diff --git a/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotClassTest.java b/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotClassTest.java index 6737415349e..dcbcdd8adcb 100644 --- a/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotClassTest.java +++ b/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotClassTest.java @@ -80,11 +80,11 @@ void testCrud() { assertNotNull(sc1); //Update - VolumeSnapshotClass u1 = client.volumeSnapshotClasses().withName("csi-snapclass2").edit() + VolumeSnapshotClass u1 = client.volumeSnapshotClasses().withName("csi-snapclass2").edit(v -> new VolumeSnapshotClassBuilder(v) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotTest.java b/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotTest.java index 317a19a452e..fa903b352e9 100644 --- a/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotTest.java +++ b/extensions/volumesnapshot/tests/src/test/java/io/fabric8/volumesnapshot/test/crud/VolumeSnapshotTest.java @@ -91,11 +91,11 @@ void testCrud() { //Update - VolumeSnapshot u1 = client.volumeSnapshots().withName("my-snapshot1").edit() + VolumeSnapshot u1 = client.volumeSnapshots().withName("my-snapshot1").edit(v -> new VolumeSnapshotBuilder(v) .editMetadata() .addToLabels("updated", "true") .endMetadata() - .done(); + .build()); assertNotNull(u1); assertEquals("true", u1.getMetadata().getLabels().get("updated")); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AppsAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AppsAPIGroupClient.java index 0e9f4f1b550..b4c862fb6fa 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AppsAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AppsAPIGroupClient.java @@ -17,16 +17,12 @@ import io.fabric8.kubernetes.api.model.apps.DaemonSet; import io.fabric8.kubernetes.api.model.apps.DaemonSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableDaemonSet; import io.fabric8.kubernetes.api.model.apps.Deployment; import io.fabric8.kubernetes.api.model.apps.DeploymentList; -import io.fabric8.kubernetes.api.model.apps.DoneableDeployment; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.apps.StatefulSet; import io.fabric8.kubernetes.api.model.apps.StatefulSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableStatefulSet; import io.fabric8.kubernetes.client.dsl.RollableScalableResource; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -49,22 +45,22 @@ public AppsAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> daemonSets() { + public MixedOperation> daemonSets() { return new DaemonSetOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> deployments() { + public MixedOperation> deployments() { return new DeploymentOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> replicaSets() { + public MixedOperation> replicaSets() { return new ReplicaSetOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> statefulSets() { + public MixedOperation> statefulSets() { return new StatefulSetOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java index a03ca3a1e6d..ed0ad1f46ef 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java @@ -19,21 +19,6 @@ import io.fabric8.kubernetes.api.model.ComponentStatusList; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; -import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.DoneableEvent; -import io.fabric8.kubernetes.api.model.DoneableLimitRange; -import io.fabric8.kubernetes.api.model.DoneableNamespace; -import io.fabric8.kubernetes.api.model.DoneableNode; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolume; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; -import io.fabric8.kubernetes.api.model.DoneablePod; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; -import io.fabric8.kubernetes.api.model.DoneableResourceQuota; -import io.fabric8.kubernetes.api.model.DoneableSecret; -import io.fabric8.kubernetes.api.model.DoneableService; -import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; import io.fabric8.kubernetes.api.model.Event; @@ -158,92 +143,92 @@ public AuthorizationAPIGroupDSL authorization() { public RbacAPIGroupDSL rbac() { return delegate.rbac(); } @Override - public MixedOperation> componentstatuses() { + public MixedOperation> componentstatuses() { return delegate.componentstatuses(); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { return delegate.load(is); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { return delegate.resourceList(is); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { return delegate.resourceList(s); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata is) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata is) { return delegate.resource(is); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { return delegate.resource(s); } @Override - public MixedOperation> endpoints() { + public MixedOperation> endpoints() { return delegate.endpoints(); } @Override - public MixedOperation> events() { + public MixedOperation> events() { return delegate.events(); } @Override - public NonNamespaceOperation> namespaces() { + public NonNamespaceOperation> namespaces() { return delegate.namespaces(); } @Override - public NonNamespaceOperation> nodes() { + public NonNamespaceOperation> nodes() { return delegate.nodes(); } @Override - public NonNamespaceOperation> persistentVolumes() { + public NonNamespaceOperation> persistentVolumes() { return delegate.persistentVolumes(); } @Override - public MixedOperation> persistentVolumeClaims() { + public MixedOperation> persistentVolumeClaims() { return delegate.persistentVolumeClaims(); } @Override - public MixedOperation> pods() { + public MixedOperation> pods() { return delegate.pods(); } @Override - public MixedOperation> replicationControllers() { + public MixedOperation> replicationControllers() { return delegate.replicationControllers(); } @Override - public MixedOperation> resourceQuotas() { + public MixedOperation> resourceQuotas() { return delegate.resourceQuotas(); } @Override - public MixedOperation> secrets() { + public MixedOperation> secrets() { return delegate.secrets(); } @Override - public MixedOperation> services() { + public MixedOperation> services() { return delegate.services(); } @Override - public MixedOperation> serviceAccounts() { + public MixedOperation> serviceAccounts() { return delegate.serviceAccounts(); } @@ -253,12 +238,12 @@ public KubernetesListMixedOperation lists() { } @Override - public MixedOperation> configMaps() { + public MixedOperation> configMaps() { return delegate.configMaps(); } @Override - public MixedOperation> limitRanges() { + public MixedOperation> limitRanges() { return delegate.limitRanges(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/BatchAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/BatchAPIGroupClient.java index c709a34a8da..15bcd154111 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/BatchAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/BatchAPIGroupClient.java @@ -16,11 +16,9 @@ package io.fabric8.kubernetes.client; import io.fabric8.kubernetes.api.model.batch.CronJob; -import io.fabric8.kubernetes.api.model.batch.DoneableJob; import io.fabric8.kubernetes.api.model.batch.Job; import io.fabric8.kubernetes.api.model.batch.JobList; import io.fabric8.kubernetes.api.model.batch.CronJobList; -import io.fabric8.kubernetes.api.model.batch.DoneableCronJob; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.BatchAPIGroupDSL; import io.fabric8.kubernetes.client.dsl.Resource; @@ -40,12 +38,12 @@ public BatchAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> jobs() { + public MixedOperation> jobs() { return new JobOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> cronjobs() { + public MixedOperation> cronjobs() { return new CronJobOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResourceDoneable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResourceDoneable.java deleted file mode 100644 index 5f1503172b9..00000000000 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResourceDoneable.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.kubernetes.client; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.api.model.Doneable; -import lombok.ToString; - -/** - */ -@ToString -public class CustomResourceDoneable implements Doneable { - private final T resource; - private final Function function; - - public CustomResourceDoneable(T resource, Function function) { - this.resource = resource; - this.function = function; - } - - @Override - public T done() { - return function.apply(resource); - } -} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java index e7c13d7889c..29163bde1f6 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java @@ -19,69 +19,46 @@ import io.fabric8.kubernetes.api.model.APIServiceList; import io.fabric8.kubernetes.api.model.Binding; import io.fabric8.kubernetes.api.model.DeletionPropagation; -import io.fabric8.kubernetes.api.model.Doneable; -import io.fabric8.kubernetes.api.model.DoneableAPIService; -import io.fabric8.kubernetes.api.model.DoneableBinding; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.ComponentStatus; import io.fabric8.kubernetes.api.model.ComponentStatusList; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; -import io.fabric8.kubernetes.api.model.DoneableEndpoints; import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.EventList; -import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.LimitRange; import io.fabric8.kubernetes.api.model.LimitRangeList; -import io.fabric8.kubernetes.api.model.DoneableLimitRange; import io.fabric8.kubernetes.api.model.Namespace; import io.fabric8.kubernetes.api.model.NamespaceList; -import io.fabric8.kubernetes.api.model.DoneableNamespace; import io.fabric8.kubernetes.api.model.Node; import io.fabric8.kubernetes.api.model.NodeList; -import io.fabric8.kubernetes.api.model.DoneableNode; import io.fabric8.kubernetes.api.model.PersistentVolume; import io.fabric8.kubernetes.api.model.PersistentVolumeList; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolume; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimList; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.ReplicationController; import io.fabric8.kubernetes.api.model.ReplicationControllerList; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; import io.fabric8.kubernetes.api.model.ResourceQuota; import io.fabric8.kubernetes.api.model.ResourceQuotaList; -import io.fabric8.kubernetes.api.model.DoneableResourceQuota; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.SecretList; -import io.fabric8.kubernetes.api.model.DoneableSecret; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.ServiceList; -import io.fabric8.kubernetes.api.model.DoneableService; import io.fabric8.kubernetes.api.model.ServiceAccount; import io.fabric8.kubernetes.api.model.ServiceAccountList; -import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequest; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequestList; -import io.fabric8.kubernetes.api.model.certificates.DoneableCertificateSigningRequest; -import io.fabric8.kubernetes.api.model.authentication.DoneableTokenReview; import io.fabric8.kubernetes.api.model.authentication.TokenReview; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; -import io.fabric8.kubernetes.api.model.node.v1beta1.DoneableRuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClassList; import io.fabric8.kubernetes.client.dsl.*; @@ -166,7 +143,7 @@ public static DefaultKubernetesClient fromConfig(InputStream is) { * {@inheritDoc} */ @Override - public MixedOperation> componentstatuses() { + public MixedOperation> componentstatuses() { return new ComponentStatusOperationsImpl(httpClient, getConfiguration()); } @@ -174,7 +151,7 @@ public MixedOperation load(InputStream is) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), is, null, true, DeletionPropagation.BACKGROUND) { }; } @@ -183,7 +160,7 @@ public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList item) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList item) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), item, null, DeletionPropagation.BACKGROUND, true) { }; } @@ -192,7 +169,7 @@ public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { return resourceList(new KubernetesListBuilder().withItems(items).build()); } @@ -200,7 +177,7 @@ public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { return resourceList(new KubernetesListBuilder().withItems(new ArrayList<>(items)).build()); } @@ -208,7 +185,7 @@ public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), s, null, DeletionPropagation.BACKGROUND, true) { }; } @@ -217,7 +194,7 @@ public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resource(HasMetadata item) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata item) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), item, -1, DeletionPropagation.BACKGROUND, true, Waitable.DEFAULT_INITIAL_BACKOFF_MILLIS, Waitable.DEFAULT_BACKOFF_MULTIPLIER); } @@ -225,7 +202,7 @@ public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), s, -1, DeletionPropagation.BACKGROUND, true, Waitable.DEFAULT_INITIAL_BACKOFF_MILLIS, Waitable.DEFAULT_BACKOFF_MULTIPLIER); } @@ -233,7 +210,7 @@ public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable, DoneableBinding, Resource> bindings() { + public MixedOperation, Resource> bindings() { return new BindingOperationsImpl(httpClient, getConfiguration()); } @@ -241,7 +218,7 @@ public MixedOperation, DoneableBinding, * {@inheritDoc} */ @Override - public MixedOperation> endpoints() { + public MixedOperation> endpoints() { return new EndpointsOperationsImpl(httpClient, getConfiguration()); } @@ -249,7 +226,7 @@ public MixedOperation> events() { + public MixedOperation> events() { return new EventOperationsImpl(httpClient, getConfiguration()); } @@ -257,7 +234,7 @@ public MixedOperation> namespaces() { + public NonNamespaceOperation> namespaces() { return new NamespaceOperationsImpl(httpClient, getConfiguration()); } @@ -265,7 +242,7 @@ public NonNamespaceOperation> nodes() { + public NonNamespaceOperation> nodes() { return new NodeOperationsImpl(httpClient, getConfiguration()); } @@ -273,7 +250,7 @@ public NonNamespaceOperation> persistentVolumes() { + public NonNamespaceOperation> persistentVolumes() { return new PersistentVolumeOperationsImpl(httpClient, getConfiguration()); } @@ -281,7 +258,7 @@ public NonNamespaceOperation> persistentVolumeClaims() { + public MixedOperation> persistentVolumeClaims() { return new PersistentVolumeClaimOperationsImpl(httpClient, getConfiguration()); } @@ -289,7 +266,7 @@ public MixedOperation> pods() { + public MixedOperation> pods() { return new PodOperationsImpl(httpClient, getConfiguration()); } @@ -297,7 +274,7 @@ public MixedOperation> * {@inheritDoc} */ @Override - public MixedOperation> replicationControllers() { + public MixedOperation> replicationControllers() { return new ReplicationControllerOperationsImpl(httpClient, getConfiguration()); } @@ -305,7 +282,7 @@ public MixedOperation> resourceQuotas() { + public MixedOperation> resourceQuotas() { return new ResourceQuotaOperationsImpl(httpClient, getConfiguration()); } @@ -318,7 +295,7 @@ public SchedulingAPIGroupDSL scheduling() { } @Override - public MixedOperation> secrets() { + public MixedOperation> secrets() { return new SecretOperationsImpl(httpClient, getConfiguration()); } @@ -326,7 +303,7 @@ public MixedOperation> services() { + public MixedOperation> services() { return new ServiceOperationsImpl(httpClient, getConfiguration()); } @@ -334,7 +311,7 @@ public MixedOperation> serviceAccounts() { + public MixedOperation> serviceAccounts() { return new ServiceAccountOperationsImpl(httpClient, getConfiguration()); } @@ -342,7 +319,7 @@ public MixedOperation> apiServices() { + public MixedOperation> apiServices() { return new APIServiceOperationsImpl(httpClient, getConfiguration()); } @@ -358,7 +335,7 @@ public KubernetesListMixedOperation lists() { * {@inheritDoc} */ @Override - public MixedOperation> configMaps() { + public MixedOperation> configMaps() { return new ConfigMapOperationsImpl(httpClient, getConfiguration()); } @@ -366,7 +343,7 @@ public MixedOperation> limitRanges() { + public MixedOperation> limitRanges() { return new LimitRangeOperationsImpl(httpClient, getConfiguration()); } @@ -374,7 +351,7 @@ public MixedOperation> customResourceDefinitions() { + public NonNamespaceOperation> customResourceDefinitions() { return new CustomResourceDefinitionOperationsImpl(httpClient, getConfiguration()); } @@ -390,7 +367,7 @@ public ApiextensionsAPIGroupDSL apiextensions() { * {@inheritDoc} */ @Override - public NonNamespaceOperation> certificateSigningRequests() { + public NonNamespaceOperation> certificateSigningRequests() { return new CertificateSigningRequestOperationsImpl(httpClient, getConfiguration()); } @@ -406,7 +383,7 @@ public AuthorizationAPIGroupDSL authorization() { * {@inheritDoc} */ @Override - public Createable tokenReviews() { + public Createable tokenReviews() { return new CreateOnlyResourceOperationsImpl<>(httpClient, getConfiguration(), "authentication.k8s.io", "v1", Utils.getPluralFromKind(TokenReview.class.getSimpleName()), TokenReview.class); } @@ -414,26 +391,24 @@ public Createable tokenReviews() * {@inheritDoc} */ @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass, Class doneClass) { + public > MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass) { return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()) .withCrdContext(crdContext) .withType(resourceType) .withListType(listClass) - .withPropagationPolicy(DEFAULT_PROPAGATION_POLICY) - .withDoneableType(doneClass)); + .withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); } /** * {@inheritDoc} */ @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { + public > MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass) { return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()) .withCrd(crd) .withType(resourceType) .withListType(listClass) - .withPropagationPolicy(DEFAULT_PROPAGATION_POLICY) - .withDoneableType(doneClass)); + .withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); } /** @@ -448,8 +423,8 @@ public RawCustomResourceOperationsImpl customResource(CustomResourceDefinitionCo * {@inheritDoc} */ @Override - public , D extends Doneable> MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return customResources(crd, resourceType, listClass); } /** @@ -597,7 +572,7 @@ public LeaderElectorBuilder leaderElector() { * {@inheritDoc} */ @Override - public MixedOperation> leases() { + public MixedOperation> leases() { return new LeaseOperationsImpl(httpClient, getConfiguration()); } @@ -613,7 +588,7 @@ public RunOperations run() { * {@inheritDoc} */ @Override - public NonNamespaceOperation> runtimeClasses() { + public NonNamespaceOperation> runtimeClasses() { return new RuntimeClassOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/ExtensionsAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/ExtensionsAPIGroupClient.java index 3d16bfc7dca..5fe1ee20dcb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/ExtensionsAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/ExtensionsAPIGroupClient.java @@ -17,23 +17,16 @@ import io.fabric8.kubernetes.api.model.extensions.DaemonSet; import io.fabric8.kubernetes.api.model.extensions.DaemonSetList; -import io.fabric8.kubernetes.api.model.extensions.DoneableDaemonSet; import io.fabric8.kubernetes.api.model.extensions.Deployment; import io.fabric8.kubernetes.api.model.extensions.DeploymentList; -import io.fabric8.kubernetes.api.model.extensions.DoneableDeployment; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetList; -import io.fabric8.kubernetes.api.model.extensions.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.batch.Job; import io.fabric8.kubernetes.api.model.batch.JobList; -import io.fabric8.kubernetes.api.model.batch.DoneableJob; import io.fabric8.kubernetes.api.model.extensions.Ingress; import io.fabric8.kubernetes.api.model.extensions.IngressList; -import io.fabric8.kubernetes.api.model.extensions.DoneableIngress; import io.fabric8.kubernetes.api.model.extensions.NetworkPolicy; import io.fabric8.kubernetes.api.model.extensions.NetworkPolicyList; -import io.fabric8.kubernetes.api.model.extensions.DoneableNetworkPolicy; -import io.fabric8.kubernetes.api.model.policy.DoneablePodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicyList; import io.fabric8.kubernetes.client.dsl.RollableScalableResource; @@ -62,36 +55,36 @@ public ExtensionsAPIGroupClient(OkHttpClient httpClient, final Config config) { @Override @Deprecated - public MixedOperation> daemonSets() { + public MixedOperation> daemonSets() { return new DaemonSetOperationsImpl(httpClient, getConfiguration()); } @Override @Deprecated - public MixedOperation> deployments() { + public MixedOperation> deployments() { return new DeploymentOperationsImpl(httpClient, getConfiguration()); } @Override @Deprecated - public MixedOperation> ingress() { + public MixedOperation> ingress() { return ingresses(); } @Override - public MixedOperation> ingresses() { + public MixedOperation> ingresses() { return new IngressOperationsImpl(httpClient, getConfiguration()); } @Override @Deprecated - public MixedOperation> jobs() { + public MixedOperation> jobs() { return new JobOperationsImpl(httpClient, getConfiguration()); } @Override @Deprecated - public MixedOperation> networkPolicies() { + public MixedOperation> networkPolicies() { return new NetworkPolicyOperationsImpl(httpClient, getConfiguration()); } @@ -100,13 +93,13 @@ public MixedOperation> podSecurityPolicies() { + public MixedOperation> podSecurityPolicies() { return new PodSecurityPolicyOperationsImpl(httpClient, getConfiguration()); } @Override @Deprecated - public MixedOperation> replicaSets() { + public MixedOperation> replicaSets() { return new ReplicaSetOperationsImpl(httpClient, getConfiguration()); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java index be46f7a9f79..6e0e8e57cf1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java @@ -19,71 +19,48 @@ import io.fabric8.kubernetes.api.model.APIService; import io.fabric8.kubernetes.api.model.APIServiceList; import io.fabric8.kubernetes.api.model.Binding; -import io.fabric8.kubernetes.api.model.Doneable; -import io.fabric8.kubernetes.api.model.DoneableAPIService; -import io.fabric8.kubernetes.api.model.DoneableBinding; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.ComponentStatus; import io.fabric8.kubernetes.api.model.ComponentStatusList; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; -import io.fabric8.kubernetes.api.model.DoneableEndpoints; import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.EventList; -import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.LimitRange; import io.fabric8.kubernetes.api.model.LimitRangeList; -import io.fabric8.kubernetes.api.model.DoneableLimitRange; import io.fabric8.kubernetes.api.model.Namespace; import io.fabric8.kubernetes.api.model.NamespaceList; -import io.fabric8.kubernetes.api.model.DoneableNamespace; import io.fabric8.kubernetes.api.model.Node; import io.fabric8.kubernetes.api.model.NodeList; -import io.fabric8.kubernetes.api.model.DoneableNode; import io.fabric8.kubernetes.api.model.PersistentVolume; import io.fabric8.kubernetes.api.model.PersistentVolumeList; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolume; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimList; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.ReplicationController; import io.fabric8.kubernetes.api.model.ReplicationControllerList; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; import io.fabric8.kubernetes.api.model.ResourceQuota; import io.fabric8.kubernetes.api.model.ResourceQuotaList; -import io.fabric8.kubernetes.api.model.DoneableResourceQuota; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.SecretList; -import io.fabric8.kubernetes.api.model.DoneableSecret; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.ServiceList; -import io.fabric8.kubernetes.api.model.DoneableService; import io.fabric8.kubernetes.api.model.ServiceAccount; import io.fabric8.kubernetes.api.model.ServiceAccountList; -import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequest; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequestList; -import io.fabric8.kubernetes.api.model.certificates.DoneableCertificateSigningRequest; -import io.fabric8.kubernetes.api.model.authentication.DoneableTokenReview; import io.fabric8.kubernetes.api.model.authentication.TokenReview; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; -import io.fabric8.kubernetes.api.model.node.v1beta1.DoneableRuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClassList; import io.fabric8.kubernetes.client.dsl.*; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext; import io.fabric8.kubernetes.client.dsl.internal.RawCustomResourceOperationsImpl; import io.fabric8.kubernetes.client.extended.leaderelection.LeaderElectorBuilder; @@ -105,7 +82,7 @@ public interface KubernetesClient extends Client { * * @return NonNamespaceOperation object for CustomResourceDefinition */ - NonNamespaceOperation> customResourceDefinitions(); + NonNamespaceOperation> customResourceDefinitions(); /** * API entrypoint for apiextensions resources. Currently support both @@ -120,7 +97,7 @@ public interface KubernetesClient extends Client { * * @return {@link NonNamespaceOperation} for CertificateSigningRequest class */ - NonNamespaceOperation> certificateSigningRequests(); + NonNamespaceOperation> certificateSigningRequests(); /** * Typed API for managing CustomResources. You would need to provide POJOs for @@ -137,14 +114,12 @@ public interface KubernetesClient extends Client { * @param crdContext CustomResourceDefinitionContext describes the core fields used to search for CustomResources * @param resourceType Class for CustomResource * @param listClass Class for list object for CustomResource - * @param doneClass Class for Doneable CustomResource object * @param T type represents CustomResource type. If it's Namespaced resource, it must implement * io.fabric8.kubernetes.api.model.Namespaced * @param L type represents CustomResourceList type - * @param D type represents DoneableCustomResource type * @return returns a MixedOperation object with which you can do basic CustomResource operations */ - , D extends Doneable> MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass, Class doneClass); + > MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass); /** * Typed API for managing CustomResources. You would need to provide POJOs for @@ -158,26 +133,24 @@ public interface KubernetesClient extends Client { * if it is a Namespaced scoped resource. *

* - * @deprecated use {@link #customResources(CustomResourceDefinitionContext, Class, Class, Class)}, which takes a {@link CustomResourceDefinitionContext} + * @deprecated use {@link #customResources(CustomResourceDefinitionContext, Class, Class)}, which takes a {@link CustomResourceDefinitionContext} * instead of a full {@link CustomResourceDefinition}. * * @param crd CustomResourceDefinition object on basic of which this CustomResource was created * @param resourceType Class for CustomResource * @param listClass Class for list object for CustomResource - * @param doneClass Class for Doneable CustomResource object * @param T type represents CustomResource type. If it's Namespaced resource, it must implement * io.fabric8.kubernetes.api.model.Namespaced * @param L type represents CustomResourceList type - * @param D type represents DoneableCustomResource type * @return returns a MixedOperation object with which you can do basic CustomResource operations */ @Deprecated - , D extends Doneable> MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass); + > MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass); /** * Old API for dealing with CustomResources. * - * @deprecated use {@link #customResources(CustomResourceDefinitionContext, Class, Class, Class)}, which takes a {@link CustomResourceDefinitionContext} + * @deprecated use {@link #customResources(CustomResourceDefinitionContext, Class, Class)}, which takes a {@link CustomResourceDefinitionContext} * instead of a full {@link CustomResourceDefinition}. * *

@@ -190,14 +163,12 @@ public interface KubernetesClient extends Client { * @param crd Custom Resource Definition * @param resourceType resource type Pojo * @param listClass list class Pojo - * @param doneClass Done class Pojo * @param template argument for resource. If it's Namespaced resource, it must implement * io.fabric8.kubernetes.api.model.Namespaced * @param template argument for list - * @param template argument for doneable resource * @return Kubernetes client object for manipulating custom resource. */ - , D extends Doneable> MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass); + > MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass); /** * Extensions API entrypoint for APIGroup extensions/v1beta1 @@ -305,7 +276,7 @@ public interface KubernetesClient extends Client { * * @return MixedOperation object with which you can do basic operations for ComponentStatus */ - MixedOperation> componentstatuses(); + MixedOperation> componentstatuses(); /** * Load a Kubernetes resource object from file InputStream @@ -313,7 +284,7 @@ public interface KubernetesClient extends Client { * @param is File input stream object containing json/yaml content * @return deserialized object */ - ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is); + ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is); /** * Load a Kubernetes list object @@ -321,7 +292,7 @@ public interface KubernetesClient extends Client { * @param s kubernetes list as string * @return deserialized KubernetesList object */ - ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s); + ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s); /** * KubernetesResourceList operations @@ -329,7 +300,7 @@ public interface KubernetesClient extends Client { * @param list KubernetesResourceList object containing kubernetes resource items * @return operations object for KubernetesResourceList */ - NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList list); + NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList list); /** * KubernetesResourceList operations @@ -337,7 +308,7 @@ public interface KubernetesClient extends Client { * @param items array of HasMetadata values * @return operations object for Kubernetes list */ - NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items); + NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items); /** * KubernetesResourceList operations @@ -345,7 +316,7 @@ public interface KubernetesClient extends Client { * @param items a collection containing HasMetadata values * @return operations object for Kubernetes list */ - NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items); + NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items); /** * KubernetesResource operations. You can pass any Kubernetes resource as a HasMetadata object and do @@ -355,7 +326,7 @@ public interface KubernetesClient extends Client { * @param type of Kubernetes resource * @return operations object for Kubernetes resource */ - NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(T is); + NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(T is); /** * KubernetesResource operations. You can pass any Kubernetes resource as string object and do @@ -364,21 +335,21 @@ public interface KubernetesClient extends Client { * @param s Kubernetes resource object as string * @return operations object for Kubernetes resource */ - NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s); + NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s); /** * Operations for Binding resource in APIgroup core/v1 * * @return MixedOperation object for doing operations for Binding */ - MixedOperation, DoneableBinding, Resource> bindings(); + MixedOperation, Resource> bindings(); /** * API entrypoint for Endpoints with APIGroup core/v1 * * @return MixedOperation object for doing operations for Endpoints */ - MixedOperation> endpoints(); + MixedOperation> endpoints(); /** * API entrypoint for getting events in Kubernetes. Events (core/v1) @@ -386,84 +357,84 @@ public interface KubernetesClient extends Client { * @deprecated Use KubernetesClient#v1#events instead. * @return MixedOperation object for doing operations for Events */ - MixedOperation> events(); + MixedOperation> events(); /** * API entrypoint for namespace related operations in Kubernetes. Namespace (core/v1) * * @return NonNamespaceOperation object for Namespace related operations */ - NonNamespaceOperation< Namespace, NamespaceList, DoneableNamespace, Resource> namespaces(); + NonNamespaceOperation< Namespace, NamespaceList, Resource> namespaces(); /** * API entrypoint for node related operations in Kubernetes. Node (core/v1) * * @return NonNamespaceOperation object for Node related operations */ - NonNamespaceOperation> nodes(); + NonNamespaceOperation> nodes(); /** * API entrypoint for PersistentVolume related operations. PersistentVolume (core/v1) * * @return NonNamespaceOperation object for PersistentVolume related operations. */ - NonNamespaceOperation> persistentVolumes(); + NonNamespaceOperation> persistentVolumes(); /** * API entrypoint for PersistentVolumeClaim related operations. PersistentVolumeClaim (core/v1) * * @return MixedOperation object for PersistentVolumeClaim related operations. */ - MixedOperation> persistentVolumeClaims(); + MixedOperation> persistentVolumeClaims(); /** * API entrypoint for Pod related operations. Pod (core/v1) * * @return MixedOperation object for Pod related operations */ - MixedOperation> pods(); + MixedOperation> pods(); /** * API entrypoint for ReplicationController related operations. ReplicationController (core/v1) * * @return MixedOperation object for ReplicationController related operations. */ - MixedOperation> replicationControllers(); + MixedOperation> replicationControllers(); /** * API entrypoint for ResourceQuota related operations. ResourceQuota (core/v1) * * @return MixedOperation object for ResourceQuota related operations. */ - MixedOperation> resourceQuotas(); + MixedOperation> resourceQuotas(); /** * API entrypoint for Secret related operations. Secret (core/v1) * * @return MixedOperation object for Secret related operations. */ - MixedOperation> secrets(); + MixedOperation> secrets(); /** * API entrypoint for Service related operations. Service (core/v1) * * @return MixedOperation object for Service related operations. */ - MixedOperation> services(); + MixedOperation> services(); /** * API entrypoint for ServiceAccount related operations. ServiceAccount (core/v1) * * @return MixedOperation object for ServiceAccount related operations. */ - MixedOperation> serviceAccounts(); + MixedOperation> serviceAccounts(); /** * API entrypoint for APIService related operations. APIService (apiregistration.k8s.io/v1) * * @return MixedOperation object for APIService related operations */ - MixedOperation> apiServices(); + MixedOperation> apiServices(); /** * List related operations. @@ -477,14 +448,14 @@ public interface KubernetesClient extends Client { * * @return MixedOperation object for ConfigMap related operations. */ - MixedOperation> configMaps(); + MixedOperation> configMaps(); /** * API entrypoint for LimitRange related operations. LimitRange (core/v1) * * @return MixedOperation object for LimitRange related operations. */ - MixedOperation> limitRanges(); + MixedOperation> limitRanges(); /** * Authorization operations. (authorization.k8s.io/v1 and authorization.k8s.io/v1beta1) @@ -498,7 +469,7 @@ public interface KubernetesClient extends Client { * * @return CreateOnlyResourceOperations instance for creating TokenReview object */ - Createable tokenReviews(); + Createable tokenReviews(); /** * Get an instance of Kubernetes Client informer factory. It allows you to construct and @@ -532,7 +503,7 @@ public interface KubernetesClient extends Client { * * @return MixedOperation object for Lease related operations. */ - MixedOperation> leases(); + MixedOperation> leases(); /** * API entrypoint for Core Kubernetes Resources (core/v1). Right now other core @@ -555,5 +526,5 @@ public interface KubernetesClient extends Client { * * @return {@link NonNamespaceOperation} for RuntimeClass */ - NonNamespaceOperation> runtimeClasses(); + NonNamespaceOperation> runtimeClasses(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/NetworkAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/NetworkAPIGroupClient.java index 3c9b19c97e2..602b9634b97 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/NetworkAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/NetworkAPIGroupClient.java @@ -15,10 +15,8 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableNetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyList; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngress; import io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -49,17 +47,17 @@ public V1beta1NetworkAPIGroupDSL v1beta1() { } @Override - public MixedOperation> networkPolicies() { + public MixedOperation> networkPolicies() { return new NetworkPolicyOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> ingress() { + public MixedOperation> ingress() { return ingresses(); } @Override - public MixedOperation> ingresses() { + public MixedOperation> ingresses() { return new IngressOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/PolicyAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/PolicyAPIGroupClient.java index 205cb419a81..9bccb4b2c0e 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/PolicyAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/PolicyAPIGroupClient.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.policy.DoneablePodDisruptionBudget; -import io.fabric8.kubernetes.api.model.policy.DoneablePodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodDisruptionBudget; import io.fabric8.kubernetes.api.model.policy.PodDisruptionBudgetList; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicy; @@ -35,12 +33,12 @@ public PolicyAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> podSecurityPolicies() { + public MixedOperation> podSecurityPolicies() { return new PodSecurityPolicyOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> podDisruptionBudget() { + public MixedOperation> podDisruptionBudget() { return new PodDisruptionBudgetOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/RbacAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/RbacAPIGroupClient.java index a3260e171dd..54aa233c8bf 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/RbacAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/RbacAPIGroupClient.java @@ -23,10 +23,6 @@ import io.fabric8.kubernetes.client.dsl.internal.rbac.v1.ClusterRoleOperationsImpl; import io.fabric8.kubernetes.client.dsl.internal.rbac.v1.RoleBindingOperationsImpl; import io.fabric8.kubernetes.client.dsl.internal.rbac.v1.RoleOperationsImpl; -import io.fabric8.kubernetes.api.model.rbac.DoneableRole; -import io.fabric8.kubernetes.api.model.rbac.DoneableRoleBinding; -import io.fabric8.kubernetes.api.model.rbac.DoneableClusterRole; -import io.fabric8.kubernetes.api.model.rbac.DoneableClusterRoleBinding; import okhttp3.OkHttpClient; public class RbacAPIGroupClient extends BaseClient implements RbacAPIGroupDSL { @@ -40,22 +36,22 @@ public RbacAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> roles() { + public MixedOperation> roles() { return new RoleOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> roleBindings() { + public MixedOperation> roleBindings() { return new RoleBindingOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> clusterRoles() { + public MixedOperation> clusterRoles() { return new ClusterRoleOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> clusterRoleBindings() { + public MixedOperation> clusterRoleBindings() { return new ClusterRoleBindingOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SchedulingAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SchedulingAPIGroupClient.java index 7a7d2f77412..1952346b277 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SchedulingAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SchedulingAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.scheduling.DoneablePriorityClass; import io.fabric8.kubernetes.api.model.scheduling.PriorityClass; import io.fabric8.kubernetes.api.model.scheduling.PriorityClassList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -30,7 +29,7 @@ public SchedulingAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> priorityClass() { + public MixedOperation> priorityClass() { return new PriorityClassOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SettingsAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SettingsAPIGroupClient.java index f74cc183d5b..ed7047ef581 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SettingsAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/SettingsAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.settings.DoneablePodPreset; import io.fabric8.kubernetes.api.model.settings.PodPreset; import io.fabric8.kubernetes.api.model.settings.PodPresetList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -29,7 +28,7 @@ public SettingsAPIGroupClient(OkHttpClient httpClient, final Config config) { super(httpClient, config); } @Override - public MixedOperation> podPresets() { + public MixedOperation> podPresets() { return new PodPresetOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/StorageAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/StorageAPIGroupClient.java index c77aad48c05..b868f2c0375 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/StorageAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/StorageAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.storage.DoneableStorageClass; import io.fabric8.kubernetes.api.model.storage.StorageClass; import io.fabric8.kubernetes.api.model.storage.StorageClassList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -35,7 +34,7 @@ public StorageAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> storageClasses() { + public MixedOperation> storageClasses() { return new StorageClassOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java index ec838660e9c..1241e9784ba 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java @@ -15,12 +15,10 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.DoneablePodTemplate; import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.api.model.PodTemplate; import io.fabric8.kubernetes.api.model.PodTemplateList; -import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.V1APIGroupDSL; @@ -38,12 +36,12 @@ public V1APIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> podTemplates() { + public MixedOperation> podTemplates() { return new PodTemplateOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> events() { + public MixedOperation> events() { return new EventOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java index dbe4b2db1c9..d041b0011b9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableMutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableValidatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList; import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; @@ -37,12 +35,12 @@ public V1AdmissionRegistrationAPIGroupClient(OkHttpClient httpClient, final Conf } @Override - public MixedOperation> validatingWebhookConfigurations() { + public MixedOperation> validatingWebhookConfigurations() { return new ValidatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> mutatingWebhookConfigurations() { + public MixedOperation> mutatingWebhookConfigurations() { return new MutatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java index 54ebdf1424c..395848b2033 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableMutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableValidatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList; import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; @@ -25,6 +23,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; public interface V1AdmissionRegistrationAPIGroupDSL extends Client { - MixedOperation> validatingWebhookConfigurations(); - MixedOperation> mutatingWebhookConfigurations(); + MixedOperation> validatingWebhookConfigurations(); + MixedOperation> mutatingWebhookConfigurations(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionAPIGroupDSL.java index c2e4033cd25..fc5c5db6f4f 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionAPIGroupDSL.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; public interface V1ApiextensionAPIGroupDSL extends Client { - MixedOperation> customResourceDefinitions(); + MixedOperation> customResourceDefinitions(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionsAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionsAPIGroupClient.java index ec917750448..4041af2a32c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionsAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1ApiextensionsAPIGroupClient.java @@ -17,7 +17,6 @@ import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.internal.apiextensions.v1.CustomResourceDefinitionOperationsImpl; @@ -32,7 +31,7 @@ public V1ApiextensionsAPIGroupClient(OkHttpClient httpClient, final Config confi super(httpClient, config); } - public MixedOperation> customResourceDefinitions() { + public MixedOperation> customResourceDefinitions() { return new CustomResourceDefinitionOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupClient.java index d509f5c60ee..f7aeacac549 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupClient.java @@ -15,10 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableLocalSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectRulesReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.LocalSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectRulesReview; @@ -42,22 +38,22 @@ public V1AuthorizationAPIGroupClient(OkHttpClient httpClient, final Config confi } @Override - public Createable selfSubjectAccessReview() { + public Createable selfSubjectAccessReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectAccessReview.class.getSimpleName()), SelfSubjectAccessReview.class); } @Override - public Createable subjectAccessReview() { + public Createable subjectAccessReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SubjectAccessReview.class.getSimpleName()), SubjectAccessReview.class); } @Override - public LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview() { + public LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview() { return new LocalCreateOnlyResourceReviewOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.LocalSubjectAccessReview.class.getSimpleName()), LocalSubjectAccessReview.class); } @Override - public Createable selfSubjectRulesReview() { + public Createable selfSubjectRulesReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectRulesReview.class.getSimpleName()), SelfSubjectRulesReview.class); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupDSL.java index 6d98b3bdf38..2146dad8ab8 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AuthorizationAPIGroupDSL.java @@ -15,10 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableLocalSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectRulesReview; -import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.LocalSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectRulesReview; @@ -27,8 +23,8 @@ import io.fabric8.kubernetes.client.dsl.internal.LocalCreateOnlyResourceReviewOperationsImpl; public interface V1AuthorizationAPIGroupDSL extends Client{ - Createable selfSubjectAccessReview(); - Createable subjectAccessReview(); - LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview(); - Createable selfSubjectRulesReview(); + Createable selfSubjectAccessReview(); + Createable subjectAccessReview(); + LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview(); + Createable selfSubjectRulesReview(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupClient.java index 0944e17b38e..8030cd6bff7 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v1.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v1.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v1.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -33,7 +32,7 @@ public V1AutoscalingAPIGroupClient(OkHttpClient httpClient, final Config config) super(httpClient, config); } - public MixedOperation> horizontalPodAutoscalers() { + public MixedOperation> horizontalPodAutoscalers() { return new HorizontalPodAutoscalerOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupDSL.java index 00f5fad7ab9..f142b9ca686 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AutoscalingAPIGroupDSL.java @@ -15,12 +15,11 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v1.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v1.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v1.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; public interface V1AutoscalingAPIGroupDSL extends Client { - MixedOperation> horizontalPodAutoscalers(); + MixedOperation> horizontalPodAutoscalers(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupClient.java index 373019adf12..6fb824886d9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupClient.java @@ -15,9 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngress; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngressClass; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableNetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1.IngressClass; import io.fabric8.kubernetes.api.model.networking.v1.IngressClassList; @@ -41,17 +38,17 @@ public V1NetworkAPIGroupClient(OkHttpClient httpClient, final Config config) { } @Override - public MixedOperation> networkPolicies() { + public MixedOperation> networkPolicies() { return new NetworkPolicyOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> ingresses() { + public MixedOperation> ingresses() { return new IngressOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> ingressClasses() { + public MixedOperation> ingressClasses() { return new IngressClassOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupDSL.java index 2ccb96237f1..c32ffc1c3d9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1NetworkAPIGroupDSL.java @@ -15,9 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngress; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngressClass; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableNetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1.IngressClass; import io.fabric8.kubernetes.api.model.networking.v1.IngressClassList; @@ -29,7 +26,7 @@ import io.fabric8.kubernetes.client.dsl.Resource; public interface V1NetworkAPIGroupDSL extends Client { - MixedOperation> networkPolicies(); - MixedOperation> ingresses(); - NonNamespaceOperation> ingressClasses(); + MixedOperation> networkPolicies(); + MixedOperation> ingresses(); + NonNamespaceOperation> ingressClasses(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java index b669710eecc..d88a8ff0c26 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableMutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableValidatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration; @@ -37,12 +35,12 @@ public V1beta1AdmissionRegistrationAPIGroupClient(OkHttpClient httpClient, final } @Override - public MixedOperation> validatingWebhookConfigurations() { + public MixedOperation> validatingWebhookConfigurations() { return new ValidatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> mutatingWebhookConfigurations() { + public MixedOperation> mutatingWebhookConfigurations() { return new MutatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java index 9d6d94d1c75..54b42ceaf0b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableMutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableValidatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList; import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration; @@ -25,6 +23,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; public interface V1beta1AdmissionRegistrationAPIGroupDSL extends Client { - MixedOperation> validatingWebhookConfigurations(); - MixedOperation> mutatingWebhookConfigurations(); + MixedOperation> validatingWebhookConfigurations(); + MixedOperation> mutatingWebhookConfigurations(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionAPIGroupDSL.java index 2f86d0e6518..17e71206685 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionAPIGroupDSL.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; public interface V1beta1ApiextensionAPIGroupDSL extends Client { - MixedOperation> customResourceDefinitions(); + MixedOperation> customResourceDefinitions(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionsAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionsAPIGroupClient.java index ffdc044f285..4152ff5ed47 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionsAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1ApiextensionsAPIGroupClient.java @@ -17,7 +17,6 @@ import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.internal.apiextensions.v1beta1.CustomResourceDefinitionOperationsImpl; @@ -32,7 +31,7 @@ public V1beta1ApiextensionsAPIGroupClient(OkHttpClient httpClient, final Config super(httpClient, config); } - public MixedOperation> customResourceDefinitions() { + public MixedOperation> customResourceDefinitions() { return new CustomResourceDefinitionOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupClient.java index 5ffbda04405..e190f995317 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupClient.java @@ -15,10 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableLocalSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectRulesReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.LocalSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectRulesReview; @@ -43,22 +39,22 @@ public V1beta1AuthorizationAPIGroupClient(OkHttpClient httpClient, final Config } @Override - public Createable selfSubjectAccessReview() { + public Createable selfSubjectAccessReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SelfSubjectAccessReview.class.getSimpleName()), SelfSubjectAccessReview.class); } @Override - public Createable subjectAccessReview() { + public Createable subjectAccessReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SubjectAccessReview.class.getSimpleName()), SubjectAccessReview.class); } @Override - public LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview() { + public LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview() { return new LocalCreateOnlyResourceReviewOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(LocalSubjectAccessReview.class.getSimpleName()), LocalSubjectAccessReview.class); } @Override - public Createable selfSubjectRulesReview() { + public Createable selfSubjectRulesReview() { return new CreateOnlyResourceOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SelfSubjectRulesReview.class.getSimpleName()), SelfSubjectRulesReview.class); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupDSL.java index a74690b1e80..b8cedfaf38f 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AuthorizationAPIGroupDSL.java @@ -15,10 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableLocalSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectAccessReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectRulesReview; -import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.LocalSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectAccessReview; import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectRulesReview; @@ -27,8 +23,8 @@ import io.fabric8.kubernetes.client.dsl.internal.LocalCreateOnlyResourceReviewOperationsImpl; public interface V1beta1AuthorizationAPIGroupDSL extends Client { - Createable selfSubjectAccessReview(); - Createable subjectAccessReview(); - LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview(); - Createable selfSubjectRulesReview(); + Createable selfSubjectAccessReview(); + Createable subjectAccessReview(); + LocalCreateOnlyResourceReviewOperationsImpl localSubjectAccessReview(); + Createable selfSubjectRulesReview(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupClient.java index b4350aed87b..1518d435eea 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupClient.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngress; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngressClass; import io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressClass; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressClassList; @@ -37,12 +35,12 @@ public V1beta1NetworkAPIGroupClient(OkHttpClient httpClient, final Config config } @Override - public MixedOperation> ingresses() { + public MixedOperation> ingresses() { return new IngressOperationsImpl(httpClient, getConfiguration()); } @Override - public MixedOperation> ingressClasses() { + public MixedOperation> ingressClasses() { return new IngressClassOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupDSL.java index e12dfca1382..26c12c7ca95 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1NetworkAPIGroupDSL.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngress; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngressClass; import io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressClass; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressClassList; @@ -26,6 +24,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; public interface V1beta1NetworkAPIGroupDSL extends Client { - MixedOperation> ingresses(); - NonNamespaceOperation> ingressClasses(); + MixedOperation> ingresses(); + NonNamespaceOperation> ingressClasses(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupClient.java index 133487bd6cc..8fa6fb2c9b1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -33,7 +32,7 @@ public V2beta1AutoscalingAPIGroupClient(OkHttpClient httpClient, final Config co super(httpClient, config); } - public MixedOperation> horizontalPodAutoscalers() { + public MixedOperation> horizontalPodAutoscalers() { return new HorizontalPodAutoscalerOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupDSL.java index a50e1cbdf02..5b2a769d047 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta1AutoscalingAPIGroupDSL.java @@ -15,12 +15,11 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta1.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; public interface V2beta1AutoscalingAPIGroupDSL extends Client { - MixedOperation> horizontalPodAutoscalers(); + MixedOperation> horizontalPodAutoscalers(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupClient.java index 4aa1aa38cd0..10212055671 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupClient.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -33,7 +32,7 @@ public V2beta2AutoscalingAPIGroupClient(OkHttpClient httpClient, final Config co super(httpClient, config); } - public MixedOperation> horizontalPodAutoscalers() { + public MixedOperation> horizontalPodAutoscalers() { return new HorizontalPodAutoscalerOperationsImpl(httpClient, getConfiguration()); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupDSL.java index 84e5535afa9..daee0dcf489 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V2beta2AutoscalingAPIGroupDSL.java @@ -15,12 +15,11 @@ */ package io.fabric8.kubernetes.client; -import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.DoneableHorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.HorizontalPodAutoscalerList; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; public interface V2beta2AutoscalingAPIGroupDSL extends Client { - MixedOperation> horizontalPodAutoscalers(); + MixedOperation> horizontalPodAutoscalers(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/AppsAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/AppsAPIGroupDSL.java index 8e348dd1864..0f3c99b116f 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/AppsAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/AppsAPIGroupDSL.java @@ -18,26 +18,22 @@ import io.fabric8.kubernetes.api.model.apps.DaemonSet; import io.fabric8.kubernetes.api.model.apps.DaemonSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableDaemonSet; import io.fabric8.kubernetes.api.model.apps.Deployment; import io.fabric8.kubernetes.api.model.apps.DeploymentList; -import io.fabric8.kubernetes.api.model.apps.DoneableDeployment; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.apps.StatefulSet; import io.fabric8.kubernetes.api.model.apps.StatefulSetList; -import io.fabric8.kubernetes.api.model.apps.DoneableStatefulSet; import io.fabric8.kubernetes.client.Client; public interface AppsAPIGroupDSL extends Client { - MixedOperation> daemonSets(); + MixedOperation> daemonSets(); - MixedOperation> deployments(); + MixedOperation> deployments(); - MixedOperation> replicaSets(); + MixedOperation> replicaSets(); - MixedOperation> statefulSets(); + MixedOperation> statefulSets(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BatchAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BatchAPIGroupDSL.java index 43488c87aa3..ff6996dfdfd 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BatchAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BatchAPIGroupDSL.java @@ -16,16 +16,14 @@ package io.fabric8.kubernetes.client.dsl; import io.fabric8.kubernetes.api.model.batch.CronJob; -import io.fabric8.kubernetes.api.model.batch.DoneableJob; import io.fabric8.kubernetes.api.model.batch.Job; import io.fabric8.kubernetes.api.model.batch.JobList; import io.fabric8.kubernetes.api.model.batch.CronJobList; -import io.fabric8.kubernetes.api.model.batch.DoneableCronJob; import io.fabric8.kubernetes.client.Client; public interface BatchAPIGroupDSL extends Client{ - MixedOperation> jobs(); + MixedOperation> jobs(); - MixedOperation> cronjobs(); + MixedOperation> cronjobs(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BytesLimitTerminateTimeTailPrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BytesLimitTerminateTimeTailPrettyLoggable.java index 744262785e5..bbd2ddc88e0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BytesLimitTerminateTimeTailPrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/BytesLimitTerminateTimeTailPrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface BytesLimitTerminateTimeTailPrettyLoggable extends BytesLimitable>, TerminateTimeTailPrettyLoggable { +public interface BytesLimitTerminateTimeTailPrettyLoggable extends BytesLimitable>, TerminateTimeTailPrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingDeletable.java index 2b9927cf2f9..e670a6559cb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingDeletable.java @@ -18,5 +18,5 @@ /** * Created by iocanel on 9/15/16. */ -public interface CascadingDeletable extends Deletable, Cascading> { +public interface CascadingDeletable extends Deletable, Cascading { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingEditReplacePatchDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingEditReplacePatchDeletable.java index f05f8b22129..a386423c503 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingEditReplacePatchDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CascadingEditReplacePatchDeletable.java @@ -18,9 +18,9 @@ import io.fabric8.kubernetes.client.PropagationPolicyConfigurable; -public interface CascadingEditReplacePatchDeletable extends - EditReplacePatchDeletable, - Cascading>, - PropagationPolicyConfigurable>, - Lockable> { +public interface CascadingEditReplacePatchDeletable extends + EditReplacePatchDeletable, + Cascading>, + PropagationPolicyConfigurable>, + Lockable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ContainerResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ContainerResource.java index 7befac693ab..36c05e57ca4 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ContainerResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ContainerResource.java @@ -16,8 +16,8 @@ package io.fabric8.kubernetes.client.dsl; -public interface ContainerResource +public interface ContainerResource extends TtyExecInputOutputErrorable, FileSelector>, - TimestampBytesLimitTerminateTimeTailPrettyLoggable { + TimestampBytesLimitTerminateTimeTailPrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateFromServerGettable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateFromServerGettable.java index 2815b791d51..ca361249195 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateFromServerGettable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateFromServerGettable.java @@ -18,5 +18,5 @@ import io.fabric8.kubernetes.client.FromServerGettable; -public interface CreateFromServerGettable extends Createable, FromServerGettable { +public interface CreateFromServerGettable extends Createable, FromServerGettable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateOrReplaceable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateOrReplaceable.java index 9cc5924c1bf..819f229e5a8 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateOrReplaceable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/CreateOrReplaceable.java @@ -15,7 +15,7 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface CreateOrReplaceable { +public interface CreateOrReplaceable { /** * Creates a provided resource in a Kubernetes Cluster. If creation @@ -24,13 +24,6 @@ public interface CreateOrReplaceable { * @param item item to create or replace * @return created item returned in kubernetes api response */ - T createOrReplace(I... item); + T createOrReplace(T... item); - /** - * Create or replace a resource in a Kubernetes Cluster dynamically with - * the help of Kubernetes Model Builders. - * - * @return created item returned in kubernetes api response - */ - D createOrReplaceWithNew(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Createable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Createable.java index 08dc8d17f66..8fbeb79bff0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Createable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Createable.java @@ -15,11 +15,10 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface Createable { +public interface Createable { - T create(I... item); + T create(T... item); - T create(I item); + T create(T item); - D createNew(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Deletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Deletable.java index 2b7f4870c76..733fa30b6b1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Deletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Deletable.java @@ -15,13 +15,13 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface Deletable { +public interface Deletable { /** * Deletes resource and all managed resources, returns null or false if not found. * @return value indicating object was deleted or not * @throws io.fabric8.kubernetes.client.KubernetesClientException if an error occurs. */ - B delete(); + Boolean delete(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchDeletable.java index ad4490eb11d..010708f0391 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchDeletable.java @@ -18,8 +18,8 @@ import io.fabric8.kubernetes.client.GracePeriodConfigurable; -public interface EditReplacePatchDeletable extends EditReplacePatchable, Deletable, - GracePeriodConfigurable> +public interface EditReplacePatchDeletable extends EditReplacePatchable, Deletable, + GracePeriodConfigurable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchable.java index f2cf406492d..1ae40077bd7 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/EditReplacePatchable.java @@ -15,5 +15,5 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface EditReplacePatchable extends Editable, Replaceable, Patchable, StatusUpdatable { +public interface EditReplacePatchable extends Editable, Replaceable, Patchable, StatusUpdatable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Editable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Editable.java index 60a291a4b4d..55338068ed8 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Editable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Editable.java @@ -15,8 +15,13 @@ */ package io.fabric8.kubernetes.client.dsl; +import java.util.function.Consumer; +import java.util.function.Function; + public interface Editable { - T edit(); + T edit(Function function); + + T accept(Consumer function); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ExtensionsAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ExtensionsAPIGroupDSL.java index 1e784868993..7bf3953cc6b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ExtensionsAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ExtensionsAPIGroupDSL.java @@ -18,23 +18,16 @@ import io.fabric8.kubernetes.api.model.extensions.DaemonSet; import io.fabric8.kubernetes.api.model.extensions.DaemonSetList; -import io.fabric8.kubernetes.api.model.extensions.DoneableDaemonSet; import io.fabric8.kubernetes.api.model.extensions.Deployment; import io.fabric8.kubernetes.api.model.extensions.DeploymentList; -import io.fabric8.kubernetes.api.model.extensions.DoneableDeployment; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetList; -import io.fabric8.kubernetes.api.model.extensions.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.batch.Job; import io.fabric8.kubernetes.api.model.batch.JobList; -import io.fabric8.kubernetes.api.model.batch.DoneableJob; import io.fabric8.kubernetes.api.model.extensions.Ingress; import io.fabric8.kubernetes.api.model.extensions.IngressList; -import io.fabric8.kubernetes.api.model.extensions.DoneableIngress; import io.fabric8.kubernetes.api.model.extensions.NetworkPolicy; import io.fabric8.kubernetes.api.model.extensions.NetworkPolicyList; -import io.fabric8.kubernetes.api.model.extensions.DoneableNetworkPolicy; -import io.fabric8.kubernetes.api.model.policy.DoneablePodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicyList; import io.fabric8.kubernetes.client.Client; @@ -42,29 +35,29 @@ public interface ExtensionsAPIGroupDSL extends Client { @Deprecated - MixedOperation> daemonSets(); + MixedOperation> daemonSets(); @Deprecated - MixedOperation> deployments(); + MixedOperation> deployments(); @Deprecated - MixedOperation> ingress(); + MixedOperation> ingress(); - MixedOperation> ingresses(); + MixedOperation> ingresses(); @Deprecated - MixedOperation> jobs(); + MixedOperation> jobs(); @Deprecated - MixedOperation> networkPolicies(); + MixedOperation> networkPolicies(); @Deprecated - MixedOperation> replicaSets(); + MixedOperation> replicaSets(); @Deprecated /** * @deprecated Replaced by {@link PolicyAPIGroupDSL#podSecurityPolicies()} */ - MixedOperation> podSecurityPolicies(); + MixedOperation> podSecurityPolicies(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListDeletable.java index 11d96e6ba80..418d4c44148 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListDeletable.java @@ -15,6 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface FilterWatchListDeletable extends Filterable>, WatchListDeletable { +public interface FilterWatchListDeletable extends Filterable>, WatchListDeletable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListMultiDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListMultiDeletable.java index a346e23b2b7..4d29967d8cb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListMultiDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/FilterWatchListMultiDeletable.java @@ -15,6 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface FilterWatchListMultiDeletable extends FilterWatchListDeletable, MultiDeleteable { +public interface FilterWatchListMultiDeletable extends FilterWatchListDeletable, MultiDeleteable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ImageEditReplacePatchable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ImageEditReplacePatchable.java index a47b0ad1fb4..52a4a7a2bed 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ImageEditReplacePatchable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ImageEditReplacePatchable.java @@ -17,7 +17,7 @@ import java.util.Map; -public interface ImageEditReplacePatchable extends EditReplacePatchable { +public interface ImageEditReplacePatchable extends EditReplacePatchable { /** * Update existing container image(s) of resources diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Doneable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/InOutCreateable.java similarity index 82% rename from kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Doneable.java rename to kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/InOutCreateable.java index 83931961b0e..6b95c773eeb 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Doneable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/InOutCreateable.java @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.fabric8.kubernetes.api.model; +package io.fabric8.kubernetes.client.dsl; -public interface Doneable { +public interface InOutCreateable { + + O create(I... item); + + O create(I item); - T done(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListNonNamespaceOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListNonNamespaceOperation.java index 5e8a6ad907b..0e23351d9cb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListNonNamespaceOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListNonNamespaceOperation.java @@ -15,13 +15,10 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.DoneableKubernetesList; import io.fabric8.kubernetes.api.model.KubernetesList; -import java.io.InputStream; - public interface KubernetesListNonNamespaceOperation extends - Createable, - MultiDeleteable, - Loadable> { + Createable, + MultiDeleteable, + Loadable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListOperation.java index 4e6ddf68a01..fb4d0735f35 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/KubernetesListOperation.java @@ -15,11 +15,10 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.DoneableKubernetesList; import io.fabric8.kubernetes.api.model.KubernetesList; public interface KubernetesListOperation extends Namespaceable, - MultiDeleteable, - Loadable> { + MultiDeleteable, + Loadable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ListVisitFromServerGetDeleteRecreateWaitApplicable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ListVisitFromServerGetDeleteRecreateWaitApplicable.java index 4264fa0101e..6be63078d01 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ListVisitFromServerGetDeleteRecreateWaitApplicable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ListVisitFromServerGetDeleteRecreateWaitApplicable.java @@ -23,11 +23,11 @@ import io.fabric8.kubernetes.client.GracePeriodConfigurable; import io.fabric8.kubernetes.client.PropagationPolicyConfigurable; -public interface ListVisitFromServerGetDeleteRecreateWaitApplicable extends Visitable>, +public interface ListVisitFromServerGetDeleteRecreateWaitApplicable extends Visitable>, FromServerGettable>, RecreateApplicable, T>, - CascadingDeletable, + CascadingDeletable, Waitable, T>, - GracePeriodConfigurable>, - PropagationPolicyConfigurable> { + GracePeriodConfigurable, + PropagationPolicyConfigurable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Loggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Loggable.java index a33b65360f4..a6a6a2a4f74 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Loggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Loggable.java @@ -22,17 +22,16 @@ /** * Loggable interface for all resources which produce logs * - * @param logs as plain string * @param returns a LogWatch for watching logs */ -public interface Loggable { +public interface Loggable { /** * Get logs of a resource * * @return logs as string */ - S getLog(); + String getLog(); /** * Get logs with pretty enabled @@ -40,7 +39,7 @@ public interface Loggable { * @param isPretty whether we need logs with pretty output or not * @return logs as string */ - S getLog(Boolean isPretty); + String getLog(Boolean isPretty); /** * Get a Reader for reading logs @@ -71,6 +70,6 @@ public interface Loggable { * @param logWaitTimeout timeout in milliseconds * @return {@link Loggable} for fetching logs */ - Loggable withLogWaitTimeout(Integer logWaitTimeout); + Loggable withLogWaitTimeout(Integer logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MixedOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MixedOperation.java index 053d56d288d..6a000c05dcc 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MixedOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MixedOperation.java @@ -22,10 +22,9 @@ * * @param The Kubernetes resource type. * @param The list variant of the Kubernetes resource type. - * @param The doneable variant of the Kubernetes resource type. * @param The resource operations. */ -public interface MixedOperation> - extends Operation, - NonNamespaceOperation { +public interface MixedOperation> + extends Operation, + NonNamespaceOperation { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MultiDeleteable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MultiDeleteable.java index c82af159271..5c920eff2c3 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MultiDeleteable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/MultiDeleteable.java @@ -18,9 +18,9 @@ import java.util.List; -public interface MultiDeleteable { +public interface MultiDeleteable { - B delete(I... items); + Boolean delete(T... items); - B delete(List items); + Boolean delete(List items); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java index 8a00ef6e78f..120a91cb9bd 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java @@ -16,9 +16,9 @@ package io.fabric8.kubernetes.client.dsl; -public interface NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable extends - ListVisitFromServerGetDeleteRecreateWaitApplicable, - Namespaceable> +public interface NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable extends + ListVisitFromServerGetDeleteRecreateWaitApplicable, + Namespaceable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable.java index 2766c268ae3..a0701795db0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable.java @@ -16,9 +16,9 @@ package io.fabric8.kubernetes.client.dsl; -public interface NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable extends - VisitFromServerGetWatchDeleteRecreateWaitApplicable, - Namespaceable> +public interface NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable extends + VisitFromServerGetWatchDeleteRecreateWaitApplicable, + Namespaceable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NetworkAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NetworkAPIGroupDSL.java index a2889122389..98f90aad461 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NetworkAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NetworkAPIGroupDSL.java @@ -15,10 +15,8 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableNetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyList; -import io.fabric8.kubernetes.api.model.networking.v1beta1.DoneableIngress; import io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressList; import io.fabric8.kubernetes.client.Client; @@ -29,8 +27,8 @@ public interface NetworkAPIGroupDSL extends Client { V1NetworkAPIGroupDSL v1(); V1beta1NetworkAPIGroupDSL v1beta1(); - MixedOperation> networkPolicies(); - MixedOperation> ingress(); + MixedOperation> networkPolicies(); + MixedOperation> ingress(); - MixedOperation> ingresses(); + MixedOperation> ingresses(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NonNamespaceOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NonNamespaceOperation.java index bcaef1eeb04..56c18417de2 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NonNamespaceOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/NonNamespaceOperation.java @@ -15,21 +15,18 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.client.Watch; - /** * The entry point to client operations that are either "cross namespace resources", or are available in the invocation chain * after a namespace has already been specified. * @param The Kubernetes resource type. * @param The list variant of the Kubernetes resource type. - * @param The doneable variant of the Kubernetes resource type. * @param The resource operations. */ -public interface NonNamespaceOperation extends +public interface NonNamespaceOperation extends Nameable, - FilterWatchListMultiDeletable, - Createable, - CreateOrReplaceable, + FilterWatchListMultiDeletable, + Createable, + CreateOrReplaceable, Loadable { - } + diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Operation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Operation.java index 8961fc887dc..07410c0a446 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Operation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Operation.java @@ -15,19 +15,16 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.client.Watch; - /** * The entry point to client operations. * @param The Kubernetes resource type. * @param The list variant of the Kubernetes resource type. - * @param The doneable variant of the Kubernetes resource type. * @param The resource operations. */ -public interface Operation +public interface Operation extends - AnyNamespaceable>, - Namespaceable>, - FilterWatchListMultiDeletable, + AnyNamespaceable>, + Namespaceable>, + FilterWatchListMultiDeletable, Loadable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterMixedOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterMixedOperation.java index 22f984c02ef..9262cdb0805 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterMixedOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterMixedOperation.java @@ -22,9 +22,8 @@ * * @param The Kubernetes resource type. * @param The list variant of the Kubernetes resource type. - * @param The doneable variant of the Kubernetes resource type. * @param The resource operations. */ -public interface ParameterMixedOperation> - extends MixedOperation, Parameterizable> { +public interface ParameterMixedOperation> + extends MixedOperation, Parameterizable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java index 69729e14a91..4f654c2a6f1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable.java @@ -16,7 +16,7 @@ package io.fabric8.kubernetes.client.dsl; -public interface ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable - extends NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable, Parameterizable> { +public interface ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable + extends NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable, Parameterizable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Patchable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Patchable.java index 016cdfddf27..5b963fd6a29 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Patchable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Patchable.java @@ -15,8 +15,8 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface Patchable { +public interface Patchable { - T patch(I item); + T patch(T item); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PodResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PodResource.java index 9a763231604..c11ca191ec5 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PodResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PodResource.java @@ -25,10 +25,10 @@ import io.fabric8.kubernetes.client.LocalPortForward; import io.fabric8.kubernetes.client.PortForward; -public interface PodResource extends Resource, - Loggable, - Containerable>, - ContainerResource, +public interface PodResource extends Resource, + Loggable, + Containerable>, + ContainerResource, PortForwardable, Evictable{ } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PolicyAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PolicyAPIGroupDSL.java index 03316d608ea..52834676fd5 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PolicyAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PolicyAPIGroupDSL.java @@ -15,8 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.policy.DoneablePodDisruptionBudget; -import io.fabric8.kubernetes.api.model.policy.DoneablePodSecurityPolicy; import io.fabric8.kubernetes.api.model.policy.PodDisruptionBudget; import io.fabric8.kubernetes.api.model.policy.PodDisruptionBudgetList; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicy; @@ -25,7 +23,7 @@ public interface PolicyAPIGroupDSL extends Client { - MixedOperation> podDisruptionBudget(); + MixedOperation> podDisruptionBudget(); - MixedOperation> podSecurityPolicies(); + MixedOperation> podSecurityPolicies(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PrettyLoggable.java index 25c8c4ca514..670f0625d29 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/PrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface PrettyLoggable extends Loggable, Prettyable> { +public interface PrettyLoggable extends Loggable, Prettyable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RbacAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RbacAPIGroupDSL.java index 5a39c5b3e26..ae85a2dd9bc 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RbacAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RbacAPIGroupDSL.java @@ -15,28 +15,24 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.rbac.DoneableClusterRole; -import io.fabric8.kubernetes.api.model.rbac.DoneableClusterRoleBinding; import io.fabric8.kubernetes.api.model.rbac.ClusterRole; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBindingList; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleList; import io.fabric8.kubernetes.api.model.rbac.Role; import io.fabric8.kubernetes.api.model.rbac.RoleList; -import io.fabric8.kubernetes.api.model.rbac.DoneableRole; import io.fabric8.kubernetes.api.model.rbac.RoleBinding; import io.fabric8.kubernetes.api.model.rbac.RoleBindingList; -import io.fabric8.kubernetes.api.model.rbac.DoneableRoleBinding; import io.fabric8.kubernetes.client.Client; public interface RbacAPIGroupDSL extends Client{ - MixedOperation> roles(); + MixedOperation> roles(); - MixedOperation> roleBindings(); + MixedOperation> roleBindings(); - MixedOperation> clusterRoles(); + MixedOperation> clusterRoles(); - MixedOperation> clusterRoleBindings(); + MixedOperation> clusterRoleBindings(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateCreateable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateCreateable.java index 7ef6b7b701d..8b09aaab38b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateCreateable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateCreateable.java @@ -15,5 +15,5 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface RecreateCreateable extends Createable, Recreateable> { +public interface RecreateCreateable extends Createable, Recreateable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateFromServerGettable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateFromServerGettable.java index 9812ea41b99..26241b133db 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateFromServerGettable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RecreateFromServerGettable.java @@ -18,5 +18,5 @@ import io.fabric8.kubernetes.client.FromServerGettable; -public interface RecreateFromServerGettable extends RecreateCreateable, FromServerGettable { +public interface RecreateFromServerGettable extends RecreateCreateable, FromServerGettable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Replaceable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Replaceable.java index 50f1f8af3ba..d17be2a59a4 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Replaceable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Replaceable.java @@ -15,8 +15,8 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface Replaceable { +public interface Replaceable { - T replace(I item); + T replace(T item); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Resource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Resource.java index cc4a423bad4..03691304d64 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Resource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Resource.java @@ -21,11 +21,10 @@ * Interface that describes the operation that can be done on a Kubernetes resource (e.g. Pod, Service etc). * This is intended to act as the common denominator of resource operations. To accommodate resources with more specialized operations, this interface should be used as a base. * @param The resource type. - * @param The "Inlineable / Doneable" type of the resource. */ -public interface Resource extends CreateOrReplaceable, - CreateFromServerGettable, - CascadingEditReplacePatchDeletable, - VersionWatchAndWaitable, +public interface Resource extends CreateOrReplaceable, + CreateFromServerGettable, + CascadingEditReplacePatchDeletable, + VersionWatchAndWaitable, Requirable, Readiable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RollableScalableResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RollableScalableResource.java index 18595408190..6f703fcbe51 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RollableScalableResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/RollableScalableResource.java @@ -15,6 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface RollableScalableResource extends ScalableResource, - Rollable> { +public interface RollableScalableResource extends ScalableResource, + Rollable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ScalableResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ScalableResource.java index 1c7a898ab46..ba686aa2dd9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ScalableResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ScalableResource.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface ScalableResource extends Resource, - Scaleable - , Loggable { +public interface ScalableResource extends Resource, + Scaleable , Loggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SchedulingAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SchedulingAPIGroupDSL.java index 14598eb4f70..62d49a5b292 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SchedulingAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SchedulingAPIGroupDSL.java @@ -15,11 +15,10 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.scheduling.DoneablePriorityClass; import io.fabric8.kubernetes.api.model.scheduling.PriorityClass; import io.fabric8.kubernetes.api.model.scheduling.PriorityClassList; import io.fabric8.kubernetes.client.Client; public interface SchedulingAPIGroupDSL extends Client { - MixedOperation> priorityClass(); + MixedOperation> priorityClass(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ServiceResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ServiceResource.java index 15c920877dc..4521b2d0d54 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ServiceResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/ServiceResource.java @@ -21,7 +21,7 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; -public interface ServiceResource extends Resource , +public interface ServiceResource extends Resource , PortForwardable { String getURL(String portName); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SettingsAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SettingsAPIGroupDSL.java index 8c1708256cf..b4c52eeb4c0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SettingsAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/SettingsAPIGroupDSL.java @@ -15,11 +15,10 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.settings.DoneablePodPreset; import io.fabric8.kubernetes.api.model.settings.PodPreset; import io.fabric8.kubernetes.api.model.settings.PodPresetList; import io.fabric8.kubernetes.client.Client; public interface SettingsAPIGroupDSL extends Client { - MixedOperation> podPresets(); + MixedOperation> podPresets(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/StorageAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/StorageAPIGroupDSL.java index 91d695f6ecb..fb6d924ba5a 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/StorageAPIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/StorageAPIGroupDSL.java @@ -15,13 +15,12 @@ */ package io.fabric8.kubernetes.client.dsl; -import io.fabric8.kubernetes.api.model.storage.DoneableStorageClass; import io.fabric8.kubernetes.api.model.storage.StorageClass; import io.fabric8.kubernetes.api.model.storage.StorageClassList; import io.fabric8.kubernetes.client.Client; public interface StorageAPIGroupDSL extends Client{ - MixedOperation> storageClasses(); + MixedOperation> storageClasses(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TailPrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TailPrettyLoggable.java index e0d5428d5b1..50a95c54466 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TailPrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TailPrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface TailPrettyLoggable extends Tailable>, PrettyLoggable { +public interface TailPrettyLoggable extends Tailable>, PrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TerminateTimeTailPrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TerminateTimeTailPrettyLoggable.java index 93020366d51..04d8c00335f 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TerminateTimeTailPrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TerminateTimeTailPrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface TerminateTimeTailPrettyLoggable extends Terminateable>, TimeTailPrettyLoggable { +public interface TerminateTimeTailPrettyLoggable extends Terminateable>, TimeTailPrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeTailPrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeTailPrettyLoggable.java index b8965fa5f2a..c8ef68f1e51 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeTailPrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeTailPrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface TimeTailPrettyLoggable extends Timeable>, TailPrettyLoggable { +public interface TimeTailPrettyLoggable extends Timeable>, TailPrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeoutImageEditReplacePatchable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeoutImageEditReplacePatchable.java index 0a93e2eb178..91be0adff86 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeoutImageEditReplacePatchable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimeoutImageEditReplacePatchable.java @@ -16,7 +16,7 @@ package io.fabric8.kubernetes.client.dsl; -public interface TimeoutImageEditReplacePatchable extends - Timeoutable>, - ImageEditReplacePatchable { +public interface TimeoutImageEditReplacePatchable extends + Timeoutable>, + ImageEditReplacePatchable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimestampBytesLimitTerminateTimeTailPrettyLoggable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimestampBytesLimitTerminateTimeTailPrettyLoggable.java index 1795eafdef6..fee5ac959ce 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimestampBytesLimitTerminateTimeTailPrettyLoggable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TimestampBytesLimitTerminateTimeTailPrettyLoggable.java @@ -16,5 +16,5 @@ package io.fabric8.kubernetes.client.dsl; -public interface TimestampBytesLimitTerminateTimeTailPrettyLoggable extends Timestampable>, BytesLimitTerminateTimeTailPrettyLoggable { +public interface TimestampBytesLimitTerminateTimeTailPrettyLoggable extends Timestampable>, BytesLimitTerminateTimeTailPrettyLoggable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecErrorable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecErrorable.java index 71fe06935bd..20105b751ad 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecErrorable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecErrorable.java @@ -17,10 +17,9 @@ /** + * @param The exec input. * @param Where to write err to. * @param

Where to read err from. - * @param The return type. - * @param The exec input. * @param The exec output. */ public interface TtyExecErrorable extends diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecInputOutputErrorable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecInputOutputErrorable.java index 2c4a1b001ce..fe64c09143c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecInputOutputErrorable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/TtyExecInputOutputErrorable.java @@ -17,12 +17,11 @@ package io.fabric8.kubernetes.client.dsl; /** + * @param The exec input. * @param Where to write err and out to. * @param Where to pipe err and out to - * @param Where to pipe input to * @param Where to read input from. - * @param The return type. - * @param The exec input. + * @param Where to pipe input to * @param The exec output. */ public interface TtyExecInputOutputErrorable extends diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java index 7adf26c6086..f0ed5f5a6d9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java @@ -17,13 +17,11 @@ import io.fabric8.kubernetes.api.model.PodTemplate; import io.fabric8.kubernetes.api.model.PodTemplateList; -import io.fabric8.kubernetes.api.model.DoneablePodTemplate; -import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.client.Client; public interface V1APIGroupDSL extends Client { - MixedOperation> podTemplates(); - MixedOperation> events(); + MixedOperation> podTemplates(); + MixedOperation> events(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VersionWatchAndWaitable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VersionWatchAndWaitable.java index 31bd2aaac46..1a722afd0a4 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VersionWatchAndWaitable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VersionWatchAndWaitable.java @@ -15,5 +15,5 @@ */ package io.fabric8.kubernetes.client.dsl; -public interface VersionWatchAndWaitable extends WatchAndWaitable, Versionable> { +public interface VersionWatchAndWaitable extends WatchAndWaitable, Versionable> { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VisitFromServerGetWatchDeleteRecreateWaitApplicable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VisitFromServerGetWatchDeleteRecreateWaitApplicable.java index 47f13d5e029..c2d656b7b6a 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VisitFromServerGetWatchDeleteRecreateWaitApplicable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/VisitFromServerGetWatchDeleteRecreateWaitApplicable.java @@ -23,11 +23,11 @@ import io.fabric8.kubernetes.client.Watch; import io.fabric8.kubernetes.client.Watcher; -public interface VisitFromServerGetWatchDeleteRecreateWaitApplicable extends Visitable>, +public interface VisitFromServerGetWatchDeleteRecreateWaitApplicable extends Visitable>, FromServerGettable, RecreateApplicable, - CascadingDeletable, - Watchable>, + CascadingDeletable, + Watchable>, Waitable, - GracePeriodConfigurable>, - PropagationPolicyConfigurable> { + GracePeriodConfigurable, + PropagationPolicyConfigurable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Waitable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Waitable.java index 770f15ada46..fad51c76187 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Waitable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Waitable.java @@ -32,7 +32,7 @@ public interface Waitable { * @param initialBackoff the value for the initial backoff on first error * @param backoffUnit the TimeUnit for the initial backoff value * @param backoffMultiplier what to multiply the backoff by on each subsequent error - * @return + * @return the waitable */ Waitable withWaitRetryBackoff(long initialBackoff, TimeUnit backoffUnit, double backoffMultiplier); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchAndWaitable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchAndWaitable.java index 83162c3a914..cc751887444 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchAndWaitable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchAndWaitable.java @@ -17,5 +17,5 @@ import io.fabric8.kubernetes.client.Watcher; -public interface WatchAndWaitable extends Watchable>, Waitable { +public interface WatchAndWaitable extends Watchable>, Waitable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchListDeletable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchListDeletable.java index 7d01dc2e945..d4ac884d2fb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchListDeletable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/WatchListDeletable.java @@ -17,8 +17,8 @@ import io.fabric8.kubernetes.client.GracePeriodConfigurable; -public interface WatchListDeletable extends VersionWatchAndWaitable, Listable, Deletable, - GracePeriodConfigurable>, +public interface WatchListDeletable extends VersionWatchAndWaitable, Listable, Deletable, + GracePeriodConfigurable, StatusUpdatable { } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Watchable.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Watchable.java index d27a6d71392..ad47055fdd0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Watchable.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/Watchable.java @@ -16,36 +16,37 @@ package io.fabric8.kubernetes.client.dsl; import io.fabric8.kubernetes.api.model.ListOptions; +import io.fabric8.kubernetes.client.Watch; -public interface Watchable { +public interface Watchable { /** - * Watch returns {@link H} interface that watches requested resource + * Watch returns {@link Watch} interface that watches requested resource * * @param watcher Watcher interface of Kubernetes resource - * @return watch interface {@link H} + * @return watch interface {@link Watch} */ - H watch(W watcher); + Watch watch(W watcher); /** - * Watch returns {@link H} interface that watches requested resource + * Watch returns {@link Watch} interface that watches requested resource * * @param options options available for watch operation * @param watcher Watcher interface of Kubernetes resource - * @return watch interface {@link H} + * @return watch interface {@link Watch} */ - H watch(ListOptions options, W watcher); + Watch watch(ListOptions options, W watcher); /** - * Watch returns {@link H} interface that watches requested resource from + * Watch returns {@link Watch} interface that watches requested resource from * specified resourceVersion * * @param resourceVersion resource version from where to start watch * @param watcher Watcher interface of Kubernetes resource * @deprecated Please use {@link #watch(ListOptions, Object)} instead, it has a parameter of resourceVersion - * @return watch interface {@link H} + * @return watch interface {@link Watch} */ @Deprecated - H watch(String resourceVersion, W watcher); + Watch watch(String resourceVersion, W watcher); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java index d4886225c39..661b3956028 100755 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java @@ -20,9 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.fabric8.kubernetes.api.builder.Function; import io.fabric8.kubernetes.api.model.DeletionPropagation; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.LabelSelector; @@ -74,6 +72,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.Predicate; import okhttp3.HttpUrl; @@ -81,12 +81,12 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; -public class BaseOperation, D extends Doneable, R extends Resource> +public class BaseOperation, R extends Resource> extends OperationSupport implements OperationInfo, - MixedOperation, - Resource { + MixedOperation, + Resource { private static final Logger LOG = LoggerFactory.getLogger(BaseOperation.class); private static final String INVOLVED_OBJECT_NAME = "involvedObject.name"; @@ -119,7 +119,6 @@ public class BaseOperation type; protected Class listType; - protected Class doneableType; protected BaseOperation(OperationContext ctx) { super(ctx); @@ -139,7 +138,7 @@ protected BaseOperation(OperationContext ctx) { this.watchRetryBackoffMultiplier = ctx.getWatchRetryBackoffMultiplier(); } - public BaseOperation newInstance(OperationContext context) { + public BaseOperation newInstance(OperationContext context) { return new BaseOperation<>(context); } @@ -245,7 +244,12 @@ public RootPaths getRootPaths() { } @Override - public D edit() { + public T edit(Function function) { + throw new KubernetesClientException("Cannot edit read-only resources"); + } + + @Override + public T accept(Consumer consumer) { throw new KubernetesClientException("Cannot edit read-only resources"); } @@ -258,24 +262,24 @@ public R withName(String name) { } @Override - public Replaceable lockResourceVersion(String resourceVersion) { + public Replaceable lockResourceVersion(String resourceVersion) { return newInstance(context.withResourceVersion(resourceVersion)); } @Override - public NonNamespaceOperation inNamespace(String namespace) { + public NonNamespaceOperation inNamespace(String namespace) { return newInstance(context.withNamespace(namespace)); } @Override - public NonNamespaceOperation inAnyNamespace() { + public NonNamespaceOperation inAnyNamespace() { Config updated = new ConfigBuilder(config).withNamespace(null).build(); return newInstance(context.withConfig(updated).withNamespace(null)); } @Override - public EditReplacePatchDeletable cascading(boolean cascading) { + public EditReplacePatchDeletable cascading(boolean cascading) { return newInstance(context.withCascading(cascading).withPropagationPolicy(null)); } @@ -351,41 +355,6 @@ public T create(T resource) { } - @Override - public D createNew() { - final Function visitor = resource -> { - try { - return create(resource); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(forOperationType("create"), e); - } - }; - - try { - return getDoneableType().getDeclaredConstructor(Function.class).newInstance(visitor); - } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | InstantiationException e) { - throw KubernetesClientException.launderThrowable(forOperationType("create"), e); - } - } - - - @Override - public D createOrReplaceWithNew() { - final Function visitor = resource -> { - try { - return createOrReplace(resource); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(forOperationType("create or replace"), e); - } - }; - - try { - return getDoneableType().getDeclaredConstructor(Function.class).newInstance(visitor); - } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | InstantiationException e) { - throw KubernetesClientException.launderThrowable(forOperationType("create or replace"), e); - } - } - @SafeVarargs @Override public final T createOrReplace(T... items) { @@ -423,13 +392,13 @@ public final T createOrReplace(T... items) { } @Override - public FilterWatchListDeletable withLabels(Map labels) { + public FilterWatchListDeletable withLabels(Map labels) { this.labels.putAll(labels); return this; } @Override - public FilterWatchListDeletable withLabelSelector(LabelSelector selector) { + public FilterWatchListDeletable withLabelSelector(LabelSelector selector) { Map matchLabels = selector.getMatchLabels(); if (matchLabels != null) { this.labels.putAll(matchLabels); @@ -468,37 +437,37 @@ public FilterWatchListDeletable withLabelSelector(LabelSel */ @Override @Deprecated - public FilterWatchListDeletable withoutLabels(Map labels) { + public FilterWatchListDeletable withoutLabels(Map labels) { // Re-use "withoutLabel" to convert values from String to String[] labels.forEach(this::withoutLabel); return this; } @Override - public FilterWatchListDeletable withLabelIn(String key, String... values) { + public FilterWatchListDeletable withLabelIn(String key, String... values) { labelsIn.put(key, values); return this; } @Override - public FilterWatchListDeletable withLabelNotIn(String key, String... values) { + public FilterWatchListDeletable withLabelNotIn(String key, String... values) { labelsNotIn.put(key, values); return this; } @Override - public FilterWatchListDeletable withLabel(String key, String value) { + public FilterWatchListDeletable withLabel(String key, String value) { labels.put(key, value); return this; } @Override - public FilterWatchListDeletable withLabel(String key) { + public FilterWatchListDeletable withLabel(String key) { return withLabel(key, null); } @Override - public FilterWatchListDeletable withoutLabel(String key, String value) { + public FilterWatchListDeletable withoutLabel(String key, String value) { labelsNot.merge(key, new String[]{value}, (oldList, newList) -> { final String[] concatList = (String[]) Array.newInstance(String.class, oldList.length + newList.length); System.arraycopy(oldList, 0, concatList, 0, oldList.length); @@ -509,24 +478,24 @@ public FilterWatchListDeletable withoutLabel(String key, S } @Override - public FilterWatchListDeletable withoutLabel(String key) { + public FilterWatchListDeletable withoutLabel(String key) { return withoutLabel(key, null); } @Override - public FilterWatchListDeletable withFields(Map fields) { + public FilterWatchListDeletable withFields(Map fields) { this.fields.putAll(fields); return this; } @Override - public FilterWatchListDeletable withField(String key, String value) { + public FilterWatchListDeletable withField(String key, String value) { fields.put(key, value); return this; } @Override - public FilterWatchListDeletable withInvolvedObject(ObjectReference objectReference) { + public FilterWatchListDeletable withInvolvedObject(ObjectReference objectReference) { if (objectReference != null) { if (objectReference.getName() != null) { fields.put(INVOLVED_OBJECT_NAME, objectReference.getName()); @@ -564,14 +533,14 @@ public FilterWatchListDeletable withInvolvedObject(ObjectR */ @Override @Deprecated - public FilterWatchListDeletable withoutFields(Map fields) { + public FilterWatchListDeletable withoutFields(Map fields) { // Re-use "withoutField" to convert values from String to String[] labels.forEach(this::withoutField); return this; } @Override - public FilterWatchListDeletable withoutField(String key, String value) { + public FilterWatchListDeletable withoutField(String key, String value) { fieldsNot.merge(key, new String[]{value}, (oldList, newList) -> { if (Utils.isNotNullOrEmpty(newList[0])) { // Only add new values when not null final String[] concatList = (String[]) Array.newInstance(String.class, oldList.length + newList.length); @@ -763,7 +732,7 @@ public T updateStatus(T item) { } - public BaseOperation withItem(T item) { + public BaseOperation withItem(T item) { return newInstance(context.withItem(item)); } @@ -993,10 +962,6 @@ public Class getListType() { return listType; } - public Class getDoneableType() { - return doneableType; - } - protected Map getLabels() { return labels; } @@ -1037,17 +1002,17 @@ public OperationInfo forOperationType(String type) { } @Override - public FilterWatchListDeletable withGracePeriod(long gracePeriodSeconds) { + public FilterWatchListDeletable withGracePeriod(long gracePeriodSeconds) { return newInstance(context.withGracePeriodSeconds(gracePeriodSeconds)); } @Override - public EditReplacePatchDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) { + public EditReplacePatchDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) { return newInstance(context.withPropagationPolicy(propagationPolicy)); } @Override - public BaseOperation withWaitRetryBackoff(long initialBackoff, TimeUnit backoffUnit, double backoffMultiplier) { + public BaseOperation withWaitRetryBackoff(long initialBackoff, TimeUnit backoffUnit, double backoffMultiplier) { return newInstance(context.withWatchRetryInitialBackoffMillis(backoffUnit.toMillis(initialBackoff)).withWatchRetryBackoffMultiplier(backoffMultiplier)); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/HasMetadataOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/HasMetadataOperation.java index 3fff0f62a39..6d6e217e595 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/HasMetadataOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/HasMetadataOperation.java @@ -18,17 +18,17 @@ import java.lang.reflect.InvocationTargetException; import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import java.util.function.Function; -import io.fabric8.kubernetes.api.builder.Function; +import io.fabric8.kubernetes.api.builder.Builder; import io.fabric8.kubernetes.api.model.DeletionPropagation; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.kubernetes.client.dsl.Resource; -public class HasMetadataOperation, D extends Doneable, R extends Resource> - extends BaseOperation< T, L, D, R> { +public class HasMetadataOperation, R extends Resource> extends BaseOperation< T, L, R> { public static final DeletionPropagation DEFAULT_PROPAGATION_POLICY = DeletionPropagation.BACKGROUND; public HasMetadataOperation(OperationContext ctx) { @@ -36,21 +36,16 @@ public HasMetadataOperation(OperationContext ctx) { } @Override - public D edit() { - final Function visitor = resource -> { - try { - return patch(resource); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(forOperationType("edit"), e); - } - }; + public T edit(Function function) { + T item = getMandatory(); + return patch(function.apply(item)); + } - try { - T item = getMandatory(); - return getDoneableType().getDeclaredConstructor(getType(), Function.class).newInstance(item, visitor); - } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | InstantiationException e) { - throw KubernetesClientException.launderThrowable(forOperationType("edit"), e); - } + @Override + public T accept(Consumer consumer) { + T item = getMandatory(); + consumer.accept(item); + return patch(item); } @Override @@ -83,8 +78,7 @@ public T replace(T item) { throw KubernetesClientException.launderThrowable(forOperationType("replace"), e); } }; - D doneable = getDoneableType().getDeclaredConstructor(getType(), Function.class).newInstance(item, visitor); - return doneable.done(); + return visitor.apply(item); } catch (KubernetesClientException e) { caught = e; // Only retry if there's a conflict and using dynamic resource version - this is normally to do with resource version & server updates. @@ -130,8 +124,7 @@ public T patch(T item) { throw KubernetesClientException.launderThrowable(forOperationType("patch"), e); } }; - D doneable = getDoneableType().getDeclaredConstructor(getType(), Function.class).newInstance(item, visitor); - return doneable.done(); + return visitor.apply(item); } catch (KubernetesClientException e) { caught = e; // Only retry if there's a conflict - this is normally to do with resource version & server updates. diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CreateOnlyResourceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CreateOnlyResourceOperationsImpl.java index c05da895f1c..b28a122ae0c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CreateOnlyResourceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CreateOnlyResourceOperationsImpl.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.concurrent.ExecutionException; -public class CreateOnlyResourceOperationsImpl extends OperationSupport implements io.fabric8.kubernetes.client.dsl.Createable { +public class CreateOnlyResourceOperationsImpl extends OperationSupport implements io.fabric8.kubernetes.client.dsl.Createable { private final Class subjectAccessRequestClass; public CreateOnlyResourceOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural, Class subjectAccessRequestClass) { @@ -73,11 +73,6 @@ public T create(T item) { } } - @Override - public D createNew() { - throw new IllegalStateException("this operation is not supported, please use create() instead"); - } - public T getItem() { return (T) context.getItem(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationContext.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationContext.java index cdfdbea9b8e..eea1ab91fa5 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationContext.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationContext.java @@ -29,17 +29,15 @@ public class CustomResourceOperationContext extends OperationContext { protected CustomResourceDefinitionContext crdContext; protected Class type; protected Class listType; - protected Class doneableType; public CustomResourceOperationContext() { } - public CustomResourceOperationContext(OkHttpClient client, Config config, String plural, String namespace, String name, String apiGroupName, String apiGroupVersion, boolean cascading, Object item, Map labels, Map labelsNot, Map labelsIn, Map labelsNotIn, Map fields, Map fieldsNot, String resourceVersion, boolean reloadingFromServer, long gracePeriodSeconds, DeletionPropagation propagationPolicy, long watchRetryInitialBackoffMillis, double watchRetryBackoffMultiplier, boolean namespaceFromGlobalConfig, CustomResourceDefinitionContext crdContext, Class type, Class listType, Class doneableType) { + public CustomResourceOperationContext(OkHttpClient client, Config config, String plural, String namespace, String name, String apiGroupName, String apiGroupVersion, boolean cascading, Object item, Map labels, Map labelsNot, Map labelsIn, Map labelsNotIn, Map fields, Map fieldsNot, String resourceVersion, boolean reloadingFromServer, long gracePeriodSeconds, DeletionPropagation propagationPolicy, long watchRetryInitialBackoffMillis, double watchRetryBackoffMultiplier, boolean namespaceFromGlobalConfig, CustomResourceDefinitionContext crdContext, Class type, Class listType) { super(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading, item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig); this.crdContext = crdContext; this.type = type; this.listType = listType; - this.doneableType = doneableType; } public CustomResourceDefinitionContext getCrdContext() { @@ -54,89 +52,87 @@ public Class getListType() { return listType; } - public Class getDoneableType() { - return doneableType; - } - public CustomResourceOperationContext withOkhttpClient(OkHttpClient client) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withConfig(Config config) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withPlural(String plural) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withNamespace(String namespace) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withName(String name) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withApiGroupName(String apiGroupName) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withApiGroupVersion(String apiGroupVersion) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } @Override public CustomResourceOperationContext withItem(Object item) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withCascading(boolean cascading) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withLabels(Map labels) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withLabelsIn(Map labelsIn) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withLabelsNot(Map labelsNot) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withLabelsNotIn(Map labelsNotIn) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withFields(Map fields) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withFieldsNot(Map fieldsNot) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withResourceVersion(String resourceVersion) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withReloadingFromServer(boolean reloadingFromServer) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withGracePeriodSeconds(long gracePeriodSeconds) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withPropagationPolicy(DeletionPropagation propagationPolicy) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } /** * @deprecated use {@link #withCrdContext(CustomResourceDefinitionContext)} instead + * @param crd The custom resource definition. + * @return The operation context. */ @Deprecated public CustomResourceOperationContext withCrd(CustomResourceDefinition crd) { @@ -144,18 +140,14 @@ public CustomResourceOperationContext withCrd(CustomResourceDefinition crd) { } public CustomResourceOperationContext withCrdContext(CustomResourceDefinitionContext crdContext) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withType(Class type) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } public CustomResourceOperationContext withListType(Class listType) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); - } - - public CustomResourceOperationContext withDoneableType(Class doneableType) { - return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType, doneableType); + return new CustomResourceOperationContext(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading,item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, crdContext, type, listType); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationsImpl.java index a73e90397e6..4337745357f 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/CustomResourceOperationsImpl.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl.internal; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.KubernetesResourceList; @@ -30,8 +29,7 @@ /** */ -public class CustomResourceOperationsImpl, D extends Doneable> extends HasMetadataOperation> implements MixedOperation> { +public class CustomResourceOperationsImpl> extends HasMetadataOperation> implements MixedOperation> { private final boolean resourceNamespaced; @@ -46,7 +44,6 @@ public CustomResourceOperationsImpl(CustomResourceOperationContext context) { this.type = context.getType(); this.listType = context.getListType(); - this.doneableType = context.getDoneableType(); this.resourceNamespaced = resourceNamespaced(context.getCrdContext()); this.apiVersion = getAPIGroup() + "/" + getAPIVersion(); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/KubernetesListOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/KubernetesListOperationsImpl.java index 63ff6c0b30f..78eb624be16 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/KubernetesListOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/KubernetesListOperationsImpl.java @@ -21,7 +21,6 @@ import io.fabric8.kubernetes.client.dsl.Loadable; import okhttp3.OkHttpClient; import io.fabric8.kubernetes.api.builder.VisitableBuilder; -import io.fabric8.kubernetes.api.model.DoneableKubernetesList; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesList; import io.fabric8.kubernetes.client.Config; @@ -48,8 +47,8 @@ public class KubernetesListOperationsImpl extends OperationSupport implements KubernetesListOperation, KubernetesListMixedOperation, - Loadable>, - RecreateFromServerGettable { + Loadable>, + RecreateFromServerGettable { private final KubernetesList item; private final Boolean fromServer; @@ -92,18 +91,7 @@ public KubernetesList create(KubernetesList list) { } @Override - public DoneableKubernetesList createNew() { - return new DoneableKubernetesList(item -> { - try { - return create(item); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(e); - } - }); - } - - @Override - public RecreateFromServerGettable load(URL url) { + public RecreateFromServerGettable load(URL url) { try (InputStream inputStream = url.openStream()) { return load(inputStream); } catch (IOException e) { @@ -112,7 +100,7 @@ public RecreateFromServerGettable load(File file) { + public RecreateFromServerGettable load(File file) { try (FileInputStream fis = new FileInputStream(file)) { return load(fis); } catch (IOException e) { @@ -121,12 +109,12 @@ public RecreateFromServerGettable load(String path) { + public RecreateFromServerGettable load(String path) { return load(new File(path)); } @Override - public RecreateFromServerGettable load(InputStream is) { + public RecreateFromServerGettable load(InputStream is) { return new KubernetesListOperationsImpl(client, config, namespace, null, DeletionPropagation.BACKGROUND, fromServer, deletingExisting, unmarshal(is, KubernetesList.class), null); } @@ -167,7 +155,7 @@ public Gettable fromServer() { } @Override - public Createable deletingExisting() { + public Createable deletingExisting() { return new KubernetesListOperationsImpl(client, config, namespace, null, DeletionPropagation.BACKGROUND, fromServer, true, item, null); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/LocalCreateOnlyResourceReviewOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/LocalCreateOnlyResourceReviewOperationsImpl.java index 4d9315b72e9..9423ed2d00c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/LocalCreateOnlyResourceReviewOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/LocalCreateOnlyResourceReviewOperationsImpl.java @@ -20,7 +20,7 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -public class LocalCreateOnlyResourceReviewOperationsImpl extends CreateOnlyResourceOperationsImpl implements Namespaceable> { +public class LocalCreateOnlyResourceReviewOperationsImpl extends CreateOnlyResourceOperationsImpl implements Namespaceable> { private Class subjectAccessRequestClass; private String subjectAccessApiGroupName; private String subjectAccessApiGroupVersion; @@ -43,7 +43,7 @@ public LocalCreateOnlyResourceReviewOperationsImpl(OperationContext context, Str } @Override - public LocalCreateOnlyResourceReviewOperationsImpl inNamespace(String namespace) { + public LocalCreateOnlyResourceReviewOperationsImpl inNamespace(String namespace) { this.namespace = namespace; return new LocalCreateOnlyResourceReviewOperationsImpl<>(context.withNamespace(namespace), subjectAccessApiGroupName, subjectAccessApiGroupVersion, plural, subjectAccessRequestClass); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java index 5b76cfc0e9a..42ed4527d14 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java @@ -59,7 +59,7 @@ import static io.fabric8.kubernetes.client.utils.DeleteAndCreateHelper.deleteAndCreateItem; public class NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl extends OperationSupport implements - NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable, + NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable, Waitable, Readiable { @@ -176,7 +176,7 @@ public HasMetadata get() { } @Override - public VisitFromServerGetWatchDeleteRecreateWaitApplicable inNamespace(String explicitNamespace) { + public VisitFromServerGetWatchDeleteRecreateWaitApplicable inNamespace(String explicitNamespace) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, deletingExisting, visitors, item, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @@ -191,25 +191,25 @@ public Applicable deletingExisting() { } @Override - public VisitFromServerGetWatchDeleteRecreateWaitApplicable accept(Visitor visitor) { + public VisitFromServerGetWatchDeleteRecreateWaitApplicable accept(Visitor visitor) { List newVisitors = new ArrayList<>(visitors); newVisitors.add(visitor); return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, newVisitors, item, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @Override - public CascadingDeletable withGracePeriod(long gracePeriodSeconds) { + public CascadingDeletable withGracePeriod(long gracePeriodSeconds) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @Override - public CascadingDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) { + public CascadingDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @Override - public Deletable cascading(boolean cascading) { + public Deletable cascading(boolean cascading) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java index b8a4fb1c8cc..447e6bf970d 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java @@ -63,7 +63,7 @@ import static io.fabric8.kubernetes.client.utils.CreateOrReplaceHelper.createOrReplaceItem; import static io.fabric8.kubernetes.client.utils.DeleteAndCreateHelper.deleteAndCreateItem; -public class NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl extends OperationSupport implements ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable, +public class NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl extends OperationSupport implements ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable, Waitable, HasMetadata>, Readiable { private static final Logger LOGGER = LoggerFactory.getLogger(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.class); @@ -214,7 +214,7 @@ public Boolean isReady() { } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable withParameters(Map parameters) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable withParameters(Map parameters) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, namespace, explicitNamespace, fromServer, deletingExisting, visitors, null, inputStream, parameters, -1, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @@ -359,7 +359,7 @@ private static List acceptVisitors(List list, List inNamespace(String explicitNamespace) { + public ListVisitFromServerGetDeleteRecreateWaitApplicable inNamespace(String explicitNamespace) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, deletingExisting, visitors, item, null, null, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @@ -374,18 +374,18 @@ public Applicable> deletingExisting() { } @Override - public ListVisitFromServerGetDeleteRecreateWaitApplicable accept(Visitor visitor) { + public ListVisitFromServerGetDeleteRecreateWaitApplicable accept(Visitor visitor) { List newVisitors = new ArrayList<>(visitors); newVisitors.add(visitor); return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, newVisitors, item, null, null, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } - @Override public CascadingDeletable withGracePeriod(long gracePeriodSeconds) + @Override public CascadingDeletable withGracePeriod(long gracePeriodSeconds) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, null, null, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } - @Override public CascadingDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) + @Override public CascadingDeletable withPropagationPolicy(DeletionPropagation propagationPolicy) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, null, null, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } @@ -397,7 +397,7 @@ public Waitable, HasMetadata> withWaitRetryBackoff(long initia } @Override - public Deletable cascading(boolean cascading) { + public Deletable cascading(boolean cascading) { return new NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(client, config, fallbackNamespace, explicitNamespace, fromServer, true, visitors, item, null, null, gracePeriodSeconds, propagationPolicy, cascading, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java index 4577527186b..8356cef89eb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java @@ -488,6 +488,7 @@ public Map delete(String namespace, DeleteOptions deleteOptions) * @param namespace desired namespace * @param name custom resource's name * @return object as HashMap + * @throws IOException in case of any network/object parse problems */ public Map delete(String namespace, String name) throws IOException { return makeCall(fetchUrl(namespace, name, null), objectMapper.writeValueAsString(fetchDeleteOptions(false, DeletionPropagation.BACKGROUND.toString())), HttpCallMethod.DELETE); @@ -601,6 +602,7 @@ public void watch(Watcher watcher) throws IOException { * @param labels HashMap containing labels (optional) * @param resourceVersion resource version to start watch from * @param watcher watcher object which reports events + * @return watch object for watching resource * @throws IOException in case of network error */ public Watch watch(String namespace, String name, Map labels, String resourceVersion, Watcher watcher) throws IOException { diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java index 5f52e45ddd7..c71c8cdab72 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java @@ -54,7 +54,7 @@ public class WatchConnectionManager resourceVersion; private final ListOptions listOptions; - private final BaseOperation baseOperation; + private final BaseOperation baseOperation; private final Watcher watcher; private final int reconnectLimit; private final int reconnectInterval; @@ -74,7 +74,7 @@ public class WatchConnectionManager baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long websocketTimeout, int maxIntervalExponent) throws MalformedURLException { + public WatchConnectionManager(final OkHttpClient client, final BaseOperation baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long websocketTimeout, int maxIntervalExponent) throws MalformedURLException { this.listOptions = listOptions; this.resourceVersion = new AtomicReference<>(listOptions.getResourceVersion()); this.baseOperation = baseOperation; @@ -102,7 +102,7 @@ public WatchConnectionManager(final OkHttpClient client, final BaseOperation baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long websocketTimeout) throws MalformedURLException { + public WatchConnectionManager(final OkHttpClient client, final BaseOperation baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long websocketTimeout) throws MalformedURLException { // Default max 32x slowdown from base interval this(client, baseOperation, listOptions, watcher, reconnectInterval, reconnectLimit, websocketTimeout, 5); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchHTTPManager.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchHTTPManager.java index 17c773aec25..4459d3128dc 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchHTTPManager.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchHTTPManager.java @@ -52,7 +52,7 @@ public class WatchHTTPManager baseOperation; + private final BaseOperation baseOperation; private final Watcher watcher; private final AtomicBoolean forceClosed = new AtomicBoolean(); private final ListOptions listOptions; @@ -73,7 +73,7 @@ public class WatchHTTPManager baseOperation, + final BaseOperation baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long connectTimeout) throws MalformedURLException { @@ -82,7 +82,7 @@ public WatchHTTPManager(final OkHttpClient client, } public WatchHTTPManager(final OkHttpClient client, - final BaseOperation baseOperation, + final BaseOperation baseOperation, final ListOptions listOptions, final Watcher watcher, final int reconnectInterval, final int reconnectLimit, long connectTimeout, int maxIntervalExponent) throws MalformedURLException { diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentOperationsImpl.java index 11d9370c974..f055bedc75d 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentOperationsImpl.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.OwnerReference; import io.fabric8.kubernetes.api.model.Status; -import io.fabric8.kubernetes.api.model.apps.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetList; import io.fabric8.kubernetes.api.model.extensions.DeploymentRollback; @@ -30,7 +29,6 @@ import okhttp3.OkHttpClient; import io.fabric8.kubernetes.api.model.apps.Deployment; import io.fabric8.kubernetes.api.model.apps.DeploymentList; -import io.fabric8.kubernetes.api.model.apps.DoneableDeployment; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.KubernetesClientException; import org.slf4j.Logger; @@ -45,6 +43,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Function; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; @@ -54,8 +54,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -public class DeploymentOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable { +public class DeploymentOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { static final transient Logger LOG = LoggerFactory.getLogger(DeploymentOperationsImpl.class); public static final String DEPLOYMENT_KUBERNETES_IO_REVISION = "deployment.kubernetes.io/revision"; @@ -78,7 +78,6 @@ public DeploymentOperationsImpl(RollingOperationContext context) { .withPlural("deployments")); this.type = Deployment .class; this.listType = DeploymentList.class; - this.doneableType = DoneableDeployment.class; } private DeploymentOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -98,7 +97,7 @@ public Deployment scale(int count) { @Override public Deployment scale(int count, boolean wait) { - Deployment res = cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + Deployment res = cascading(false).accept(d -> d.getSpec().setReplicas(count)); if (wait) { waitUntilDeploymentIsScaled(count); res = getMandatory(); @@ -107,11 +106,19 @@ public Deployment scale(int count, boolean wait) { } @Override - public DoneableDeployment edit() { + public Deployment edit(Function function) { if (isCascading()) { - return cascading(false).edit(); + return cascading(false).edit(function); } - return super.edit(); + return super.edit(function); + } + + @Override + public Deployment accept(Consumer consumer) { + if (isCascading()) { + return cascading(false).accept(consumer); + } + return super.accept(consumer); } @Override @@ -141,13 +148,13 @@ public Status rollback(DeploymentRollback rollback) { } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new DeploymentRollingUpdater(client, config, getNamespace(), rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @Override public Deployment withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(d -> d.getSpec().setReplicas(count)); } @Override @@ -240,12 +247,12 @@ public Deployment undo() { } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new DeploymentOperationsImpl(((RollingOperationContext)context).withRollingTimeout(timeoutInMillis)); } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new DeploymentOperationsImpl(((RollingOperationContext)context).withRollingTimeUnit(unit)); } @@ -310,15 +317,15 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> rcList = doGetLog(); - for (RollableScalableResource rcOperation : rcList) { + List> rcList = doGetLog(); + for (RollableScalableResource rcOperation : rcList) { stringBuilder.append(rcOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog() { - List> rcs = new ArrayList<>(); + private List> doGetLog() { + List> rcs = new ArrayList<>(); Deployment deployment = fromServer().get(); String rcUid = deployment.getMetadata().getUid(); @@ -346,7 +353,7 @@ private List> doGetLog( */ @Override public Reader getLogReader() { - List> podResources = doGetLog(); + List> podResources = doGetLog(); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -362,7 +369,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(); + List> podResources = doGetLog(); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -372,7 +379,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new DeploymentOperationsImpl(((RollingOperationContext)context), logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentRollingUpdater.java index 72980900acb..b63281001cc 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/DeploymentRollingUpdater.java @@ -18,7 +18,6 @@ import okhttp3.OkHttpClient; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.apps.DoneableDeployment; import io.fabric8.kubernetes.api.model.LabelSelectorRequirement; import io.fabric8.kubernetes.api.model.apps.Deployment; import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder; @@ -29,7 +28,7 @@ import io.fabric8.kubernetes.client.dsl.RollableScalableResource; import io.fabric8.kubernetes.client.dsl.FilterWatchListDeletable; -class DeploymentRollingUpdater extends RollingUpdater { +class DeploymentRollingUpdater extends RollingUpdater { DeploymentRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -56,7 +55,7 @@ protected Deployment createClone(Deployment obj, String newName, String newDeplo @Override protected PodList listSelectedPods(Deployment obj) { - FilterWatchListDeletable podLister = pods().inNamespace(namespace); + FilterWatchListDeletable podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } @@ -82,18 +81,25 @@ protected PodList listSelectedPods(Deployment obj) { } @Override - protected void updateDeploymentKey(DoneableDeployment obj, String hash) { - obj.editSpec() - .editTemplate().editMetadata().addToAnnotations(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + protected Deployment updateDeploymentKey(String name, String hash) { + Deployment old = resources().inNamespace(namespace).withName(name).get(); + Deployment updated = new DeploymentBuilder(old).editSpec() + .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() + .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).patch(updated); } @Override - protected void removeDeploymentKey(DoneableDeployment obj) { - obj.editSpec() - .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() - .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + protected Deployment removeDeploymentKey(String name) { + Deployment old = resources().inNamespace(namespace).withName(name).get(); + Deployment updated = new DeploymentBuilder(old).editSpec() + .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() + .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).patch(updated); } @Override @@ -107,7 +113,7 @@ protected Deployment setReplicas(Deployment obj, int replicas) { } @Override - protected Operation> resources() { + protected Operation> resources() { return new DeploymentOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetOperationsImpl.java index 8b6b9babd8b..b685b8a987b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetOperationsImpl.java @@ -16,10 +16,8 @@ package io.fabric8.kubernetes.client.dsl.internal.apps.v1; import io.fabric8.kubernetes.api.model.Container; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.Status; -import io.fabric8.kubernetes.api.model.apps.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetList; import io.fabric8.kubernetes.api.model.extensions.DeploymentRollback; @@ -44,8 +42,8 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -public class ReplicaSetOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable { +public class ReplicaSetOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { private Integer podLogWaitTimeout; public ReplicaSetOperationsImpl(OkHttpClient client, Config config) { @@ -62,7 +60,6 @@ public ReplicaSetOperationsImpl(RollingOperationContext context) { .withPlural("replicasets")); this.type = ReplicaSet.class; this.listType = ReplicaSetList.class; - this.doneableType = DoneableReplicaSet.class; } public ReplicaSetOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -135,11 +132,11 @@ public ReplicaSet undo() { @Override public ReplicaSet withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(r -> r.getSpec().setReplicas(count)); } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new ReplicaSetRollingUpdater(client, config, getNamespace(), rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @@ -170,12 +167,12 @@ public Status rollback(DeploymentRollback deploymentRollback) { } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new ReplicaSetOperationsImpl(((RollingOperationContext)context).withRollingTimeout(unit.toMillis(timeout)).withRollingTimeUnit(TimeUnit.MILLISECONDS)); } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new ReplicaSetOperationsImpl(((RollingOperationContext)context).withRollingTimeout(timeoutInMillis)); } @@ -185,14 +182,14 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> podOperationList = doGetLog(isPretty); - for (PodResource podOperation : podOperationList) { + List> podOperationList = doGetLog(isPretty); + for (PodResource podOperation : podOperationList) { stringBuilder.append(podOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog(boolean isPretty) { + private List> doGetLog(boolean isPretty) { ReplicaSet replicaSet = fromServer().get(); return PodOperationUtil.getPodOperationsForController(context, replicaSet.getMetadata().getUid(), getReplicaSetSelectorLabels(replicaSet), isPretty, podLogWaitTimeout); @@ -204,7 +201,7 @@ private List> doGetLog(boolean isPretty) { */ @Override public Reader getLogReader() { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -220,7 +217,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -230,7 +227,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new ReplicaSetOperationsImpl(((RollingOperationContext)context), logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetRollingUpdater.java index bc0d8797f56..50ffc99ab76 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/ReplicaSetRollingUpdater.java @@ -18,7 +18,6 @@ import okhttp3.OkHttpClient; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.apps.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.LabelSelectorRequirement; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetBuilder; @@ -29,7 +28,7 @@ import io.fabric8.kubernetes.client.dsl.RollableScalableResource; import io.fabric8.kubernetes.client.dsl.FilterWatchListDeletable; -class ReplicaSetRollingUpdater extends RollingUpdater { +class ReplicaSetRollingUpdater extends RollingUpdater { ReplicaSetRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -56,7 +55,7 @@ protected ReplicaSet createClone(ReplicaSet obj, String newName, String newDeplo @Override protected PodList listSelectedPods(ReplicaSet obj) { - FilterWatchListDeletable podLister = pods().inNamespace(namespace); + FilterWatchListDeletable podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } @@ -82,19 +81,25 @@ protected PodList listSelectedPods(ReplicaSet obj) { } @Override - protected void updateDeploymentKey(DoneableReplicaSet obj, String hash) { - obj.editSpec() - .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() - .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + protected ReplicaSet updateDeploymentKey(String name, String hash) { + ReplicaSet old = resources().inNamespace(namespace).withName(name).get(); + ReplicaSet updated = new ReplicaSetBuilder(old).editSpec() + .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() + .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).patch(updated); } @Override - protected void removeDeploymentKey(DoneableReplicaSet obj) { - obj.editSpec() - .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() - .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + protected ReplicaSet removeDeploymentKey(String name) { + ReplicaSet old = resources().inNamespace(namespace).withName(name).get(); + ReplicaSet updated = new ReplicaSetBuilder(old).editSpec() + .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() + .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).patch(updated); } @Override @@ -108,7 +113,7 @@ protected ReplicaSet setReplicas(ReplicaSet obj, int replicas) { } @Override - protected Operation> resources() { + protected Operation> resources() { return new ReplicaSetOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollableScalableResourceOperation.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollableScalableResourceOperation.java index 779415c69bd..a500a845f31 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollableScalableResourceOperation.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollableScalableResourceOperation.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.dsl.internal.apps.v1; import io.fabric8.kubernetes.api.builder.Visitor; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.autoscaling.v1.Scale; @@ -37,12 +36,13 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; /** * Operations for resources that represent scalable, rolling-updatable sets of Pods. */ -public abstract class RollableScalableResourceOperation, D extends Doneable, R extends Resource> - extends HasMetadataOperation implements RollableScalableResource { +public abstract class RollableScalableResourceOperation, R extends Resource> + extends HasMetadataOperation implements RollableScalableResource { private final Logger Log = LoggerFactory.getLogger(this.getClass()); @@ -58,7 +58,7 @@ public RollableScalableResourceOperation(RollingOperationContext context) { } protected abstract T withReplicas(int count); - protected abstract RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit); + protected abstract RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit); // There are no common interfaces through which we could get these values. protected abstract int getCurrentReplicas(T current); @@ -144,23 +144,16 @@ private void waitUntilScaled(final int count) { } @Override - public D edit() { + public T edit(Function function) { if (!rolling) { - return super.edit(); + return super.edit(function); } - - final Visitor visitor = t -> { - try { - getRollingUpdater(rollingTimeout, rollingTimeUnit).rollUpdate(getMandatory(), t); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(e); - } - }; - try { - return getDoneableType().getDeclaredConstructor(getType(), Visitor.class).newInstance(get(), visitor); - } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | InstantiationException e) { - throw KubernetesClientException.launderThrowable(e); + T oldObj = getMandatory(); + T newObj = function.apply(oldObj); + return getRollingUpdater(rollingTimeout, rollingTimeUnit).rollUpdate(oldObj, newObj); + } catch (Exception e) { + throw KubernetesClientException.launderThrowable(e); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollingUpdater.java index 43d9cfbf36e..e46b66f2383 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/RollingUpdater.java @@ -18,10 +18,9 @@ import com.fasterxml.jackson.core.JsonProcessingException; import io.fabric8.kubernetes.client.dsl.internal.core.v1.PodOperationsImpl; import okhttp3.OkHttpClient; -import io.fabric8.kubernetes.api.model.Doneable; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; +import io.fabric8.kubernetes.api.model.PodBuilder; import io.fabric8.kubernetes.api.model.PodCondition; import io.fabric8.kubernetes.api.model.PodList; import io.fabric8.kubernetes.client.Config; @@ -51,7 +50,7 @@ import static io.fabric8.kubernetes.client.internal.SerializationUtils.dumpWithoutRuntimeStateAsYaml; -public abstract class RollingUpdater> { +public abstract class RollingUpdater { public static final String DEPLOYMENT_KEY = "deployment"; private static final Long DEFAULT_ROLLING_TIMEOUT = 15 * 60 * 1000L; // 15 mins @@ -82,9 +81,9 @@ public RollingUpdater(OkHttpClient client, Config config, String namespace, long protected abstract PodList listSelectedPods(T obj); - protected abstract void updateDeploymentKey(D obj, String hash); + protected abstract T updateDeploymentKey(String name, String hash); - protected abstract void removeDeploymentKey(D obj); + protected abstract T removeDeploymentKey(String name); protected abstract int getReplicas(T obj); @@ -105,19 +104,19 @@ public T rollUpdate(T oldObj, T newObj) { for (Pod pod : oldPods.getItems()) { try { - pods().inNamespace(namespace).withName(pod.getMetadata().getName()) - .edit() - .editMetadata().addToLabels(DEPLOYMENT_KEY, oldDeploymentHash) - .and().done(); + Pod old = pods().inNamespace(namespace).withName(pod.getMetadata().getName()).get(); + Pod updated = new PodBuilder(old) + .editMetadata().addToLabels(DEPLOYMENT_KEY, oldDeploymentHash).endMetadata() + .build(); + pods().inNamespace(namespace).withName(pod.getMetadata().getName()).replace(updated); } catch (KubernetesClientException e) { LOG.warn("Unable to add deployment key to pod: {}", e.getMessage()); } } // Now we can update the old object with the new selector - D editable = resources().inNamespace(namespace).withName(oldName).cascading(false).edit(); - updateDeploymentKey(editable, oldDeploymentHash); - oldObj = editable.done(); + + oldObj = updateDeploymentKey(oldName, oldDeploymentHash); // Get a hash of the new RC for String newDeploymentHash = md5sum(newObj); @@ -164,10 +163,7 @@ public T rollUpdate(T oldObj, T newObj) { createdObj.getMetadata().setName(oldName); createdObj = resources().inNamespace(namespace).create(createdObj); - - editable = resources().inNamespace(namespace).withName(createdObj.getMetadata().getName()).cascading(false).edit(); - removeDeploymentKey(editable); - createdObj = editable.done(); + createdObj = removeDeploymentKey(createdObj.getMetadata().getName()); } return createdObj; @@ -289,9 +285,9 @@ private String md5sum(HasMetadata obj) throws NoSuchAlgorithmException, JsonProc return String.format("%1$032x", i); } - protected abstract Operation> resources(); + protected abstract Operation> resources(); - protected Operation> pods() { + protected Operation> pods() { return new PodOperationsImpl(client, config); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetOperationsImpl.java index a4bdcb4e466..9352ccfdd07 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetOperationsImpl.java @@ -16,14 +16,12 @@ package io.fabric8.kubernetes.client.dsl.internal.apps.v1; import io.fabric8.kubernetes.api.model.Container; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.Status; import io.fabric8.kubernetes.api.model.apps.ControllerRevision; import io.fabric8.kubernetes.api.model.apps.ControllerRevisionList; import io.fabric8.kubernetes.api.model.apps.StatefulSet; -import io.fabric8.kubernetes.api.model.apps.DoneableStatefulSet; import io.fabric8.kubernetes.api.model.apps.StatefulSetList; import io.fabric8.kubernetes.api.model.extensions.DeploymentRollback; import io.fabric8.kubernetes.client.Config; @@ -49,8 +47,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -public class StatefulSetOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable +public class StatefulSetOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { private Integer podLogWaitTimeout; public StatefulSetOperationsImpl(OkHttpClient client, Config config) { @@ -67,7 +65,6 @@ public StatefulSetOperationsImpl(RollingOperationContext context) { .withPlural("statefulsets")); this.type = StatefulSet.class; this.listType = StatefulSetList.class; - this.doneableType = DoneableStatefulSet.class; } private StatefulSetOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -82,11 +79,11 @@ public StatefulSetOperationsImpl newInstance(OperationContext context) { @Override public StatefulSet withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(s -> s.getSpec().setReplicas(count)); } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new StatefulSetRollingUpdater(client, config, getNamespace(), rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @@ -151,12 +148,12 @@ public StatefulSet updateImage(String image) { } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new StatefulSetOperationsImpl(((RollingOperationContext)context).withRollingTimeout(unit.toMillis(timeout)).withRollingTimeUnit(TimeUnit.MILLISECONDS)); } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new StatefulSetOperationsImpl(((RollingOperationContext)context).withRollingTimeout(timeoutInMillis)); } @@ -171,14 +168,14 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> podOperationList = doGetLog(isPretty); - for (PodResource podOperation : podOperationList) { + List> podOperationList = doGetLog(isPretty); + for (PodResource podOperation : podOperationList) { stringBuilder.append(podOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog(boolean isPretty) { + private List> doGetLog(boolean isPretty) { StatefulSet statefulSet = fromServer().get(); return PodOperationUtil.getPodOperationsForController(context, statefulSet.getMetadata().getUid(), @@ -191,7 +188,7 @@ private List> doGetLog(boolean isPretty) { */ @Override public Reader getLogReader() { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -207,7 +204,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -217,7 +214,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new StatefulSetOperationsImpl(((RollingOperationContext)context), logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetRollingUpdater.java index caa69b18371..5e01fd6451b 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/apps/v1/StatefulSetRollingUpdater.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.api.model.LabelSelectorRequirement; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.apps.DoneableStatefulSet; import io.fabric8.kubernetes.api.model.apps.StatefulSet; import io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder; import io.fabric8.kubernetes.api.model.apps.StatefulSetList; @@ -29,7 +28,7 @@ import io.fabric8.kubernetes.client.dsl.RollableScalableResource; import okhttp3.OkHttpClient; -class StatefulSetRollingUpdater extends RollingUpdater { +class StatefulSetRollingUpdater extends RollingUpdater { StatefulSetRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -56,7 +55,7 @@ protected StatefulSet createClone(StatefulSet obj, String newName, String newDep @Override protected PodList listSelectedPods(StatefulSet obj) { - FilterWatchListDeletable podLister = pods().inNamespace(namespace); + FilterWatchListDeletable podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } @@ -82,19 +81,26 @@ protected PodList listSelectedPods(StatefulSet obj) { } @Override - protected void updateDeploymentKey(DoneableStatefulSet obj, String hash) { - obj.editSpec() - .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() - .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + protected StatefulSet updateDeploymentKey(String name, String hash) { + StatefulSet old = resources().inNamespace(namespace).withName(name).get(); + StatefulSet updated = new StatefulSetBuilder(old).editSpec() + .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() + .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } @Override - protected void removeDeploymentKey(DoneableStatefulSet obj) { - obj.editSpec() - .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() - .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + protected StatefulSet removeDeploymentKey(String name) { + StatefulSet old = resources().inNamespace(namespace).withName(name).get(); + StatefulSet updated = new StatefulSetBuilder(old) + .editSpec() + .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() + .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } @Override @@ -108,7 +114,7 @@ protected StatefulSet setReplicas(StatefulSet obj, int replicas) { } @Override - protected Operation> resources() { + protected Operation> resources() { return new StatefulSetOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1/JobOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1/JobOperationsImpl.java index 7cd936038f1..f2e0a32baa3 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1/JobOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1/JobOperationsImpl.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl.internal.batch.v1; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.autoscaling.v1.Scale; import io.fabric8.kubernetes.client.dsl.LogWatch; @@ -24,7 +23,6 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.kubernetes.client.utils.PodOperationUtil; import okhttp3.OkHttpClient; -import io.fabric8.kubernetes.api.model.batch.DoneableJob; import io.fabric8.kubernetes.api.model.batch.Job; import io.fabric8.kubernetes.api.model.batch.JobList; import io.fabric8.kubernetes.client.Config; @@ -48,8 +46,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -public class JobOperationsImpl extends HasMetadataOperation> - implements ScalableResource { +public class JobOperationsImpl extends HasMetadataOperation> + implements ScalableResource { static final transient Logger LOG = LoggerFactory.getLogger(JobOperationsImpl.class); private Integer podLogWaitTimeout; @@ -69,7 +67,6 @@ public JobOperationsImpl(OperationContext context) { this.type = Job.class; this.listType = JobList.class; - this.doneableType = DoneableJob.class; } private JobOperationsImpl(OperationContext context, Integer podLogWaitTimeout) { @@ -83,7 +80,7 @@ public JobOperationsImpl newInstance(OperationContext context) { } @Override - public ScalableResource load(InputStream is) { + public ScalableResource load(InputStream is) { try { Job item = unmarshal(is, Job.class); return new JobOperationsImpl(context.withItem(item)); @@ -93,7 +90,7 @@ public ScalableResource load(InputStream is) { } @Override - public ScalableResource fromServer() { + public ScalableResource fromServer() { return new JobOperationsImpl(context.withReloadingFromServer(true)); } @@ -114,7 +111,7 @@ public Scale scale(Scale scale) { @Override public Job scale(int count, boolean wait) { - Job res = cascading(false).edit().editSpec().withParallelism(count).endSpec().done(); + Job res = accept(b -> b.getSpec().setParallelism(count)); if (wait) { waitUntilJobIsScaled(); res = getMandatory(); @@ -169,14 +166,14 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> podOperationList = doGetLog(false); - for (PodResource podOperation : podOperationList) { + List> podOperationList = doGetLog(false); + for (PodResource podOperation : podOperationList) { stringBuilder.append(podOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog(boolean isPretty) { + private List> doGetLog(boolean isPretty) { Job job = fromServer().get(); return PodOperationUtil.getPodOperationsForController(context, job.getMetadata().getUid(), @@ -189,7 +186,7 @@ private List> doGetLog(boolean isPretty) { */ @Override public Reader getLogReader() { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -205,7 +202,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -215,7 +212,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new JobOperationsImpl(context, logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1beta1/CronJobOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1beta1/CronJobOperationsImpl.java index 0cec7cff167..b4834c2df31 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1beta1/CronJobOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1beta1/CronJobOperationsImpl.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.api.model.batch.CronJob; import io.fabric8.kubernetes.api.model.batch.CronJobList; -import io.fabric8.kubernetes.api.model.batch.DoneableCronJob; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.kubernetes.client.dsl.Resource; @@ -28,7 +27,7 @@ import java.io.InputStream; -public class CronJobOperationsImpl extends HasMetadataOperation> { +public class CronJobOperationsImpl extends HasMetadataOperation> { public CronJobOperationsImpl(OkHttpClient client, Config config) { this(client, config, null); @@ -45,7 +44,6 @@ public CronJobOperationsImpl(OperationContext context) { .withPlural("cronjobs")); this.type = CronJob.class; this.listType = CronJobList.class; - this.doneableType = DoneableCronJob.class; } @@ -55,7 +53,7 @@ public CronJobOperationsImpl newInstance(OperationContext context) { } @Override - public Resource load(InputStream is) { + public Resource load(InputStream is) { try { CronJob item = unmarshal(is, CronJob.class); return new CronJobOperationsImpl(context.withItem(item)); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/BindingOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/BindingOperationsImpl.java index c5af637bd19..7abd88930ff 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/BindingOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/BindingOperationsImpl.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.fabric8.kubernetes.api.model.Binding; -import io.fabric8.kubernetes.api.model.DoneableBinding; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.dsl.Resource; @@ -25,7 +24,7 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -public class BindingOperationsImpl extends HasMetadataOperation, DoneableBinding, Resource> { +public class BindingOperationsImpl extends HasMetadataOperation, Resource> { public BindingOperationsImpl(OkHttpClient client, Config config) { this(client, config, null); } @@ -40,7 +39,6 @@ public BindingOperationsImpl(OperationContext context) { .withPlural("bindings")); this.type = Binding.class; this.listType = (Class>)new TypeReference>(){}.getType(); - this.doneableType = DoneableBinding.class; } public BindingOperationsImpl newInstance(OperationContext context) { diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ComponentStatusOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ComponentStatusOperationsImpl.java index 5644dc46f20..cf592a62c87 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ComponentStatusOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ComponentStatusOperationsImpl.java @@ -21,12 +21,11 @@ import io.fabric8.kubernetes.api.model.ComponentStatus; import io.fabric8.kubernetes.api.model.ComponentStatusList; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; -public class ComponentStatusOperationsImpl extends HasMetadataOperation> { +public class ComponentStatusOperationsImpl extends HasMetadataOperation> { public ComponentStatusOperationsImpl(OkHttpClient client, Config config) { this(client, config, null); @@ -40,7 +39,6 @@ public ComponentStatusOperationsImpl(OperationContext context) { super(context.withPlural("componentstatuses")); this.type = ComponentStatus.class; this.listType = ComponentStatusList.class; - this.doneableType = DoneableComponentStatus.class; } @Override diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java index 776b74fe562..8b68c80dbbd 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java @@ -36,7 +36,6 @@ import java.util.concurrent.TimeUnit; import io.fabric8.kubernetes.api.model.DeleteOptions; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; import io.fabric8.kubernetes.api.model.policy.Eviction; @@ -81,7 +80,7 @@ import okhttp3.Response; import okhttp3.ResponseBody; -public class PodOperationsImpl extends HasMetadataOperation> implements PodResource,CopyOrReadable { +public class PodOperationsImpl extends HasMetadataOperation> implements PodResource,CopyOrReadable { public static final int HTTP_TOO_MANY_REQUESTS = 429; private static final Integer DEFAULT_POD_LOG_WAIT_TIMEOUT = 5; @@ -120,7 +119,6 @@ public PodOperationsImpl(PodOperationContext context) { super(context.withPlural("pods")); this.type = Pod.class; this.listType = PodList.class; - this.doneableType = DoneablePod.class; this.containerId = context.getContainerId(); this.in = context.getIn(); @@ -239,7 +237,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new PodOperationsImpl(getContext().withLogWaitTimeout(logWaitTimeout)); } @@ -314,7 +312,7 @@ private void handleEvict(URL podUrl, String namespace, String name) throws Execu } @Override - public ContainerResource inContainer(String containerId) { + public ContainerResource inContainer(String containerId) { return new PodOperationsImpl(getContext().withContainerId(containerId)); } @@ -676,28 +674,28 @@ public ExecListenable withTTY() { } @Override - public Loggable withPrettyOutput() { + public Loggable withPrettyOutput() { return new PodOperationsImpl(getContext().withPrettyOutput(true)); } @Override - public PrettyLoggable tailingLines(int withTailingLines) { + public PrettyLoggable tailingLines(int withTailingLines) { return new PodOperationsImpl(getContext().withTailingLines(withTailingLines)); } @Override - public TailPrettyLoggable sinceTime(String sinceTimestamp) { + public TailPrettyLoggable sinceTime(String sinceTimestamp) { return new PodOperationsImpl(getContext().withSinceTimestamp(sinceTimestamp)); } @Override - public TailPrettyLoggable sinceSeconds(int sinceSeconds) { + public TailPrettyLoggable sinceSeconds(int sinceSeconds) { return new PodOperationsImpl(getContext().withSinceSeconds(sinceSeconds)); } @Override - public TimeTailPrettyLoggable terminated() { + public TimeTailPrettyLoggable terminated() { return new PodOperationsImpl(getContext().withTerminatedStatus(true)); } @@ -707,12 +705,12 @@ public Execable usingListener(ExecListener execListener) { } @Override - public BytesLimitTerminateTimeTailPrettyLoggable limitBytes(int limitBytes) { + public BytesLimitTerminateTimeTailPrettyLoggable limitBytes(int limitBytes) { return new PodOperationsImpl(getContext().withLimitBytes(limitBytes)); } @Override - public BytesLimitTerminateTimeTailPrettyLoggable usingTimestamps() { + public BytesLimitTerminateTimeTailPrettyLoggable usingTimestamps() { return new PodOperationsImpl(getContext().withTimestamps(true)); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerOperationsImpl.java index ffb5d3bad5a..d5e2917a172 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerOperationsImpl.java @@ -16,8 +16,6 @@ package io.fabric8.kubernetes.client.dsl.internal.core.v1; import io.fabric8.kubernetes.api.model.Container; -import io.fabric8.kubernetes.api.model.DoneablePod; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.ReplicationController; import io.fabric8.kubernetes.api.model.ReplicationControllerList; @@ -47,8 +45,8 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -public class ReplicationControllerOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable { +public class ReplicationControllerOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { private Integer podLogWaitTimeout; public ReplicationControllerOperationsImpl(OkHttpClient client, Config config) { @@ -63,7 +61,6 @@ public ReplicationControllerOperationsImpl(RollingOperationContext context) { super(context.withPlural("replicationcontrollers")); this.type = ReplicationController.class; this.listType = ReplicationControllerList.class; - this.doneableType = DoneableReplicationController.class; } private ReplicationControllerOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -77,18 +74,18 @@ public ReplicationControllerOperationsImpl newInstance(OperationContext context) } @Override - public RollableScalableResource load(InputStream is) { + public RollableScalableResource load(InputStream is) { ReplicationController item = unmarshal(is, ReplicationController.class); return new ReplicationControllerOperationsImpl((RollingOperationContext) context.withItem(item)); } @Override public ReplicationController withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(r -> r.getSpec().setReplicas(count)); } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new ReplicationControllerRollingUpdater(client, config, namespace, rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @@ -157,12 +154,12 @@ public Status rollback(DeploymentRollback deploymentRollback) { } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new ReplicationControllerOperationsImpl(((RollingOperationContext)context).withRollingTimeout(unit.toMillis(timeout)).withRollingTimeUnit(TimeUnit.MILLISECONDS)); } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new ReplicationControllerOperationsImpl(((RollingOperationContext)context).withRollingTimeout(timeoutInMillis)); } @@ -172,14 +169,14 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> podOperationList = doGetLog(isPretty); - for (PodResource podOperation : podOperationList) { + List> podOperationList = doGetLog(isPretty); + for (PodResource podOperation : podOperationList) { stringBuilder.append(podOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog(boolean isPretty) { + private List> doGetLog(boolean isPretty) { ReplicationController rc = fromServer().get(); return PodOperationUtil.getPodOperationsForController(context, rc.getMetadata().getUid(), @@ -192,7 +189,7 @@ private List> doGetLog(boolean isPretty) { */ @Override public Reader getLogReader() { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -208,7 +205,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -218,7 +215,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new ReplicationControllerOperationsImpl((RollingOperationContext)context, logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerRollingUpdater.java index e701e9ba3b0..92966857b0a 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ReplicationControllerRollingUpdater.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.client.dsl.internal.apps.v1.RollingUpdater; import io.fabric8.kubernetes.client.dsl.internal.core.v1.ReplicationControllerOperationsImpl; import okhttp3.OkHttpClient; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; import io.fabric8.kubernetes.api.model.PodList; import io.fabric8.kubernetes.api.model.ReplicationController; import io.fabric8.kubernetes.api.model.ReplicationControllerBuilder; @@ -27,7 +26,7 @@ import io.fabric8.kubernetes.client.dsl.Operation; import io.fabric8.kubernetes.client.dsl.RollableScalableResource; -class ReplicationControllerRollingUpdater extends RollingUpdater { +class ReplicationControllerRollingUpdater extends RollingUpdater { ReplicationControllerRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -56,22 +55,30 @@ protected PodList listSelectedPods(ReplicationController obj) { return pods().inNamespace(namespace).withLabels(obj.getSpec().getSelector()).list(); } + @Override - protected void updateDeploymentKey(DoneableReplicationController obj, String hash) { - obj.editSpec() - .addToSelector(DEPLOYMENT_KEY, hash) - .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + protected ReplicationController updateDeploymentKey(String name, String hash) { + ReplicationController old = resources().inNamespace(namespace).withName(name).get(); + ReplicationController updated = new ReplicationControllerBuilder(old).editSpec() + .addToSelector(DEPLOYMENT_KEY, hash) + .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } @Override - protected void removeDeploymentKey(DoneableReplicationController obj) { - obj.editSpec() - .removeFromSelector(DEPLOYMENT_KEY) - .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + protected ReplicationController removeDeploymentKey(String name) { + ReplicationController old = resources().inNamespace(namespace).withName(name).get(); + ReplicationController updated = new ReplicationControllerBuilder(old).editSpec() + .removeFromSelector(DEPLOYMENT_KEY) + .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } + @Override protected int getReplicas(ReplicationController obj) { return obj.getSpec().getReplicas(); @@ -83,7 +90,7 @@ protected ReplicationController setReplicas(ReplicationController obj, int repli } @Override - protected Operation> resources() { + protected Operation> resources() { return new ReplicationControllerOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ServiceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ServiceOperationsImpl.java index a5f2fc58bde..ff2ad55a6fb 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ServiceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/ServiceOperationsImpl.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.dsl.internal.core.v1; -import io.fabric8.kubernetes.api.model.DoneableService; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.ServiceBuilder; import io.fabric8.kubernetes.api.model.ServiceList; @@ -34,7 +33,7 @@ import java.util.*; import java.util.concurrent.TimeUnit; -public class ServiceOperationsImpl extends HasMetadataOperation> implements ServiceResource { +public class ServiceOperationsImpl extends HasMetadataOperation> implements ServiceResource { public static final String EXTERNAL_NAME = "ExternalName"; @@ -50,7 +49,6 @@ public ServiceOperationsImpl(OperationContext context) { super(context.withPlural("services")); this.type = Service.class; this.listType = ServiceList.class; - this.doneableType = DoneableService.class; } @Override diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentOperationsImpl.java index 435389a1726..232fe785146 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentOperationsImpl.java @@ -21,8 +21,6 @@ import io.fabric8.kubernetes.api.model.extensions.Deployment; import io.fabric8.kubernetes.api.model.extensions.DeploymentList; import io.fabric8.kubernetes.api.model.extensions.DeploymentRollback; -import io.fabric8.kubernetes.api.model.extensions.DoneableDeployment; -import io.fabric8.kubernetes.api.model.extensions.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetList; import io.fabric8.kubernetes.client.Config; @@ -51,6 +49,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Function; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; @@ -60,8 +60,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -public class DeploymentOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable { +public class DeploymentOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { static final transient Logger LOG = LoggerFactory.getLogger(DeploymentOperationsImpl.class); public static final String DEPLOYMENT_KUBERNETES_IO_REVISION = "deployment.kubernetes.io/revision"; @@ -84,7 +84,6 @@ public DeploymentOperationsImpl(RollingOperationContext context) { .withPlural("deployments")); this.type = Deployment.class; this.listType = DeploymentList.class; - this.doneableType = DoneableDeployment.class; } private DeploymentOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -104,7 +103,7 @@ public Deployment scale(int count) { @Override public Deployment scale(int count, boolean wait) { - Deployment res = cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + Deployment res = cascading(false).accept(d -> d.getSpec().setReplicas(count)); if (wait) { waitUntilDeploymentIsScaled(count); res = getMandatory(); @@ -113,11 +112,19 @@ public Deployment scale(int count, boolean wait) { } @Override - public DoneableDeployment edit() { + public Deployment edit(Function function) { if (isCascading()) { - return cascading(false).edit(); + return cascading(false).edit(function); } - return super.edit(); + return super.edit(function); + } + + @Override + public Deployment accept(Consumer consumer) { + if (isCascading()) { + return cascading(false).accept(consumer); + } + return super.accept(consumer); } @Override @@ -147,13 +154,13 @@ public Status rollback(DeploymentRollback rollback) { } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new DeploymentRollingUpdater(client, config, getNamespace(), rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @Override public Deployment withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(d -> d.getSpec().setReplicas(count)); } @Override @@ -246,12 +253,12 @@ public Deployment undo() { } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new DeploymentOperationsImpl(((RollingOperationContext) context).withRollingTimeout(timeoutInMillis)); } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new DeploymentOperationsImpl(((RollingOperationContext) context).withRollingTimeUnit(unit)); } @@ -316,15 +323,15 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> rcList = doGetLog(); - for (RollableScalableResource rcOperation : rcList) { + List> rcList = doGetLog(); + for (RollableScalableResource rcOperation : rcList) { stringBuilder.append(rcOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog() { - List> rcs = new ArrayList<>(); + private List> doGetLog() { + List> rcs = new ArrayList<>(); Deployment deployment = fromServer().get(); String rcUid = deployment.getMetadata().getUid(); @@ -353,7 +360,7 @@ private List> doGetLog( */ @Override public Reader getLogReader() { - List> podResources = doGetLog(); + List> podResources = doGetLog(); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -369,7 +376,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(); + List> podResources = doGetLog(); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -379,7 +386,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new DeploymentOperationsImpl(((RollingOperationContext) context), logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentRollingUpdater.java index 90cf074ec5c..5ffa3322d03 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/DeploymentRollingUpdater.java @@ -21,7 +21,6 @@ import io.fabric8.kubernetes.api.model.extensions.Deployment; import io.fabric8.kubernetes.api.model.extensions.DeploymentBuilder; import io.fabric8.kubernetes.api.model.extensions.DeploymentList; -import io.fabric8.kubernetes.api.model.extensions.DoneableDeployment; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.Watch; import io.fabric8.kubernetes.client.Watcher; @@ -31,7 +30,7 @@ import io.fabric8.kubernetes.client.dsl.internal.apps.v1.RollingUpdater; import okhttp3.OkHttpClient; -class DeploymentRollingUpdater extends RollingUpdater { +class DeploymentRollingUpdater extends RollingUpdater { DeploymentRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -58,7 +57,7 @@ protected Deployment createClone(Deployment obj, String newName, String newDeplo @Override protected PodList listSelectedPods(Deployment obj) { - FilterWatchListDeletable podLister = pods().inNamespace(namespace); + FilterWatchListDeletable podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } @@ -82,20 +81,26 @@ protected PodList listSelectedPods(Deployment obj) { } return podLister.list(); } - @Override - protected void updateDeploymentKey(DoneableDeployment obj, String hash) { - obj.editSpec() - .editTemplate().editMetadata().addToAnnotations(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + protected Deployment updateDeploymentKey(String name, String hash) { + Deployment old = resources().inNamespace(namespace).withName(name).get(); + Deployment updated = new DeploymentBuilder(old).editSpec() + .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() + .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } @Override - protected void removeDeploymentKey(DoneableDeployment obj) { - obj.editSpec() - .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() - .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + protected Deployment removeDeploymentKey(String name) { + Deployment old = resources().inNamespace(namespace).withName(name).get(); + Deployment updated = new DeploymentBuilder(old).editSpec() + .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() + .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() + .endSpec() + .build(); + return resources().inNamespace(namespace).withName(name).replace(updated); } @Override @@ -109,7 +114,7 @@ protected Deployment setReplicas(Deployment obj, int replicas) { } @Override - protected Operation> resources() { + protected Operation> resources() { return new DeploymentOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetOperationsImpl.java index c2c800f3404..1b80a8191fe 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetOperationsImpl.java @@ -16,11 +16,9 @@ package io.fabric8.kubernetes.client.dsl.internal.extensions.v1beta1; import io.fabric8.kubernetes.api.model.Container; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.Status; import io.fabric8.kubernetes.api.model.extensions.DeploymentRollback; -import io.fabric8.kubernetes.api.model.extensions.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetList; import io.fabric8.kubernetes.client.Config; @@ -46,8 +44,8 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -public class ReplicaSetOperationsImpl extends RollableScalableResourceOperation> - implements TimeoutImageEditReplacePatchable { +public class ReplicaSetOperationsImpl extends RollableScalableResourceOperation> + implements TimeoutImageEditReplacePatchable { private Integer podLogWaitTimeout; @@ -65,7 +63,6 @@ public ReplicaSetOperationsImpl(RollingOperationContext context) { .withPlural("replicasets")); this.type = ReplicaSet.class; this.listType = ReplicaSetList.class; - this.doneableType = DoneableReplicaSet.class; } public ReplicaSetOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -138,11 +135,11 @@ public ReplicaSet undo() { @Override public ReplicaSet withReplicas(int count) { - return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + return cascading(false).accept(r -> r.getSpec().setReplicas(count)); } @Override - public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { + public RollingUpdater getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit) { return new ReplicaSetRollingUpdater(client, config, getNamespace(), rollingTimeUnit.toMillis(rollingTimeout), config.getLoggingInterval()); } @@ -173,12 +170,12 @@ public Status rollback(DeploymentRollback deploymentRollback) { } @Override - public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { + public ImageEditReplacePatchable withTimeout(long timeout, TimeUnit unit) { return new ReplicaSetOperationsImpl(((RollingOperationContext) context).withRollingTimeout(unit.toMillis(timeout)).withRollingTimeUnit(TimeUnit.MILLISECONDS)); } @Override - public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { + public ImageEditReplacePatchable withTimeoutInMillis(long timeoutInMillis) { return new ReplicaSetOperationsImpl(((RollingOperationContext) context).withRollingTimeout(timeoutInMillis)); } @@ -188,14 +185,14 @@ public String getLog() { public String getLog(Boolean isPretty) { StringBuilder stringBuilder = new StringBuilder(); - List> podOperationList = doGetLog(isPretty); - for (PodResource podOperation : podOperationList) { + List> podOperationList = doGetLog(isPretty); + for (PodResource podOperation : podOperationList) { stringBuilder.append(podOperation.getLog(isPretty)); } return stringBuilder.toString(); } - private List> doGetLog(boolean isPretty) { + private List> doGetLog(boolean isPretty) { ReplicaSet replicaSet = fromServer().get(); return PodOperationUtil.getPodOperationsForController(context, replicaSet.getMetadata().getUid(), getReplicaSetSelectorLabels(replicaSet), isPretty, podLogWaitTimeout); @@ -207,7 +204,7 @@ private List> doGetLog(boolean isPretty) { */ @Override public Reader getLogReader() { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Reading logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -223,7 +220,7 @@ public LogWatch watchLog() { @Override public LogWatch watchLog(OutputStream out) { - List> podResources = doGetLog(false); + List> podResources = doGetLog(false); if (podResources.size() > 1) { throw new KubernetesClientException("Watching logs is not supported for multicontainer jobs"); } else if (podResources.size() == 1) { @@ -233,7 +230,7 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new ReplicaSetOperationsImpl(((RollingOperationContext) context), logWaitTimeout); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetRollingUpdater.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetRollingUpdater.java index 82ed5b86373..23b381ecaff 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetRollingUpdater.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/extensions/v1beta1/ReplicaSetRollingUpdater.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.api.model.LabelSelectorRequirement; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.extensions.DoneableReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetBuilder; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetList; @@ -31,7 +30,7 @@ import io.fabric8.kubernetes.client.dsl.internal.apps.v1.RollingUpdater; import okhttp3.OkHttpClient; -class ReplicaSetRollingUpdater extends RollingUpdater { +class ReplicaSetRollingUpdater extends RollingUpdater { ReplicaSetRollingUpdater(OkHttpClient client, Config config, String namespace) { super(client, config, namespace); @@ -58,7 +57,7 @@ protected ReplicaSet createClone(ReplicaSet obj, String newName, String newDeplo @Override protected PodList listSelectedPods(ReplicaSet obj) { - FilterWatchListDeletable podLister = pods().inNamespace(namespace); + FilterWatchListDeletable podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } @@ -84,19 +83,23 @@ protected PodList listSelectedPods(ReplicaSet obj) { } @Override - protected void updateDeploymentKey(DoneableReplicaSet obj, String hash) { - obj.editSpec() + protected ReplicaSet updateDeploymentKey(String name, String hash) { + return resources().inNamespace(namespace).withName(name).edit(r -> new ReplicaSetBuilder(r) + .editSpec() .editSelector().addToMatchLabels(DEPLOYMENT_KEY, hash).endSelector() .editTemplate().editMetadata().addToLabels(DEPLOYMENT_KEY, hash).endMetadata().endTemplate() - .endSpec(); + .endSpec() + .build()); } @Override - protected void removeDeploymentKey(DoneableReplicaSet obj) { - obj.editSpec() + protected ReplicaSet removeDeploymentKey(String name) { + return resources().inNamespace(namespace).withName(name).edit(r -> new ReplicaSetBuilder(r) + .editSpec() .editSelector().removeFromMatchLabels(DEPLOYMENT_KEY).endSelector() .editTemplate().editMetadata().removeFromLabels(DEPLOYMENT_KEY).endMetadata().endTemplate() - .endSpec(); + .endSpec() + .build()); } @Override @@ -110,7 +113,7 @@ protected ReplicaSet setReplicas(ReplicaSet obj, int replicas) { } @Override - protected Operation> resources() { + protected Operation> resources() { return new ReplicaSetOperationsImpl(client, config); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLock.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLock.java index d73d820f059..9476e1855d2 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLock.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLock.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.ConfigMap; +import io.fabric8.kubernetes.api.model.ConfigMapBuilder; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.dsl.Namespaceable; @@ -79,11 +80,11 @@ public & KubernetesClient> void create( C client, LeaderElectionRecord leaderElectionRecord) throws LockException { try { - client.inNamespace(configMapNamespace).configMaps().withName(configMapName).createNew() + client.inNamespace(configMapNamespace).configMaps().withName(configMapName).create(new ConfigMapBuilder() .editOrNewMetadata().withNamespace(configMapNamespace).withName(configMapName) .addToAnnotations(LEADER_ELECTION_RECORD_ANNOTATION_KEY, objectMapper.writeValueAsString(leaderElectionRecord)) .endMetadata() - .done(); + .build()); } catch (Exception e) { throw new LockException("Unable to create ConfigMapLock", e); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLock.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLock.java index e02e2443427..ba8f9954439 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLock.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLock.java @@ -16,6 +16,7 @@ package io.fabric8.kubernetes.client.extended.leaderelection.resourcelock; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; +import io.fabric8.kubernetes.api.model.coordination.v1.LeaseBuilder; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.dsl.Namespaceable; @@ -66,7 +67,7 @@ public & KubernetesClient> void create( C client, LeaderElectionRecord leaderElectionRecord) throws LockException { try { - client.inNamespace(leaseNamespace).leases().withName(leaseName).createNew() + client.inNamespace(leaseNamespace).leases().withName(leaseName).create(new LeaseBuilder() .withNewMetadata().withNamespace(leaseNamespace).withName(leaseName).endMetadata() .withNewSpec() .withHolderIdentity(leaderElectionRecord.getHolderIdentity()) @@ -75,7 +76,7 @@ public & KubernetesClient> void create( .withRenewTime(leaderElectionRecord.getRenewTime()) .withLeaseTransitions(leaderElectionRecord.getLeaderTransitions()) .endSpec() - .done(); + .build()); } catch (Exception e) { throw new LockException("Unable to create LeaseLock", e); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/SharedInformerFactory.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/SharedInformerFactory.java index e875dbbf7d1..7e976303ec4 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/SharedInformerFactory.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/SharedInformerFactory.java @@ -164,14 +164,14 @@ private > ListerWatch return new ListerWatcher() { @Override public L list(ListOptions params, String namespace, OperationContext context) { - BaseOperation listBaseOperation = getConfiguredBaseOperation(namespace, context, apiTypeClass, apiListTypeClass); + BaseOperation listBaseOperation = getConfiguredBaseOperation(namespace, context, apiTypeClass, apiListTypeClass); return listBaseOperation.list(); } @Override public Watch watch(ListOptions params, String namespace, OperationContext context, Watcher resourceWatcher) { - BaseOperation watchBaseOperation = getConfiguredBaseOperation(namespace, context, apiTypeClass, apiListTypeClass); + BaseOperation watchBaseOperation = getConfiguredBaseOperation(namespace, context, apiTypeClass, apiListTypeClass); // Register Custom Kind in case of CustomResource if (context.getApiGroupName() != null && context.getApiGroupVersion() != null) { @@ -242,8 +242,8 @@ public void addSharedInformerEventListener(SharedInformerEventListener event) { this.eventListeners.add(event); } - private > BaseOperation getConfiguredBaseOperation(String namespace, OperationContext context, Class apiTypeClass, Class apiListTypeClass) { - BaseOperation baseOperationWithContext; + private > BaseOperation getConfiguredBaseOperation(String namespace, OperationContext context, Class apiTypeClass, Class apiListTypeClass) { + BaseOperation baseOperationWithContext; // Avoid adding Namespace if it's picked from Global Configuration if (context.isNamespaceFromGlobalConfig()) { // SharedInformer default behavior is to watch in all namespaces diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java index 85ac04be2d7..1adedf512d1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java @@ -23,24 +23,6 @@ import io.fabric8.kubernetes.api.model.ComponentStatusList; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.Doneable; -import io.fabric8.kubernetes.api.model.DoneableAPIService; -import io.fabric8.kubernetes.api.model.DoneableBinding; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; -import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.DoneableEvent; -import io.fabric8.kubernetes.api.model.DoneableLimitRange; -import io.fabric8.kubernetes.api.model.DoneableNamespace; -import io.fabric8.kubernetes.api.model.DoneableNode; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolume; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; -import io.fabric8.kubernetes.api.model.DoneablePod; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; -import io.fabric8.kubernetes.api.model.DoneableResourceQuota; -import io.fabric8.kubernetes.api.model.DoneableSecret; -import io.fabric8.kubernetes.api.model.DoneableService; -import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; import io.fabric8.kubernetes.api.model.Event; @@ -71,16 +53,11 @@ import io.fabric8.kubernetes.api.model.ServiceList; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequest; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequestList; -import io.fabric8.kubernetes.api.model.certificates.DoneableCertificateSigningRequest; -import io.fabric8.kubernetes.api.model.authentication.DoneableTokenReview; import io.fabric8.kubernetes.api.model.authentication.TokenReview; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; -import io.fabric8.kubernetes.api.model.node.v1beta1.DoneableRuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClassList; import io.fabric8.kubernetes.client.Adapters; @@ -256,80 +233,80 @@ public void deactivate() { delegate.close(); } - public MixedOperation> componentstatuses() { + public MixedOperation> componentstatuses() { return delegate.componentstatuses(); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { return delegate.load(is); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { return delegate.resourceList(is); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { return delegate.resourceList(items); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { return delegate.resourceList(items); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { return delegate.resourceList(s); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata is) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata is) { return delegate.resource(is); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { return delegate.resource(s); } - public MixedOperation> endpoints() { + public MixedOperation> endpoints() { return delegate.endpoints(); } - public MixedOperation, DoneableBinding, Resource> bindings() { + public MixedOperation, Resource> bindings() { return delegate.bindings(); } - public MixedOperation> pods() { + public MixedOperation> pods() { return delegate.pods(); } - public MixedOperation> services() { + public MixedOperation> services() { return delegate.services(); } - public NonNamespaceOperation> namespaces() { + public NonNamespaceOperation> namespaces() { return delegate.namespaces(); } - public MixedOperation> serviceAccounts() { + public MixedOperation> serviceAccounts() { return delegate.serviceAccounts(); } @Override - public MixedOperation> apiServices() { + public MixedOperation> apiServices() { return delegate.apiServices(); } - public NonNamespaceOperation> persistentVolumes() { + public NonNamespaceOperation> persistentVolumes() { return delegate.persistentVolumes(); } - public MixedOperation> resourceQuotas() { + public MixedOperation> resourceQuotas() { return delegate.resourceQuotas(); } @@ -338,32 +315,32 @@ public KubernetesListMixedOperation lists() { } @Override - public MixedOperation> configMaps() { + public MixedOperation> configMaps() { return delegate.configMaps(); } @Override - public MixedOperation> limitRanges() { + public MixedOperation> limitRanges() { return delegate.limitRanges(); } - public NonNamespaceOperation> nodes() { + public NonNamespaceOperation> nodes() { return delegate.nodes(); } - public MixedOperation> persistentVolumeClaims() { + public MixedOperation> persistentVolumeClaims() { return delegate.persistentVolumeClaims(); } - public MixedOperation> events() { + public MixedOperation> events() { return delegate.events(); } - public MixedOperation> replicationControllers() { + public MixedOperation> replicationControllers() { return delegate.replicationControllers(); } - public MixedOperation> secrets() { + public MixedOperation> secrets() { return delegate.secrets(); } @@ -428,7 +405,7 @@ public AutoscalingAPIGroupDSL autoscaling() { public RbacAPIGroupDSL rbac() { return delegate.rbac(); } @Override - public NonNamespaceOperation> customResourceDefinitions() { + public NonNamespaceOperation> customResourceDefinitions() { return delegate.customResourceDefinitions(); } @@ -438,7 +415,7 @@ public ApiextensionsAPIGroupDSL apiextensions() { } @Override - public NonNamespaceOperation> certificateSigningRequests() { + public NonNamespaceOperation> certificateSigningRequests() { return delegate.certificateSigningRequests(); } @@ -448,23 +425,23 @@ public AuthorizationAPIGroupDSL authorization() { } @Override - public Createable tokenReviews() { + public Createable tokenReviews() { return delegate.tokenReviews(); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass, Class doneClass) { - return delegate.customResources(crdContext, resourceType, listClass, doneClass); + public > MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass) { + return delegate.customResources(crdContext, resourceType, listClass); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return delegate.customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return delegate.customResources(crd, resourceType, listClass); } @Override - public , D extends Doneable> MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return customResources(crd, resourceType, listClass); } @Override @@ -488,7 +465,7 @@ public LeaderElectorBuilder leaderElector() { } @Override - public MixedOperation> leases() { + public MixedOperation> leases() { return delegate.leases(); } @@ -569,7 +546,7 @@ public RunOperations run() { } @Override - public NonNamespaceOperation> runtimeClasses() { + public NonNamespaceOperation> runtimeClasses() { return delegate.runtimeClasses(); } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/PodOperationUtil.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/PodOperationUtil.java index 524215bd6e9..bf7356486e8 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/PodOperationUtil.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/PodOperationUtil.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.utils; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.OwnerReference; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; @@ -43,8 +42,8 @@ private PodOperationUtil() { } * @param controllerUid UID of Controller * @return returns list of PodOperations with pods whose owner's UID is of the provided controller */ - public static List> getFilteredPodsForLogs(PodOperationsImpl podOperations, PodList controllerPodList, String controllerUid) { - List> pods = new ArrayList<>(); + public static List> getFilteredPodsForLogs(PodOperationsImpl podOperations, PodList controllerPodList, String controllerUid) { + List> pods = new ArrayList<>(); for (Pod pod : controllerPodList.getItems()) { OwnerReference ownerReference = KubernetesResourceUtil.getControllerUid(pod); if (ownerReference != null && ownerReference.getUid().equals(controllerUid)) { @@ -65,17 +64,17 @@ public static PodOperationsImpl getGenericPodOperations(OperationContext context null, isPretty, null, null, null, null, null, podLogWaitTimeout)); } - public static List> getPodOperationsForController(OperationContext context, String controllerUid, Map selectorLabels, boolean isPretty, Integer podLogWaitTimeout) { + public static List> getPodOperationsForController(OperationContext context, String controllerUid, Map selectorLabels, boolean isPretty, Integer podLogWaitTimeout) { return getPodOperationsForController(PodOperationUtil.getGenericPodOperations(context, isPretty, podLogWaitTimeout), controllerUid, selectorLabels); } - static List> getPodOperationsForController(PodOperationsImpl podOperations, String controllerUid, Map selectorLabels) { + static List> getPodOperationsForController(PodOperationsImpl podOperations, String controllerUid, Map selectorLabels) { PodList controllerPodList = podOperations.withLabels(selectorLabels).list(); return PodOperationUtil.getFilteredPodsForLogs(podOperations, controllerPodList, controllerUid); } - public static void waitUntilReadyBeforeFetchingLogs(PodResource podOperation, Integer logWaitTimeout) { + public static void waitUntilReadyBeforeFetchingLogs(PodResource podOperation, Integer logWaitTimeout) { try { // Wait for Pod to become ready Pod pod = podOperation.fromServer().get(); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java index 2bef259e98e..3de30393951 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java @@ -36,6 +36,7 @@ public class ReplaceValueStream { * @param is {@link InputStream} inputstream for * @param valuesMap a hashmap containing parameters * @return returns stream with template parameter expressions replaced + * @throws IOException in case of any network/object parse problems */ public static InputStream replaceValues(InputStream is, Map valuesMap) throws IOException { return new ReplaceValueStream(valuesMap).createInputStream(is); diff --git a/kubernetes-client/src/main/resources/resource-operation.vm b/kubernetes-client/src/main/resources/resource-operation.vm index 81fdc0bcce1..d904d7f06dd 100644 --- a/kubernetes-client/src/main/resources/resource-operation.vm +++ b/kubernetes-client/src/main/resources/resource-operation.vm @@ -47,16 +47,14 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, Config config) { this(client, config, null); @@ -72,7 +70,6 @@ public class ${model.name}OperationsImpl extends HasMetadataOperation<${model.na .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) { diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java index b9e2a89fa21..5df2b6eeda6 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/dsl/base/BaseOperationTest.java @@ -29,7 +29,6 @@ import java.util.Map; import io.fabric8.kubernetes.api.model.DeletionPropagation; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.ListOptionsBuilder; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; @@ -89,7 +88,7 @@ void testDefaultGracePeriod() { @Test void testChainingGracePeriodAndPropagationPolicy() { final BaseOperation operation = new BaseOperation(new OperationContext()); - EditReplacePatchDeletable operationWithPropagationPolicy = operation.withPropagationPolicy(DeletionPropagation.FOREGROUND); + EditReplacePatchDeletable operationWithPropagationPolicy = operation.withPropagationPolicy(DeletionPropagation.FOREGROUND); assertThat(operationWithPropagationPolicy, is(notNullValue())); assertNotNull(operationWithPropagationPolicy.withGracePeriod(10)); } @@ -98,7 +97,7 @@ void testChainingGracePeriodAndPropagationPolicy() { void testListOptions() throws MalformedURLException { // Given URL url = new URL("https://172.17.0.2:8443/api/v1/namespaces/default/pods"); - final BaseOperation> operation = new BaseOperation<>(new OperationContext()); + final BaseOperation> operation = new BaseOperation<>(new OperationContext()); // When and Then assertEquals(URLUtils.join(url.toString(), "?limit=5"), diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLockTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLockTest.java index 1d47919ad03..97221302a00 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLockTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLockTest.java @@ -16,8 +16,8 @@ package io.fabric8.kubernetes.client.extended.leaderelection.resourcelock; import io.fabric8.kubernetes.api.model.ConfigMap; +import io.fabric8.kubernetes.api.model.ConfigMapBuilder; import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.dsl.MixedOperation; @@ -49,25 +49,24 @@ class ConfigMapLockTest { private DefaultKubernetesClient kc; - private MixedOperation> configMaps; - private DoneableConfigMap doneableConfigMap; - private DoneableConfigMap.MetadataNested metadata; + private MixedOperation> configMaps; + private ConfigMapBuilder configMapBuilder; + private ConfigMapBuilder.MetadataNested metadata; @BeforeEach void setUp() { kc = mock(DefaultKubernetesClient.class, Answers.RETURNS_DEEP_STUBS); configMaps = mock(MixedOperation.class, Answers.RETURNS_DEEP_STUBS); - doneableConfigMap = mock(DoneableConfigMap.class, Answers.RETURNS_DEEP_STUBS); - metadata = mock(DoneableConfigMap.MetadataNested.class, Answers.RETURNS_DEEP_STUBS); + configMapBuilder = mock(ConfigMapBuilder.class, Answers.RETURNS_DEEP_STUBS); + metadata = mock(ConfigMapBuilder.MetadataNested.class, Answers.RETURNS_DEEP_STUBS); when(kc.inNamespace(anyString()).configMaps()).thenReturn(configMaps); - when(configMaps.withName(anyString()).createNew()).thenReturn(doneableConfigMap); - when(doneableConfigMap.editOrNewMetadata()).thenReturn(metadata); + when(configMapBuilder.editOrNewMetadata()).thenReturn(metadata); } @AfterEach void tearDown() { metadata = null; - doneableConfigMap = null; + configMapBuilder = null; configMaps = null; kc = null; } @@ -125,21 +124,20 @@ void createWithValidLeaderElectionRecordShouldSendPostRequest() throws Exception .withNamespace("namespace") .withName("name") .addToAnnotations(eq("control-plane.alpha.kubernetes.io/leader"), anyString()).endMetadata() - ).thenReturn(doneableConfigMap); + ).thenReturn(configMapBuilder); final LeaderElectionRecord record = new LeaderElectionRecord( "1", Duration.ofSeconds(1), ZonedDateTime.now(), ZonedDateTime.now(), 0); final ConfigMapLock lock = new ConfigMapLock("namespace", "name", "1337"); // When lock.create(kc, record); // Then - verify(doneableConfigMap, times(1)).done(); } @Test void updateWithValidLeaderElectionRecordShouldSendPutRequest() throws Exception { // Given - final Resource configMapResource = configMaps.withName("name"); - final Replaceable replaceable = mock(Replaceable.class, Answers.RETURNS_DEEP_STUBS); + final Resource configMapResource = configMaps.withName("name"); + final Replaceable replaceable = mock(Replaceable.class, Answers.RETURNS_DEEP_STUBS); when(configMapResource.lockResourceVersion(any())).thenReturn(replaceable); final ConfigMap configMapInTheCluster = new ConfigMap(); configMapInTheCluster.setMetadata(new ObjectMetaBuilder().withAnnotations(new HashMap<>()).build()); diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLockTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLockTest.java index 2cf9fa8acd1..57342f45bdd 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLockTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/extended/leaderelection/resourcelock/LeaseLockTest.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.extended.leaderelection.resourcelock; import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseBuilder; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; @@ -49,22 +48,21 @@ class LeaseLockTest { private DefaultKubernetesClient kc; - private MixedOperation> leases; - private DoneableLease doneableLease; - private DoneableLease.MetadataNested metadata; - private DoneableLease.SpecNested spec; + private MixedOperation> leases; + private LeaseBuilder leaserBuilder; + private LeaseBuilder.MetadataNested metadata; + private LeaseBuilder.SpecNested spec; @BeforeEach void setUp() { kc = mock(DefaultKubernetesClient.class, Answers.RETURNS_DEEP_STUBS); leases = mock(MixedOperation.class, Answers.RETURNS_DEEP_STUBS); - doneableLease = mock(DoneableLease.class, Answers.RETURNS_DEEP_STUBS); - metadata = mock(DoneableLease.MetadataNested.class, Answers.RETURNS_DEEP_STUBS); - spec = mock(DoneableLease.SpecNested.class, Answers.RETURNS_DEEP_STUBS); + leaserBuilder = mock(LeaseBuilder.class, Answers.RETURNS_DEEP_STUBS); + metadata = mock(LeaseBuilder.MetadataNested.class, Answers.RETURNS_DEEP_STUBS); + spec = mock(LeaseBuilder.SpecNested.class, Answers.RETURNS_DEEP_STUBS); when(kc.inNamespace(anyString()).leases()).thenReturn(leases); - when(leases.withName(anyString()).createNew()).thenReturn(doneableLease); - when(doneableLease.withNewMetadata()).thenReturn(metadata); - when(doneableLease.withNewSpec()).thenReturn(spec); + when(leaserBuilder.withNewMetadata()).thenReturn(metadata); + when(leaserBuilder.withNewSpec()).thenReturn(spec); } @Test void missingNamespaceShouldThrowException() { @@ -116,7 +114,7 @@ void getWithExistingLeaseShouldReturnLeaderElectionRecord() { @Test void createWithValidLeaderElectionRecordShouldSendPostRequest() throws Exception { // Given - when(metadata.withNamespace("namespace").withName("name").endMetadata()).thenReturn(doneableLease); + when(metadata.withNamespace("namespace").withName("name").endMetadata()).thenReturn(leaserBuilder); when(spec .withHolderIdentity(eq("1")) .withLeaseDurationSeconds(eq(1)) @@ -124,21 +122,20 @@ void createWithValidLeaderElectionRecordShouldSendPostRequest() throws Exception .withRenewTime(any()) .withLeaseTransitions(anyInt()) .endSpec() - ).thenReturn(doneableLease); + ).thenReturn(leaserBuilder); final LeaderElectionRecord record = new LeaderElectionRecord( "1", Duration.ofSeconds(1), ZonedDateTime.now(), ZonedDateTime.now(), 0); final LeaseLock lock = new LeaseLock("namespace", "name", "1337"); // When lock.create(kc, record); // Then - verify(doneableLease, times(1)).done(); } @Test void updateWithValidLeaderElectionRecordShouldSendPutRequest() throws Exception { // Given - final Resource leaseResource = leases.withName("name"); - final Replaceable replaceable = mock(Replaceable.class, Answers.RETURNS_DEEP_STUBS); + final Resource leaseResource = leases.withName("name"); + final Replaceable replaceable = mock(Replaceable.class, Answers.RETURNS_DEEP_STUBS); when(leaseResource.lockResourceVersion(any())).thenReturn(replaceable); final Lease leaseInTheCluster = new Lease(); leaseInTheCluster.setSpec(new LeaseSpec()); diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/PodOperationUtilTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/PodOperationUtilTest.java index 7f231931bcf..602129a741c 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/PodOperationUtilTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/PodOperationUtilTest.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.utils; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.ListOptions; import io.fabric8.kubernetes.api.model.ObjectReference; @@ -68,7 +67,7 @@ void testGetFilteredPodsForLogs() { PodList podList = getMockPodList(controllerUid); // When - List> podResourceList = PodOperationUtil.getFilteredPodsForLogs(podOperations, podList, controllerUid); + List> podResourceList = PodOperationUtil.getFilteredPodsForLogs(podOperations, podList, controllerUid); // Then assertNotNull(podResourceList); @@ -109,11 +108,11 @@ void testGetPodOperationsForController() { // Given String controllerUid = "some-uid"; Map selectorLabels = Collections.singletonMap("foo", "bar"); - FilterWatchListDeletable filterWatchListDeletable = getMockPodFilterOperation(controllerUid); + FilterWatchListDeletable filterWatchListDeletable = getMockPodFilterOperation(controllerUid); when(podOperations.withLabels(any())).thenReturn(filterWatchListDeletable); // When - List> podResources = PodOperationUtil.getPodOperationsForController(podOperations, controllerUid, selectorLabels); + List> podResources = PodOperationUtil.getPodOperationsForController(podOperations, controllerUid, selectorLabels); // Then assertNotNull(podResources); @@ -136,55 +135,55 @@ private PodList getMockPodList(String controllerUid) { .build(); } - private FilterWatchListDeletable getMockPodFilterOperation(String controllerUid) { - return new FilterWatchListDeletable() { + private FilterWatchListDeletable getMockPodFilterOperation(String controllerUid) { + return new FilterWatchListDeletable() { @Override - public Deletable withGracePeriod(long gracePeriodSeconds) { return null; } + public Deletable withGracePeriod(long gracePeriodSeconds) { return null; } @Override public Boolean delete() { return null; } @Override - public FilterWatchListDeletable withLabels(Map labels) { return null; } + public FilterWatchListDeletable withLabels(Map labels) { return null; } @Override - public FilterWatchListDeletable withoutLabels(Map labels) { return null; } + public FilterWatchListDeletable withoutLabels(Map labels) { return null; } @Override - public FilterWatchListDeletable withLabelIn(String key, String... values) { return null; } + public FilterWatchListDeletable withLabelIn(String key, String... values) { return null; } @Override - public FilterWatchListDeletable withLabelNotIn(String key, String... values) { return null; } + public FilterWatchListDeletable withLabelNotIn(String key, String... values) { return null; } @Override - public FilterWatchListDeletable withLabel(String key, String value) { return null; } + public FilterWatchListDeletable withLabel(String key, String value) { return null; } @Override - public FilterWatchListDeletable withLabel(String key) { return null; } + public FilterWatchListDeletable withLabel(String key) { return null; } @Override - public FilterWatchListDeletable withoutLabel(String key, String value) { return null; } + public FilterWatchListDeletable withoutLabel(String key, String value) { return null; } @Override - public FilterWatchListDeletable withoutLabel(String key) { return null; } + public FilterWatchListDeletable withoutLabel(String key) { return null; } @Override - public FilterWatchListDeletable withFields(Map labels) { return null; } + public FilterWatchListDeletable withFields(Map labels) { return null; } @Override - public FilterWatchListDeletable withField(String key, String value) { return null; } + public FilterWatchListDeletable withField(String key, String value) { return null; } @Override - public FilterWatchListDeletable withoutFields(Map fields) { return null; } + public FilterWatchListDeletable withoutFields(Map fields) { return null; } @Override - public FilterWatchListDeletable withoutField(String key, String value) { return null; } + public FilterWatchListDeletable withoutField(String key, String value) { return null; } @Override - public FilterWatchListDeletable withLabelSelector(LabelSelector selector) { return null; } + public FilterWatchListDeletable withLabelSelector(LabelSelector selector) { return null; } @Override - public FilterWatchListDeletable withInvolvedObject(ObjectReference objectReference) { return null; } + public FilterWatchListDeletable withInvolvedObject(ObjectReference objectReference) { return null; } @Override public PodList list() { return getMockPodList(controllerUid); } @@ -199,7 +198,7 @@ private FilterWatchListDeletable getMockPodFilterO public Pod updateStatus(Pod item) { return null; } @Override - public WatchAndWaitable withResourceVersion(String resourceVersion) { return null; } + public WatchAndWaitable withResourceVersion(String resourceVersion) { return null; } @Override public Pod waitUntilReady(long amount, TimeUnit timeUnit) { return null; } diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDExample.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDExample.java index 51d1d5f3b70..8a8000b5bde 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDExample.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CRDExample.java @@ -28,7 +28,6 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.kubernetes.examples.crds.DoneableDummy; import io.fabric8.kubernetes.examples.crds.Dummy; import io.fabric8.kubernetes.examples.crds.DummyList; import io.fabric8.kubernetes.examples.crds.DummySpec; @@ -132,9 +131,9 @@ public static void main(String[] args) { KubernetesDeserializer.registerCustomKind(DUMMY_CRD_GROUP + "/v1", "Dummy", Dummy.class); // lets create a client for the CRD - NonNamespaceOperation> dummyClient = client.customResources(dummyCRD, Dummy.class, DummyList.class, DoneableDummy.class); + NonNamespaceOperation> dummyClient = client.customResources(dummyCRD, Dummy.class, DummyList.class); if (resourceNamespaced) { - dummyClient = ((MixedOperation>) dummyClient).inNamespace(namespace); + dummyClient = ((MixedOperation>) dummyClient).inNamespace(namespace); } CustomResourceList dummyList = dummyClient.list(); List items = dummyList.getItems(); diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ConfigMapExample.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ConfigMapExample.java index 965054f1cf5..3e384032c29 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ConfigMapExample.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ConfigMapExample.java @@ -17,7 +17,6 @@ import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; import io.fabric8.kubernetes.client.DefaultKubernetesClient; @@ -48,7 +47,7 @@ public static void main(String[] args) throws InterruptedException { String name = "cheese"; try { - Resource configMapResource = client.configMaps().inNamespace(namespace).withName(name); + Resource configMapResource = client.configMaps().inNamespace(namespace).withName(name); ConfigMap configMap = configMapResource.createOrReplace(new ConfigMapBuilder(). diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CreatePod.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CreatePod.java index c3731a87b0e..f7c21fcb68a 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CreatePod.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/CreatePod.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.examples; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodList; @@ -73,7 +72,7 @@ public static void main(String[] args) { if (resource instanceof Pod){ Pod pod = (Pod) resource; System.out.println("Creating pod in namespace " + namespace); - NonNamespaceOperation> pods = client.pods().inNamespace(namespace); + NonNamespaceOperation> pods = client.pods().inNamespace(namespace); Pod result = pods.create(pod); System.out.println("Created pod " + result.getMetadata().getName()); } else { diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java index 07985d3606e..614fea88379 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java @@ -23,6 +23,7 @@ import io.fabric8.kubernetes.api.model.ResourceQuota; import io.fabric8.kubernetes.api.model.ResourceQuotaBuilder; import io.fabric8.kubernetes.api.model.Status; +import io.fabric8.kubernetes.api.model.ServiceBuilder; import io.fabric8.kubernetes.client.APIGroupNotAvailableException; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; @@ -98,7 +99,7 @@ public void onClose(KubernetesClientException e) { log("Created RC", client.replicationControllers().inNamespace("thisisatest").create(rc)); log("Created RC with inline DSL", - client.replicationControllers().inNamespace("thisisatest").createNew() + client.replicationControllers().inNamespace("thisisatest").create(new ReplicationControllerBuilder() .withNewMetadata().withName("nginx2-controller").addToLabels("server", "nginx").endMetadata() .withNewSpec().withReplicas(0) .withNewTemplate() @@ -109,7 +110,7 @@ public void onClose(KubernetesClientException e) { .endContainer() .endSpec() .endTemplate() - .endSpec().done()); + .endSpec().build())); // Get the RC by name in namespace ReplicationController gotRc = client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").get(); @@ -129,20 +130,20 @@ public void onClose(KubernetesClientException e) { // Get the RC by label in namespace log("Get RC by label in namespace", client.replicationControllers().inNamespace("thisisatest").withLabel("server", "nginx").list()); // Update the RC - client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").cascading(false).edit().editMetadata().addToLabels("new", "label").endMetadata().done(); + client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").cascading(false).edit(r -> new ReplicationControllerBuilder(r).editMetadata().addToLabels("new", "label").endMetadata().build()); client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").scale(8); Thread.sleep(1000); // Update the RC - change the image to apache - client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").edit().editSpec().editTemplate().withNewSpec() + client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").edit(r -> new ReplicationControllerBuilder(r).editSpec().editTemplate().withNewSpec() .addNewContainer().withName("nginx").withImage("httpd") .addNewPort().withContainerPort(80).endPort() .endContainer() .endSpec() .endTemplate() - .endSpec().done(); + .endSpec().build()); Thread.sleep(1000); @@ -158,11 +159,11 @@ public void onClose(KubernetesClientException e) { Thread.sleep(1000); //Update the RC inline - client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").edit() + client.replicationControllers().inNamespace("thisisatest").withName("nginx-controller").edit(r -> new ReplicationControllerBuilder(r) .editMetadata() .addToLabels("another", "label") .endMetadata() - .done(); + .build()); log("Updated RC"); // Clean up the RC @@ -171,7 +172,7 @@ public void onClose(KubernetesClientException e) { log("Deleted RCs"); //Create another RC inline - client.replicationControllers().inNamespace("thisisatest").createNew().withNewMetadata().withName("nginx-controller").addToLabels("server", "nginx").endMetadata() + client.replicationControllers().inNamespace("thisisatest").create(new ReplicationControllerBuilder().withNewMetadata().withName("nginx-controller").addToLabels("server", "nginx").endMetadata() .withNewSpec().withReplicas(3) .withNewTemplate() .withNewMetadata().addToLabels("server", "nginx").endMetadata() @@ -181,7 +182,7 @@ public void onClose(KubernetesClientException e) { .endContainer() .endSpec() .endTemplate() - .endSpec().done(); + .endSpec().build()); log("Created inline RC"); Thread.sleep(1000); @@ -198,13 +199,13 @@ public void onClose(KubernetesClientException e) { log("Deleted RC by field"); log("Created service", - client.services().inNamespace("thisisatest").createNew() + client.services().inNamespace("thisisatest").create(new ServiceBuilder() .withNewMetadata().withName("testservice").endMetadata() .withNewSpec() .addNewPort().withPort(80).withNewTargetPort().withIntVal(80).endTargetPort().endPort() .endSpec() - .done()); - log("Updated service", client.services().inNamespace("thisisatest").withName("testservice").edit().editMetadata().addToLabels("test", "label").endMetadata().done()); + .build())); + log("Updated service", client.services().inNamespace("thisisatest").withName("testservice").edit(s -> new ServiceBuilder(s).editMetadata().addToLabels("test", "label").endMetadata().build())); client.replicationControllers().inNamespace("thisisatest").withField("metadata.name", "testservice").delete(); log("Deleted service by field"); diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ReplaceExamples.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ReplaceExamples.java index eeeeffed9e7..ef5013a4a84 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ReplaceExamples.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ReplaceExamples.java @@ -17,6 +17,7 @@ import io.fabric8.kubernetes.api.model.NamespaceBuilder; import io.fabric8.kubernetes.api.model.Pod; +import io.fabric8.kubernetes.api.model.PodBuilder; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; import io.fabric8.kubernetes.client.DefaultKubernetesClient; @@ -40,7 +41,7 @@ public static void main(String[] args) { try { log("Create namespace:", client.namespaces().create(new NamespaceBuilder().withNewMetadata().withName("thisisatest").endMetadata().build())); - Pod createdPod = client.pods().inNamespace("thisisatest").createNew() + Pod createdPod = client.pods().inNamespace("thisisatest").create(new PodBuilder() .withNewMetadata() .withName("testpod") .addToLabels("server", "nginx") @@ -49,13 +50,14 @@ public static void main(String[] args) { .addNewContainer().withName("nginx").withImage("nginx") .addNewPort().withContainerPort(80).endPort() .endContainer() - .endSpec().done(); + .endSpec() + .build()); log("Created testPod:", createdPod); - Pod updatedPod = client.pods().inNamespace("thisisatest").withName("testpod").edit() + Pod updatedPod = client.pods().inNamespace("thisisatest").withName("testpod").edit(p -> new PodBuilder(p) .editMetadata() .addToLabels("server2", "nginx2") - .and().done(); + .and().build()); log("Replaced testPod:", updatedPod); } catch (KubernetesClientException e) { diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/StorageClassExamples.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/StorageClassExamples.java index 2bafffe7255..9997ca5d80a 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/StorageClassExamples.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/StorageClassExamples.java @@ -77,7 +77,7 @@ public static void main(String[] args) { logger.info("List of storage classes: {}", storageClassList.toString()); //update storage class. add label - storageClass = client.storage().storageClasses().withName(name).edit().editMetadata().addToLabels("testLabel", "testLabelValue").endMetadata().done(); + storageClass = client.storage().storageClasses().withName(name).edit(s -> new StorageClassBuilder(s).editMetadata().addToLabels("testLabel", "testLabelValue").endMetadata().build()); //list all storage classes storageClassList = client.storage().storageClasses().list(); diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/crds/DoneableDummy.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/crds/DoneableDummy.java deleted file mode 100644 index 39495b9b46d..00000000000 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/crds/DoneableDummy.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.kubernetes.examples.crds; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.client.CustomResourceDoneable; - -/** - */ -public class DoneableDummy extends CustomResourceDoneable { - public DoneableDummy(Dummy resource, Function function) { - super(resource, function); - } -} diff --git a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/BuildConfigExamples.java b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/BuildConfigExamples.java index 1d3332417d8..9632b74a907 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/BuildConfigExamples.java +++ b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/BuildConfigExamples.java @@ -27,6 +27,8 @@ import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.openshift.api.model.Build; import io.fabric8.openshift.api.model.BuildRequestBuilder; +import io.fabric8.openshift.api.model.BuildConfigBuilder; +import io.fabric8.openshift.api.model.ImageStreamBuilder; import io.fabric8.openshift.api.model.WebHookTriggerBuilder; import io.fabric8.openshift.client.OpenShiftClient; import org.slf4j.Logger; @@ -49,7 +51,7 @@ public static void main(String[] args) throws InterruptedException { client.serviceAccounts().inNamespace("thisisatest").create(fabric8); - log("Created image stream", client.imageStreams().inNamespace("thisisatest").createNew() + log("Created image stream", client.imageStreams().inNamespace("thisisatest").create(new ImageStreamBuilder() .withNewMetadata() .withName("example-camel-cdi") .endMetadata() @@ -60,9 +62,9 @@ public static void main(String[] args) throws InterruptedException { .withDockerImageRepository("fabric8/example-camel-cdi") .endSpec() .withNewStatus().withDockerImageRepository("").endStatus() - .done()); + .build())); - log("Created image stream", client.imageStreams().inNamespace("thisisatest").createNew() + log("Created image stream", client.imageStreams().inNamespace("thisisatest").create(new ImageStreamBuilder() .withNewMetadata() .withName("java-sti") .endMetadata() @@ -73,9 +75,9 @@ public static void main(String[] args) throws InterruptedException { .withDockerImageRepository("fabric8/java-sti") .endSpec() .withNewStatus().withDockerImageRepository("").endStatus() - .done()); + .build())); - log("Created build config", client.buildConfigs().inNamespace("thisisatest").createNew() + log("Created build config", client.buildConfigs().inNamespace("thisisatest").create(new BuildConfigBuilder() .withNewMetadata() .withName("custom-build-config") .endMetadata() @@ -107,7 +109,7 @@ public static void main(String[] args) throws InterruptedException { .endGithub() .endTrigger() .endSpec() - .done()); + .build())); Build build = client.buildConfigs().inNamespace("thisisatest").withName("custom-build-config").instantiate(new BuildRequestBuilder() .withNewMetadata().withName("custom-build-config").endMetadata() diff --git a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigExamples.java b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigExamples.java index f561c78ce3d..a35854fb105 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigExamples.java +++ b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigExamples.java @@ -27,6 +27,7 @@ import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.openshift.api.model.Build; import io.fabric8.openshift.api.model.BuildRequestBuilder; +import io.fabric8.openshift.api.model.DeploymentConfigBuilder; import io.fabric8.openshift.api.model.DeploymentTriggerPolicy; import io.fabric8.openshift.api.model.ProjectRequest; import io.fabric8.openshift.api.model.ProjectRequestBuilder; @@ -58,7 +59,7 @@ public static void main(String[] args) throws InterruptedException { client.serviceAccounts().inNamespace("thisisatest").createOrReplace(fabric8); - log("Created deployment", client.deploymentConfigs().inNamespace("thisisatest").createOrReplaceWithNew() + log("Created deployment", client.deploymentConfigs().inNamespace("thisisatest").createOrReplace(new DeploymentConfigBuilder() .withNewMetadata() .withName("nginx") .endMetadata() @@ -83,7 +84,7 @@ public static void main(String[] args) throws InterruptedException { .endSpec() .endTemplate() .endSpec() - .done()); + .build())); client.deploymentConfigs().inNamespace("thisisatest").withName("nginx").scale(2, true); diff --git a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigScale.java b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigScale.java index 34bbacdb24a..4c3a0cdf288 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigScale.java +++ b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/DeploymentConfigScale.java @@ -20,7 +20,6 @@ import io.fabric8.openshift.api.model.DeploymentConfig; import io.fabric8.openshift.api.model.DeploymentConfigList; import io.fabric8.openshift.api.model.DeploymentConfigSpec; -import io.fabric8.openshift.api.model.DoneableDeploymentConfig; import io.fabric8.openshift.client.DefaultOpenShiftClient; import io.fabric8.openshift.client.OpenShiftAPIGroups; import io.fabric8.openshift.client.OpenShiftClient; @@ -53,7 +52,7 @@ public static void main(String[] args) { System.out.println("WARNING this cluster does not support the API Group " + OpenShiftAPIGroups.APPS); return; } - DeployableScalableResource resource = client.deploymentConfigs().withName(name); + DeployableScalableResource resource = client.deploymentConfigs().withName(name); DeploymentConfig deploymentConfig = resource.get(); if (deploymentConfig == null) { System.out.println("Could not find a DeploymentConfig for name: " + name); diff --git a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/NewProjectExamples.java b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/NewProjectExamples.java index 5f537a9bd0e..10ba68b59e7 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/NewProjectExamples.java +++ b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/NewProjectExamples.java @@ -19,6 +19,7 @@ import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; import io.fabric8.openshift.api.model.ProjectRequest; +import io.fabric8.openshift.api.model.ProjectRequestBuilder; import io.fabric8.openshift.client.DefaultOpenShiftClient; import io.fabric8.openshift.client.OpenShiftClient; import org.slf4j.Logger; @@ -38,7 +39,7 @@ public static void main(String[] args) throws InterruptedException { try (OpenShiftClient client = new DefaultOpenShiftClient(config)) { ProjectRequest request = null; try { - request = client.projectrequests().createNew().withNewMetadata().withName("thisisatest").endMetadata().withDescription("Jimmi").withDisplayName("Jimmi").done(); + request = client.projectrequests().create(new ProjectRequestBuilder().withNewMetadata().withName("thisisatest").endMetadata().withDescription("Jimmi").withDisplayName("Jimmi").build()); } finally { if (request != null) { client.projects().withName(request.getMetadata().getName()).delete(); diff --git a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/TemplateExample.java b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/TemplateExample.java index 8d2a420a223..cf7a443e289 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/TemplateExample.java +++ b/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/TemplateExample.java @@ -17,6 +17,7 @@ */ import io.fabric8.kubernetes.api.model.KubernetesList; +import io.fabric8.kubernetes.api.model.NamespaceBuilder; import io.fabric8.openshift.api.model.Parameter; import io.fabric8.openshift.api.model.Template; import io.fabric8.openshift.client.DefaultOpenShiftClient; @@ -37,7 +38,7 @@ public static void main(String[] args) { try (OpenShiftClient client = new DefaultOpenShiftClient()) { try { logger.info("Creating temporary namespace '{}' for example", NAMESPACE); - client.namespaces().createNew().withNewMetadata().withName(NAMESPACE).endMetadata().done(); + client.namespaces().create(new NamespaceBuilder().withNewMetadata().withName(NAMESPACE).endMetadata().build()); final Template loadedTemplate = client.templates() .load(TemplateExample.class.getResourceAsStream(TEST_TEMPLATE_RESOURCE)).get(); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleBindingIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleBindingIT.java index f15db383819..e2f33e10173 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleBindingIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleBindingIT.java @@ -18,6 +18,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.DeleteEntity; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding; +import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBindingBuilder; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBindingList; import io.fabric8.kubernetes.client.KubernetesClient; @@ -130,8 +131,8 @@ public void list() { @Test public void update() { - clusterRoleBinding = client.rbac().clusterRoleBindings().withName("read-nodes-update").edit() - .editSubject(0).withName("jane-new").endSubject().done(); + clusterRoleBinding = client.rbac().clusterRoleBindings().withName("read-nodes-update").edit(c -> new ClusterRoleBindingBuilder(c) + .editSubject(0).withName("jane-new").endSubject().build()); assertNotNull(clusterRoleBinding); assertEquals("ClusterRoleBinding", clusterRoleBinding.getKind()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleIT.java index f5fd4939aed..44931aca15d 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ClusterRoleIT.java @@ -20,6 +20,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.DeleteEntity; import io.fabric8.kubernetes.api.model.rbac.ClusterRole; +import io.fabric8.kubernetes.api.model.rbac.ClusterRoleBuilder; import io.fabric8.kubernetes.api.model.rbac.ClusterRoleList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -142,8 +143,8 @@ public void list() { @Test public void update() { - clusterRole = client.rbac().clusterRoles().withName("node-reader-update").edit() - .editRule(0).addToApiGroups(1, "extensions").endRule().done(); + clusterRole = client.rbac().clusterRoles().withName("node-reader-update").edit(c -> new ClusterRoleBuilder(c) + .editRule(0).addToApiGroups(1, "extensions").endRule().build()); assertNotNull(clusterRole); assertEquals("ClusterRole", clusterRole.getKind()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ConfigMapIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ConfigMapIT.java index 319f76f3b8a..09564621940 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ConfigMapIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ConfigMapIT.java @@ -71,8 +71,8 @@ public void list() { @Test public void update() { - configMap = client.configMaps().inNamespace(session.getNamespace()).withName("configmap-update").edit() - .addToData("MSSQL", "Microsoft Database").done(); + configMap = client.configMaps().inNamespace(session.getNamespace()).withName("configmap-update").edit(c -> new ConfigMapBuilder(c) + .addToData("MSSQL", "Microsoft Database").build()); assertNotNull(configMap); assertEquals("Microsoft Database", configMap.getData().get("MSSQL")); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CronJobIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CronJobIT.java index ab5f417e759..0f68d680357 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CronJobIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CronJobIT.java @@ -18,6 +18,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.kubernetes.api.model.batch.CronJob; +import io.fabric8.kubernetes.api.model.batch.CronJobBuilder; import io.fabric8.kubernetes.api.model.batch.CronJobList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -78,11 +79,11 @@ public void list() { public void update() { currentNamespace = session.getNamespace(); cronJob1 = client.batch().cronjobs().inNamespace(currentNamespace).withName("hello-update") - .edit() + .edit(c -> new CronJobBuilder(c) .editSpec() .withSchedule("*/1 * * * *") .endSpec() - .done(); + .build()); assertEquals("*/1 * * * *", cronJob1.getSpec().getSchedule()); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CustomResourceDefinitionIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CustomResourceDefinitionIT.java index 2b949af2116..fdcb4fb3157 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CustomResourceDefinitionIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/CustomResourceDefinitionIT.java @@ -87,7 +87,7 @@ public void testCrdOperations() { assertThat(crdList.getItems().size()).isGreaterThan(0); // Update - CustomResourceDefinition updatedCrd = client.customResourceDefinitions().withName(crd1.getMetadata().getName()).edit().editSpec().editOrNewNames().addNewShortName("its").endNames().endSpec().done(); + CustomResourceDefinition updatedCrd = client.customResourceDefinitions().withName(crd1.getMetadata().getName()).edit(c -> new CustomResourceDefinitionBuilder(c).editSpec().editOrNewNames().addNewShortName("its").endNames().endSpec().build()); assertThat(updatedCrd.getSpec().getNames().getShortNames().size()).isEqualTo(2); // Delete diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/DeploymentIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/DeploymentIT.java index 988d1597781..99ce0748ca9 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/DeploymentIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/DeploymentIT.java @@ -20,6 +20,7 @@ import io.fabric8.commons.ReadyEntity; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.apps.Deployment; +import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder; import io.fabric8.kubernetes.api.model.apps.DeploymentList; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.internal.readiness.Readiness; @@ -79,7 +80,7 @@ public void list() { @Test public void update() { deployment1 = client.apps().deployments().inNamespace(session.getNamespace()).withName("deployment-standard") - .edit().editMetadata().addToAnnotations("updated", "true").endMetadata().done(); + .edit(d -> new DeploymentBuilder(d).editMetadata().addToAnnotations("updated", "true").endMetadata().build()); assertThat(deployment1).isNotNull(); assertEquals("true", deployment1.getMetadata().getAnnotations().get("updated")); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/IngressIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/IngressIT.java index 74ddb5ca734..e7c3821400f 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/IngressIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/IngressIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.AssumingK8sVersionAtLeast; import io.fabric8.commons.ClusterEntity; import io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress; +import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressBuilder; import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -79,8 +80,8 @@ public void list() { @Test public void update() { - ingress = client.network().v1beta1().ingresses().inNamespace(session.getNamespace()).withName("ingress-update").edit() - .editOrNewMetadata().addToAnnotations("foo", "bar").endMetadata().done(); + ingress = client.network().v1beta1().ingresses().inNamespace(session.getNamespace()).withName("ingress-update").edit(i -> new IngressBuilder(i) + .editOrNewMetadata().addToAnnotations("foo", "bar").endMetadata().build()); assertNotNull(ingress); assertEquals("bar", ingress.getMetadata().getAnnotations().get("foo")); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/NetworkPolicyIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/NetworkPolicyIT.java index b5f98c06b9d..1d7cc19109c 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/NetworkPolicyIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/NetworkPolicyIT.java @@ -20,6 +20,7 @@ import io.fabric8.commons.DeleteEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy; +import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyBuilder; import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -111,9 +112,9 @@ public void list() { public void update() { ReadyEntity networkPolicyReady = new ReadyEntity<>(NetworkPolicy.class, client, "networkpolicy-update", session.getNamespace()); NetworkPolicy networkPolicy = client.network().v1().networkPolicies() - .withName("networkpolicy-update").edit() + .withName("networkpolicy-update").edit(n -> new NetworkPolicyBuilder(n) .editMetadata().addToLabels("bar", "foo").endMetadata() - .done(); + .build()); await().atMost(30, TimeUnit.SECONDS).until(networkPolicyReady); assertNotNull(networkPolicy); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java index b9aef274344..8effcc6eaec 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java @@ -109,8 +109,8 @@ public void list() { @Test public void update() { - pod1 = client.pods().inNamespace(session.getNamespace()).withName("pod-standard").edit() - .editMetadata().addToLabels("foo", "bar").endMetadata().done(); + pod1 = client.pods().inNamespace(session.getNamespace()).withName("pod-standard").edit(p -> new PodBuilder(p) + .editMetadata().addToLabels("foo", "bar").endMetadata().build()); assertEquals("bar", pod1.getMetadata().getLabels().get("foo")); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodSecurityPolicyIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodSecurityPolicyIT.java index d6783b70d0d..630489e17d6 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodSecurityPolicyIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodSecurityPolicyIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.DeleteEntity; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicy; +import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicyBuilder; import io.fabric8.kubernetes.api.model.policy.PodSecurityPolicyList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.impl.requirement.RequiresKubernetes; @@ -91,9 +92,9 @@ public void list() { @Test public void update(){ - PodSecurityPolicy podSecurityPolicy = client.policy().podSecurityPolicies().withName("psp-update").edit() + PodSecurityPolicy podSecurityPolicy = client.policy().podSecurityPolicies().withName("psp-update").edit(p -> new PodSecurityPolicyBuilder(p) .editSpec().withPrivileged(true).endSpec() - .done(); + .build()); assertNotNull(podSecurityPolicy); assertEquals("psp-update", podSecurityPolicy.getMetadata().getName()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ReplicaSetIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ReplicaSetIT.java index caeb112d163..274c546d245 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ReplicaSetIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ReplicaSetIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; +import io.fabric8.kubernetes.api.model.apps.ReplicaSetBuilder; import io.fabric8.kubernetes.api.model.apps.ReplicaSetList; import io.fabric8.kubernetes.client.KubernetesClient; import java.util.concurrent.TimeUnit; @@ -80,8 +81,8 @@ public void update() { ReadyEntity replicaSetReady = new ReadyEntity<>(ReplicaSet.class, client, "replicaset-update", session.getNamespace()); await().atMost(30, TimeUnit.SECONDS).until(replicaSetReady); - replicaset1 = client.apps().replicaSets().inNamespace(session.getNamespace()).withName("replicaset-update").edit() - .editSpec().withReplicas(2).endSpec().done(); + replicaset1 = client.apps().replicaSets().inNamespace(session.getNamespace()).withName("replicaset-update").edit(r -> new ReplicaSetBuilder(r) + .editSpec().withReplicas(2).endSpec().build()); assertThat(replicaset1).isNotNull(); assertEquals(2, replicaset1.getSpec().getReplicas().intValue()); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleBindingIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleBindingIT.java index 4eed0204ab6..a813d00946f 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleBindingIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleBindingIT.java @@ -18,6 +18,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.DeleteEntity; import io.fabric8.kubernetes.api.model.rbac.RoleBinding; +import io.fabric8.kubernetes.api.model.rbac.RoleBindingBuilder; import io.fabric8.kubernetes.api.model.rbac.RoleBindingList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -123,8 +124,8 @@ public void list() { @Test public void update() { - roleBinding = client.rbac().roleBindings().inNamespace(session.getNamespace()).withName("rb-update").edit() - .editSubject(0).withName("jane-new").endSubject().done(); + roleBinding = client.rbac().roleBindings().inNamespace(session.getNamespace()).withName("rb-update").edit(r -> new RoleBindingBuilder(r) + .editSubject(0).withName("jane-new").endSubject().build()); assertNotNull(roleBinding); assertEquals("RoleBinding", roleBinding.getKind()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleIT.java index 800204dd796..76e6e018e6d 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RoleIT.java @@ -18,6 +18,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.DeleteEntity; import io.fabric8.kubernetes.api.model.rbac.Role; +import io.fabric8.kubernetes.api.model.rbac.RoleBuilder; import io.fabric8.kubernetes.api.model.rbac.RoleList; import io.fabric8.kubernetes.client.KubernetesClient; import org.arquillian.cube.kubernetes.api.Session; @@ -150,8 +151,8 @@ public void list() { @Test public void update() { - role = client.rbac().roles().inNamespace(currentNamespace).withName("role-update").edit() - .editRule(0).addToApiGroups(1, "extensions").endRule().done(); + role = client.rbac().roles().inNamespace(currentNamespace).withName("role-update").edit(r -> new RoleBuilder(r) + .editRule(0).addToApiGroups(1, "extensions").endRule().build()); assertNotNull(role); assertEquals("Role", role.getKind()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/SecretIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/SecretIT.java index 29b9d3f2fbd..93456864378 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/SecretIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/SecretIT.java @@ -85,9 +85,9 @@ public void list() { @Test public void update() { ReadyEntity secretReady = new ReadyEntity<>(Secret.class, client, "secret-update", currentNamespace); - secret1 = client.secrets().inNamespace(currentNamespace).withName("secret-update").edit() + secret1 = client.secrets().inNamespace(currentNamespace).withName("secret-update").edit(s -> new SecretBuilder(s) .editOrNewMetadata().addToLabels("foo", "bar").endMetadata() - .done(); + .build()); await().atMost(30, TimeUnit.SECONDS).until(secretReady); assertThat(secret1).isNotNull(); assertEquals("bar", secret1.getMetadata().getLabels().get("foo")); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceAccountIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceAccountIT.java index 4b92a04dca6..9b328ff8f8e 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceAccountIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceAccountIT.java @@ -77,10 +77,10 @@ public void list() { @Test public void update() { ReadyEntity serviceAccountReady = new ReadyEntity<>(ServiceAccount.class, client, "sa-update", session.getNamespace()); - serviceAccount1 = client.serviceAccounts().inNamespace(session.getNamespace()).withName("sa-update").edit() + serviceAccount1 = client.serviceAccounts().inNamespace(session.getNamespace()).withName("sa-update").edit(s -> new ServiceAccountBuilder(s) .addNewSecret().withName("default-token-uudp").endSecret() .addNewImagePullSecret().withName("myregistrykey").endImagePullSecret() - .done(); + .build()); await().atMost(30, TimeUnit.SECONDS).until(serviceAccountReady); assertThat(serviceAccount1).isNotNull(); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceIT.java index dc95dbaa7f4..f34199a7805 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/ServiceIT.java @@ -80,9 +80,9 @@ public void list() { @Test public void update() { ReadyEntity serviceReady = new ReadyEntity<>(Service.class, client, "service-update", session.getNamespace()); - svc1 = client.services().inNamespace(session.getNamespace()).withName("service-update").edit() + svc1 = client.services().inNamespace(session.getNamespace()).withName("service-update").edit(s -> new ServiceBuilder (s) .editSpec().addNewPort().withName("https").withProtocol("TCP").withPort(443).withTargetPort(new IntOrString(9377)).endPort().endSpec() - .done(); + .build()); await().atMost(30, TimeUnit.SECONDS).until(serviceReady); assertThat(svc1).isNotNull(); assertEquals(2, svc1.getSpec().getPorts().size()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/StorageClassIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/StorageClassIT.java index d82be88bb65..0a4b0840dd3 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/StorageClassIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/StorageClassIT.java @@ -17,6 +17,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.kubernetes.api.model.storage.StorageClass; +import io.fabric8.kubernetes.api.model.storage.StorageClassBuilder; import io.fabric8.kubernetes.api.model.storage.StorageClassList; import io.fabric8.kubernetes.client.KubernetesClient; import static junit.framework.TestCase.assertNotNull; @@ -71,7 +72,7 @@ public void list() { @Test public void update() { - storageClass = client.storage().storageClasses().withName("storageclass-update").edit().editMetadata().addToLabels("testLabel", "testLabelValue").endMetadata().done(); + storageClass = client.storage().storageClasses().withName("storageclass-update").edit(s -> new StorageClassBuilder(s).editMetadata().addToLabels("testLabel", "testLabelValue").endMetadata().build()); assertNotNull(storageClass); assertEquals("testLabelValue", storageClass.getMetadata().getLabels().get("testLabel")); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/WatchIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/WatchIT.java index 85448f2c6a7..af63eb35f40 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/WatchIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/WatchIT.java @@ -77,10 +77,10 @@ public void onClose(KubernetesClientException e) { } }); - client.pods().inNamespace(currentNamespace).withName("sample-watch-pod").edit() + client.pods().inNamespace(currentNamespace).withName("sample-watch-pod").edit(p -> new PodBuilder(p) .editMetadata().addToLabels("foo", "bar") .endMetadata() - .done(); + .build()); assertTrue(eventLatch.await(10, TimeUnit.SECONDS)); watch.close(); diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/BuildConfigIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/BuildConfigIT.java index 662d331bc1d..74adc6a179b 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/BuildConfigIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/BuildConfigIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.openshift.api.model.BuildConfig; +import io.fabric8.openshift.api.model.BuildConfigBuilder; import io.fabric8.openshift.api.model.BuildConfigList; import io.fabric8.openshift.api.model.BuildSourceBuilder; import io.fabric8.openshift.client.OpenShiftClient; @@ -75,8 +76,8 @@ public void list() { @Test public void update() { ReadyEntity buildConfigReady = new ReadyEntity<>(BuildConfig.class, client, "bc-update", session.getNamespace()); - BuildConfig buildConfig1 = client.buildConfigs().inNamespace(session.getNamespace()).withName("bc-update").edit() - .editSpec().withFailedBuildsHistoryLimit(5).endSpec().done(); + BuildConfig buildConfig1 = client.buildConfigs().inNamespace(session.getNamespace()).withName("bc-update").edit(b -> new BuildConfigBuilder(b) + .editSpec().withFailedBuildsHistoryLimit(5).endSpec().build()); await().atMost(30, TimeUnit.SECONDS).until(buildConfigReady); assertEquals(5, buildConfig1.getSpec().getFailedBuildsHistoryLimit().intValue()); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/DeploymentConfigIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/DeploymentConfigIT.java index 6f392e36f9f..4be53158844 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/DeploymentConfigIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/DeploymentConfigIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.openshift.api.model.DeploymentConfig; +import io.fabric8.openshift.api.model.DeploymentConfigBuilder; import io.fabric8.openshift.api.model.DeploymentConfigList; import io.fabric8.openshift.client.OpenShiftClient; import org.arquillian.cube.kubernetes.api.Session; @@ -74,8 +75,8 @@ public void list() { @Test public void update() { ReadyEntity deploymentConfigReady = new ReadyEntity<>(DeploymentConfig.class, client, "dc-update", session.getNamespace()); - DeploymentConfig deploymentConfig1 = client.deploymentConfigs().inNamespace(session.getNamespace()).withName("dc-update").edit() - .editSpec().withReplicas(3).endSpec().done(); + DeploymentConfig deploymentConfig1 = client.deploymentConfigs().inNamespace(session.getNamespace()).withName("dc-update").edit(d -> new DeploymentConfigBuilder(d) + .editSpec().withReplicas(3).endSpec().build()); await().atMost(60, TimeUnit.SECONDS).until(deploymentConfigReady); assertThat(deploymentConfig1).isNotNull(); assertEquals(3, deploymentConfig1.getSpec().getReplicas().intValue()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/ImageStreamIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/ImageStreamIT.java index 4a0b72e473f..19e0601c1d2 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/ImageStreamIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/ImageStreamIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.openshift.api.model.ImageStream; +import io.fabric8.openshift.api.model.ImageStreamBuilder; import io.fabric8.openshift.api.model.ImageStreamList; import io.fabric8.openshift.client.OpenShiftClient; import org.arquillian.cube.kubernetes.api.Session; @@ -75,9 +76,9 @@ public void list() { public void update() { ReadyEntity imageStreamReady = new ReadyEntity<>(ImageStream.class, client, "is-update", this.session.getNamespace()); await().atMost(30, TimeUnit.SECONDS).until(imageStreamReady); - ImageStream imageStream1 = client.imageStreams().inNamespace(session.getNamespace()).withName("is-update").edit() + ImageStream imageStream1 = client.imageStreams().inNamespace(session.getNamespace()).withName("is-update").edit(i -> new ImageStreamBuilder(i) .editSpec().withDockerImageRepository("fabric8/s2i-java").endSpec() - .done(); + .build()); assertThat(imageStream1).isNotNull(); assertEquals("fabric8/s2i-java", imageStream1.getSpec().getDockerImageRepository()); } diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/RouteIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/RouteIT.java index af78007cd77..c19cfd4c210 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/RouteIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/RouteIT.java @@ -19,6 +19,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.commons.ReadyEntity; import io.fabric8.openshift.api.model.Route; +import io.fabric8.openshift.api.model.RouteBuilder; import io.fabric8.openshift.api.model.RouteList; import io.fabric8.openshift.client.OpenShiftClient; import org.arquillian.cube.kubernetes.api.Session; @@ -80,8 +81,8 @@ public void list() { @Test public void update() { ReadyEntity route1Ready = new ReadyEntity<>(Route.class, client, "route-update", this.currentNamespace); - route1 = client.routes().inNamespace(currentNamespace).withName("route-update").edit() - .editSpec().withPath("/test").endSpec().done(); + route1 = client.routes().inNamespace(currentNamespace).withName("route-update").edit(r -> new RouteBuilder (r) + .editSpec().withPath("/test").endSpec().build()); await().atMost(30, TimeUnit.SECONDS).until(route1Ready); assertThat(route1).isNotNull(); assertEquals("/test", route1.getSpec().getPath()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/SecurityContextConstraintsIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/SecurityContextConstraintsIT.java index adf67cc5442..97036c6b4aa 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/SecurityContextConstraintsIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/SecurityContextConstraintsIT.java @@ -18,6 +18,7 @@ import io.fabric8.commons.ClusterEntity; import io.fabric8.openshift.api.model.SecurityContextConstraints; +import io.fabric8.openshift.api.model.SecurityContextConstraintsBuilder; import io.fabric8.openshift.api.model.SecurityContextConstraintsList; import io.fabric8.openshift.client.OpenShiftClient; import org.arquillian.cube.openshift.impl.requirement.RequiresOpenshift; @@ -103,9 +104,9 @@ public void list() { @Test public void update(){ - scc = client.securityContextConstraints().withName("scc-update").edit() + scc = client.securityContextConstraints().withName("scc-update").edit(s -> new SecurityContextConstraintsBuilder(s) .withAllowPrivilegedContainer(false) - .done(); + .build()); assertNotNull(scc); assertEquals("scc-update",scc.getMetadata().getName()); diff --git a/kubernetes-itests/src/test/java/io/fabric8/openshift/UserImpersonationIT.java b/kubernetes-itests/src/test/java/io/fabric8/openshift/UserImpersonationIT.java index aef457d775e..b0369316057 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/openshift/UserImpersonationIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/openshift/UserImpersonationIT.java @@ -27,6 +27,7 @@ import io.fabric8.kubernetes.client.RequestConfig; import io.fabric8.kubernetes.client.RequestConfigBuilder; import io.fabric8.openshift.api.model.ProjectRequest; +import io.fabric8.openshift.api.model.ProjectRequestBuilder; import io.fabric8.openshift.api.model.User; import io.fabric8.openshift.client.OpenShiftClient; import org.arquillian.cube.kubernetes.api.Session; @@ -132,11 +133,11 @@ public void should_be_able_to_create_a_project_impersonating_service_account() { .build(); // Create a project - ProjectRequest projectRequest = client.withRequestConfig(requestConfig).call(c -> c.projectrequests().createNew() + ProjectRequest projectRequest = client.withRequestConfig(requestConfig).call(c -> c.projectrequests().create(new ProjectRequestBuilder() .withNewMetadata() .withName(NEW_PROJECT) .endMetadata() - .done()); + .build())); // Grab the requester annotation String requester = projectRequest.getMetadata().getAnnotations().get("openshift.io/requester"); diff --git a/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesCoreTypeAnnotator.java b/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesCoreTypeAnnotator.java index 2f827fd6671..3ea41b48643 100644 --- a/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesCoreTypeAnnotator.java +++ b/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesCoreTypeAnnotator.java @@ -157,21 +157,12 @@ public void propertyField(JFieldVar field, JDefinedClass clazz, String propertyN } protected void processBuildable(JDefinedClass clazz) { - try { clazz.annotate(Buildable.class) .param("editableEnabled", false) .param("validationEnabled", false) .param("generateBuilderPackage", true) .param("lazyCollectionInitEnabled", false) - .param("builderPackage", "io.fabric8.kubernetes.api.builder") - .annotationParam("inline", Inline.class) - .param("type", new JCodeModel()._class("io.fabric8.kubernetes.api.model.Doneable")) - .param("prefix", "Doneable") - .param(ANNOTATION_VALUE, "done"); - - } catch (JClassAlreadyExistsException e) { - e.printStackTrace(); - } + .param("builderPackage", "io.fabric8.kubernetes.api.builder"); } protected void addClassesToPropertyFiles(JDefinedClass clazz) { diff --git a/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesTypeAnnotator.java b/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesTypeAnnotator.java index b321eddc0b1..4c3bb64cf22 100644 --- a/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesTypeAnnotator.java +++ b/kubernetes-model-generator/kubernetes-model-annotator/src/main/java/io/fabric8/kubernetes/annotator/KubernetesTypeAnnotator.java @@ -32,11 +32,6 @@ public void processBuildable(JDefinedClass clazz) { .param("lazyCollectionInitEnabled", false) .param("builderPackage", "io.fabric8.kubernetes.api.builder"); - buildable.paramArray("inline").annotate(Inline.class) - .param("type", new JCodeModel()._class("io.fabric8.kubernetes.api.model.Doneable")) - .param("prefix", "Doneable") - .param("value", "done"); - JAnnotationArrayMember arrayMember = buildable.paramArray("refs"); arrayMember.annotate(BuildableReference.class).param("value", new JCodeModel()._class("io.fabric8.kubernetes.api.model.ObjectMeta")); arrayMember.annotate(BuildableReference.class).param("value", new JCodeModel()._class("io.fabric8.kubernetes.api.model.LabelSelector")); diff --git a/kubernetes-model-generator/kubernetes-model-coordination/src/main/java/io/fabric8/kubernetes/api/model/coordination/v1/LeaseSpec.java b/kubernetes-model-generator/kubernetes-model-coordination/src/main/java/io/fabric8/kubernetes/api/model/coordination/v1/LeaseSpec.java index 37f7593d087..861d3a37392 100644 --- a/kubernetes-model-generator/kubernetes-model-coordination/src/main/java/io/fabric8/kubernetes/api/model/coordination/v1/LeaseSpec.java +++ b/kubernetes-model-generator/kubernetes-model-coordination/src/main/java/io/fabric8/kubernetes/api/model/coordination/v1/LeaseSpec.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.Inline; @@ -49,7 +48,7 @@ @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") public class LeaseSpec implements KubernetesResource { @JsonProperty("acquireTime") diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/IntOrString.java b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/IntOrString.java index 70934a443a0..ceb262394ff 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/IntOrString.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/IntOrString.java @@ -52,7 +52,7 @@ }) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder") public class IntOrString implements Serializable { @JsonProperty("IntVal") diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java index 74c74745230..1d3a3edd4a7 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java @@ -41,7 +41,7 @@ "items", }) @JsonDeserialize(using = JsonDeserializer.None.class) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder") public class KubernetesList extends BaseKubernetesList implements KubernetesResource { /** diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Quantity.java b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Quantity.java index 77d7d811579..e61bb9e734c 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Quantity.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/Quantity.java @@ -43,7 +43,7 @@ */ @JsonDeserialize(using = Quantity.Deserializer.class) @JsonSerialize(using = Quantity.Serializer.class) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=true, builderPackage = "io.fabric8.kubernetes.api.builder") public class Quantity implements Serializable { private static final String AT_LEAST_ONE_DIGIT_REGEX = ".*\\d+.*"; diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/WatchEvent.java b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/WatchEvent.java index 0e8ede9eaf0..e9dcbbd42f0 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/WatchEvent.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/WatchEvent.java @@ -43,7 +43,7 @@ @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = true, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = true, builderPackage = "io.fabric8.kubernetes.api.builder") public class WatchEvent implements KubernetesResource { diff --git a/kubernetes-model-generator/openshift-model-operatorhub/src/main/java/io/fabric8/openshift/api/model/operatorhub/v1alpha1/OperatorVersion.java b/kubernetes-model-generator/openshift-model-operatorhub/src/main/java/io/fabric8/openshift/api/model/operatorhub/v1alpha1/OperatorVersion.java index 03cc6d9f4a0..67048ce76c4 100644 --- a/kubernetes-model-generator/openshift-model-operatorhub/src/main/java/io/fabric8/openshift/api/model/operatorhub/v1alpha1/OperatorVersion.java +++ b/kubernetes-model-generator/openshift-model-operatorhub/src/main/java/io/fabric8/openshift/api/model/operatorhub/v1alpha1/OperatorVersion.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; @@ -47,11 +46,7 @@ @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @ToString @EqualsAndHashCode -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder", inline = { - @Inline(type = Doneable.class, prefix = "Doneable", value = "done") -}, refs = { - @BuildableReference(ObjectMeta.class) -}) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.fabric8.kubernetes.api.builder") public class OperatorVersion { private Long major; private Long minor; diff --git a/kubernetes-model-generator/openshift-model/src/main/java/io/fabric8/openshift/api/model/Template.java b/kubernetes-model-generator/openshift-model/src/main/java/io/fabric8/openshift/api/model/Template.java index 9d79e6cb401..ccec88aa0d6 100644 --- a/kubernetes-model-generator/openshift-model/src/main/java/io/fabric8/openshift/api/model/Template.java +++ b/kubernetes-model-generator/openshift-model/src/main/java/io/fabric8/openshift/api/model/Template.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Namespaced; import io.fabric8.kubernetes.api.model.ObjectMeta; @@ -62,7 +61,7 @@ @JsonDeserialize(using = JsonDeserializer.None.class) @EqualsAndHashCode @ToString -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=false, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done")) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage=false, builderPackage = "io.fabric8.kubernetes.api.builder") @ApiVersion("v1") @ApiGroup("") @VelocityTransformations({ diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleBindingCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleBindingCrudTest.java index 4f8e2d9287a..a60a4ba5e33 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleBindingCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleBindingCrudTest.java @@ -106,8 +106,8 @@ void crudTest() { assertEquals("rbac.authorization.k8s.io", kubernetesClusterRoleBindingList.getItems().get(0).getRoleRef().getApiGroup()); //test of updation - kubernetesClusterRoleBinding = client.rbac().clusterRoleBindings().withName("read-nodes").edit() - .editSubject(0).withName("jane-new").endSubject().done(); + kubernetesClusterRoleBinding = client.rbac().clusterRoleBindings().withName("read-nodes").edit(c -> new ClusterRoleBindingBuilder(c) + .editSubject(0).withName("jane-new").endSubject().build()); assertNotNull(kubernetesClusterRoleBinding); assertEquals("ClusterRoleBinding", kubernetesClusterRoleBinding.getKind()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleCrudTest.java index b596233d3c4..6bd98a41cd3 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleCrudTest.java @@ -121,8 +121,8 @@ void crudTest(){ //test of updation - kubernetesClusterRole = client.rbac().clusterRoles().withName("node-reader").edit() - .editRule(0).addToApiGroups(1, "extensions").endRule().done(); + kubernetesClusterRole = client.rbac().clusterRoles().withName("node-reader").edit(c -> new ClusterRoleBuilder(c) + .editRule(0).addToApiGroups(1, "extensions").endRule().build()); assertNotNull(kubernetesClusterRole); assertEquals("ClusterRole", kubernetesClusterRole.getKind()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleTest.java index 1e68d73985f..c6e969ec223 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ClusterRoleTest.java @@ -48,7 +48,7 @@ void testLoadFromFile() { void testHandlersLoadFromFile() { KubernetesClient client = server.getClient(); - ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load = client.load(getClass().getResourceAsStream("/test-clusterrole.yml")); + ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load = client.load(getClass().getResourceAsStream("/test-clusterrole.yml")); assertNotNull(load); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ConfigMapCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ConfigMapCrudTest.java index 5d0ba137dd4..1d0b8c90dfd 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ConfigMapCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ConfigMapCrudTest.java @@ -82,7 +82,7 @@ void testCrud() { assertNotNull(aConfigMapList); assertEquals(1, aConfigMapList.getItems().size()); - configmap2 = client.configMaps().inNamespace("ns1").withName("configmap2").edit().addToData("II", "TWO").done(); + configmap2 = client.configMaps().inNamespace("ns1").withName("configmap2").edit(c -> new ConfigMapBuilder(c).addToData("II", "TWO").build()); assertNotNull(configmap2); assertEquals("TWO", configmap2.getData().get("II")); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CreateOrReplaceResourceTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CreateOrReplaceResourceTest.java index dccc79904dc..1a6faa264bb 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CreateOrReplaceResourceTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CreateOrReplaceResourceTest.java @@ -19,7 +19,6 @@ import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodBuilder; @@ -84,7 +83,7 @@ void testResourceCreateFailure() { server.expect().post().withPath("/api/v1/namespaces/test/pods").andReturn(HttpURLConnection.HTTP_BAD_REQUEST, new PodBuilder() .withNewMetadata().withResourceVersion("12345").endMetadata().build()).once(); KubernetesClient client = server.getClient(); - NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable podOperation = client.resource(new PodBuilder().withNewMetadata().withName("pod123").endMetadata().build()); + NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable podOperation = client.resource(new PodBuilder().withNewMetadata().withName("pod123").endMetadata().build()); // When assertThrows(KubernetesClientException.class, podOperation::createOrReplace); @@ -97,7 +96,7 @@ void testCreate() { .withNewMetadata().withResourceVersion("12345").and().build()).once(); KubernetesClient client = server.getClient(); - Pod pod = client.pods().createOrReplaceWithNew().withNewMetadata().withName("pod123").and().withNewSpec().and().done(); + Pod pod = client.pods().createOrReplace(new PodBuilder().withNewMetadata().withName("pod123").and().withNewSpec().and().build()); assertNotNull(pod); assertEquals("12345", pod.getMetadata().getResourceVersion()); } @@ -112,7 +111,7 @@ void testReplace() { .withNewMetadata().withResourceVersion("12345").and().build()).once(); KubernetesClient client = server.getClient(); - Pod pod = client.pods().createOrReplaceWithNew().withNewMetadata().withName("pod123").and().withNewSpec().and().done(); + Pod pod = client.pods().createOrReplace(new PodBuilder().withNewMetadata().withName("pod123").and().withNewSpec().and().build()); assertNotNull(pod); assertEquals("12345", pod.getMetadata().getResourceVersion()); } @@ -126,10 +125,9 @@ void testFailedReplace() { server.expect().put().withPath("/api/v1/namespaces/test/pods/pod123").andReturn(HttpURLConnection.HTTP_BAD_REQUEST, new PodBuilder() .withNewMetadata().withResourceVersion("12345").and().build()).once(); KubernetesClient client = server.getClient(); - DoneablePod podOperation = client.pods().createOrReplaceWithNew(); // When - assertThrows(KubernetesClientException.class, () -> podOperation.withNewMetadata().withName("pod123").and().withNewSpec().and().done()); + assertThrows(KubernetesClientException.class, () -> client.pods().create(new PodBuilder().withNewMetadata().withName("pod123").and().withNewSpec().and().build())); } @Test diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CronJobCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CronJobCrudTest.java index 26fda810cb1..86c491dce83 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CronJobCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CronJobCrudTest.java @@ -132,7 +132,7 @@ void testCrud() { assertTrue(bDeleted); assertEquals(0, cronJobList.getItems().size()); - cronJob2 = client.batch().cronjobs().inNamespace("ns2").withName("cronJob2").edit().editSpec().withSchedule("*/1 * * * *").and().done(); + cronJob2 = client.batch().cronjobs().inNamespace("ns2").withName("cronJob2").edit(c -> new CronJobBuilder(c).editSpec().withSchedule("*/1 * * * *").and().build()); assertNotNull(cronJob2); assertEquals("*/1 * * * *", cronJob2.getSpec().getSchedule()); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudTest.java index 5633ee99cf5..e0009a0ca5d 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudTest.java @@ -38,7 +38,6 @@ import io.fabric8.kubernetes.client.mock.crd.CronTab; import io.fabric8.kubernetes.client.mock.crd.CronTabList; import io.fabric8.kubernetes.client.mock.crd.CronTabSpec; -import io.fabric8.kubernetes.client.mock.crd.DoneableCronTab; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import io.fabric8.kubernetes.internal.KubernetesDeserializer; @@ -68,8 +67,7 @@ void testCrud() throws IOException { CronTab cronTab3 = createCronTab("my-third-cron-object", "* * * * */3", 1, "my-third-cron-image"); KubernetesClient client = kubernetesServer.getClient(); - MixedOperation> cronTabClient = client - .customResources(crdContext, CronTab.class, CronTabList.class, DoneableCronTab.class); + MixedOperation> cronTabClient = client.customResources(crdContext, CronTab.class, CronTabList.class); cronTabClient.inNamespace("test-ns").create(cronTab1); cronTabClient.inNamespace("test-ns").create(cronTab2); @@ -125,8 +123,8 @@ void testCrudWithDashSymbolInCRDName() throws IOException { CronTab cronTab3 = createCronTab("my-third-cron-object", "* * * * */3", 1, "my-third-cron-image"); KubernetesClient client = kubernetesServer.getClient(); - MixedOperation> cronTabClient = client - .customResources(cronTabCrd, CronTab.class, CronTabList.class, DoneableCronTab.class); + MixedOperation> cronTabClient = client + .customResources(cronTabCrd, CronTab.class, CronTabList.class); cronTabClient.inNamespace("test-ns").create(cronTab1); cronTabClient.inNamespace("test-ns").create(cronTab2); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudWithCRDContextTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudWithCRDContextTest.java index 5b54f0e5b80..5571e8ef096 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudWithCRDContextTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/CustomResourceCrudWithCRDContextTest.java @@ -22,7 +22,6 @@ import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext; import io.fabric8.kubernetes.client.mock.crd.EntandoBundleRelease; import io.fabric8.kubernetes.client.mock.crd.EntandoBundleReleaseList; -import io.fabric8.kubernetes.client.mock.crd.DoneableEntandoBundleRelease; import io.fabric8.kubernetes.client.mock.crd.EntandoBundleReleaseSpec; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import io.fabric8.kubernetes.internal.KubernetesDeserializer; @@ -58,8 +57,8 @@ void testCreateAndGet() { .build(); KubernetesClient client = kubernetesServer.getClient(); KubernetesDeserializer.registerCustomKind("demo.fabric8.io/v1alpha1", "EntandoBundleRelease", EntandoBundleRelease.class); - MixedOperation> ebrClient = client - .customResources(crdContext, EntandoBundleRelease.class, EntandoBundleReleaseList.class, DoneableEntandoBundleRelease.class); + MixedOperation> ebrClient = client + .customResources(crdContext, EntandoBundleRelease.class, EntandoBundleReleaseList.class); // When ebrClient.inNamespace("ns1").create(getMockedEntandoBundleRelease()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentCrudTest.java index c17d0743189..84eb5a27cc5 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentCrudTest.java @@ -95,8 +95,10 @@ void testCrud() { deployment2 = client.apps().deployments() - .inNamespace("ns1").withName("deployment2").edit() - .editMetadata().addToLabels("key1", "value1").endMetadata().done(); + .inNamespace("ns1").withName("deployment2").edit(d -> new DeploymentBuilder(d) + .editMetadata().addToLabels("key1", "value1").endMetadata() + .build()); + assertNotNull(deployment2); assertEquals("value1", deployment2.getMetadata().getLabels().get("key1")); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentTest.java index 45d5ea9846d..18f34074933 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentTest.java @@ -27,7 +27,6 @@ import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder; import io.fabric8.kubernetes.api.model.apps.DeploymentList; import io.fabric8.kubernetes.api.model.apps.DeploymentListBuilder; -import io.fabric8.kubernetes.api.model.apps.DoneableDeployment; import io.fabric8.kubernetes.api.model.apps.ReplicaSet; import io.fabric8.kubernetes.api.model.apps.ReplicaSetBuilder; import io.fabric8.kubernetes.api.model.apps.ReplicaSetListBuilder; @@ -291,7 +290,7 @@ void testDeleteWithNamespaceMismatch() { .endSpec() .build(); KubernetesClient client = server.getClient(); - NonNamespaceOperation> deployOp = + NonNamespaceOperation> deployOp = client.apps().deployments().inNamespace("test1"); assertThrows(KubernetesClientException.class, () -> deployOp.delete(deployment1)); } @@ -300,7 +299,7 @@ void testDeleteWithNamespaceMismatch() { void testCreateWithNameMismatch() { Deployment deployment1 = new DeploymentBuilder().withNewMetadata().withName("deployment1").withNamespace("test").and().build(); KubernetesClient client = server.getClient(); - RollableScalableResource deployOp = client + RollableScalableResource deployOp = client .apps().deployments() .inNamespace("test1") .withName("mydeployment1"); @@ -468,7 +467,7 @@ void testCreateMulti() { .once(); KubernetesClient client = server.getClient(); - NonNamespaceOperation> deployOp = + NonNamespaceOperation> deployOp = client.apps().deployments().inNamespace("test"); // Will throw exception IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> deployOp.create(deployment1, deployment2)); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/EndpointsTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/EndpointsTest.java index c174a9c13a9..1008fe87688 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/EndpointsTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/EndpointsTest.java @@ -98,7 +98,7 @@ public void testEditMissing() { server.expect().withPath("/api/v1/namespaces/test/endpoints/endpoint").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.endpoints().withName("endpoint").edit(); + client.endpoints().withName("endpoint").edit(r -> r); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java index 6863544a254..8caf9055414 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java @@ -16,6 +16,7 @@ package io.fabric8.kubernetes.client.mock; import io.fabric8.kubernetes.api.model.StatusBuilder; +import io.fabric8.kubernetes.api.model.EventBuilder; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import org.junit.Rule; @@ -70,6 +71,6 @@ public void testServerErrorWithStatus() { KubernetesClient client = server.getClient(); - client.v1().events().inNamespace("test").createNew().withNewMetadata().withName("event1").endMetadata().done(); + client.v1().events().inNamespace("test").create(new EventBuilder().withNewMetadata().withName("event1").endMetadata().build()); } } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NamespaceTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NamespaceTest.java index c5d8d1bb767..38df9e645bb 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NamespaceTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NamespaceTest.java @@ -102,7 +102,7 @@ public void testEditMissing() { server.expect().withPath("/api/v1/namespaces/namespace1").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.namespaces().withName("namespace1").edit(); + client.namespaces().withName("namespace1").edit(n -> n); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkPolicyCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkPolicyCrudTest.java index 27e5fb3929f..ff558e7b6b3 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkPolicyCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkPolicyCrudTest.java @@ -108,9 +108,9 @@ void crudTest(){ //test of updation networkPolicy = client.network().networkPolicies() - .withName("networkpolicy").edit() + .withName("networkpolicy").edit(n -> new NetworkPolicyBuilder(n) .editSpec().editIngress(0).editFirstPort().withPort(new IntOrString(6679)).endPort().endIngress().endSpec() - .done(); + .build()); logger.info("Updated PodSecurityPolicy : " + networkPolicy.toString()); assertNotNull(networkPolicy); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkingV1IngressTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkingV1IngressTest.java index 3bc09a91dda..135ab078430 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkingV1IngressTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/NetworkingV1IngressTest.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.mock; import io.fabric8.kubernetes.api.model.HasMetadata; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngress; import io.fabric8.kubernetes.api.model.networking.v1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder; import io.fabric8.kubernetes.api.model.networking.v1.IngressList; @@ -173,7 +172,7 @@ void testDeleteMulti() { void testDeleteWithNamespaceMismatch() { Ingress ingress1 = new IngressBuilder().withNewMetadata().withName("ingress1").withNamespace("test").and().build(); KubernetesClient client = server.getClient(); - NonNamespaceOperation> ingressOp = client + NonNamespaceOperation> ingressOp = client .network() .v1() .ingresses().inNamespace("test1"); @@ -185,7 +184,7 @@ void testDeleteWithNamespaceMismatch() { void testCreateWithNameMismatch() { Ingress ingress1 = new IngressBuilder().withNewMetadata().withName("ingress1").withNamespace("test").and().build(); KubernetesClient client = server.getClient(); - Resource ingressOp = client.network().v1().ingresses().inNamespace("test1").withName("myingress1"); + Resource ingressOp = client.network().v1().ingresses().inNamespace("test1").withName("myingress1"); Assertions.assertThrows(KubernetesClientException.class, () -> ingressOp.create(ingress1)); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeClaimTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeClaimTest.java index 1b063229d81..544eed1b2ef 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeClaimTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeClaimTest.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.mock; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; import io.fabric8.kubernetes.api.model.Quantity; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; @@ -121,8 +120,8 @@ void testGet() { void testEditMissing() { server.expect().withPath("/api/v1/namespaces/test/persistentvolumeclaims/persistentvolumeclaim").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - Resource pvcResource = client.persistentVolumeClaims().inNamespace("test").withName("persistentvolumeclaim"); - Assertions.assertThrows(KubernetesClientException.class, pvcResource::edit); + Resource pvcResource = client.persistentVolumeClaims().inNamespace("test").withName("persistentvolumeclaim"); + Assertions.assertThrows(KubernetesClientException.class, () -> pvcResource.edit(r -> r)); } @Test diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeTest.java index 3484e055fb4..30da0f30504 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PersistentVolumeTest.java @@ -89,7 +89,7 @@ public void testEditMissing() { server.expect().withPath("/api/v1/persistentvolumes/persistentvolume").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.persistentVolumes().withName("persistentvolume").edit(); + client.persistentVolumes().withName("persistentvolume").edit(p -> p); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodCrudTest.java index 6de6e718b89..3f0c3f6f70c 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodCrudTest.java @@ -82,8 +82,8 @@ public class PodCrudTest { assertEquals(2, podList.getItems().size()); // test update - pod2 = client.pods().inNamespace("ns1").withName("pod2").edit() - .editMetadata().addToLabels("key1", "value1").endMetadata().done(); + pod2 = client.pods().inNamespace("ns1").withName("pod2").edit(p -> new PodBuilder(p) + .editMetadata().addToLabels("key1", "value1").endMetadata().build()); assertNotNull(pod2); assertEquals("value1", pod2.getMetadata().getLabels().get("key1")); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodSecurityPolicyCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodSecurityPolicyCrudTest.java index 5f1a3c909e3..a17d568cf63 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodSecurityPolicyCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodSecurityPolicyCrudTest.java @@ -82,9 +82,9 @@ public void crudTest(){ assertEquals("RunAsAny",podSecurityPolicyList.getItems().get(0).getSpec().getSupplementalGroups().getRule()); //test of updation - podSecurityPolicy = client.policy().podSecurityPolicies().withName("test-example").edit() + podSecurityPolicy = client.policy().podSecurityPolicies().withName("test-example").edit(p -> new PodSecurityPolicyBuilder(p) .editSpec().withPrivileged(true).endSpec() - .done(); + .build()); logger.info("Updated PodSecurityPolicy : " + podSecurityPolicy.toString()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTemplateTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTemplateTest.java index 31122a07d61..be1b6b8aad4 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTemplateTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTemplateTest.java @@ -126,7 +126,7 @@ public void testEdit() { KubernetesClient client = server.getClient(); // When - PodTemplate podTemplate = client.v1().podTemplates().inNamespace("test").withName("pt1").edit().editMetadata().addToLabels("foo", "bar").endMetadata().done(); + PodTemplate podTemplate = client.v1().podTemplates().inNamespace("test").withName("pt1").edit(p -> new PodTemplateBuilder(p).editMetadata().addToLabels("foo", "bar").endMetadata().build()); // Then assertEquals("pt1", podTemplate.getMetadata().getName()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java index 887a81d1392..ee60bd1d81b 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java @@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit; import io.fabric8.kubernetes.api.model.DeletionPropagation; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodBuilder; @@ -164,10 +163,10 @@ void testEditMissing() { KubernetesClient client = server.getClient(); // When - PodResource podOp = client.pods().withName("pod1"); + PodResource podOp = client.pods().withName("pod1"); // Then - Assertions.assertThrows(KubernetesClientException.class, podOp::edit); + Assertions.assertThrows(KubernetesClientException.class, () -> podOp.edit(p -> p)); } @Test @@ -208,7 +207,7 @@ void testDeleteWithNamespaceMismatch() { Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build(); // When + Then - NonNamespaceOperation> podOp = client.pods().inNamespace("test1"); + NonNamespaceOperation> podOp = client.pods().inNamespace("test1"); Assertions.assertThrows(KubernetesClientException.class, () -> podOp.delete(pod1)); } @@ -247,7 +246,7 @@ void testEvict() { assertTrue(deleted); // unhandled error - PodResource resource = client.pods().inNamespace("ns1").withName("pod4"); + PodResource resource = client.pods().inNamespace("ns1").withName("pod4"); assertThrows(KubernetesClientException.class, resource::evict); } @@ -255,7 +254,7 @@ void testEvict() { void testCreateWithNameMismatch() { Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build(); - PodResource podOp = client.pods().inNamespace("test1").withName("mypod1"); + PodResource podOp = client.pods().inNamespace("test1").withName("mypod1"); Assertions.assertThrows(KubernetesClientException.class, () -> podOp.create(pod1)); } @@ -375,7 +374,7 @@ public void onClose(KubernetesClientException cause) { void testGetLogNotFound() { // Given KubernetesClient client = server.getClient(); - PodResource podOp = client.pods().withName("pod5"); + PodResource podOp = client.pods().withName("pod5"); // When + Then Assertions.assertThrows(KubernetesClientException.class, () -> podOp.getLog(true)); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PropagationPolicyTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PropagationPolicyTest.java index 3929df9ec01..67e6ae605d7 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PropagationPolicyTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PropagationPolicyTest.java @@ -31,7 +31,6 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext; -import io.fabric8.kubernetes.client.mock.crd.DoneablePodSet; import io.fabric8.kubernetes.client.mock.crd.PodSet; import io.fabric8.kubernetes.client.mock.crd.PodSetList; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; @@ -407,7 +406,7 @@ void testDeleteRawCustomResource() throws InterruptedException, IOException { void testDeleteCustomResource() throws InterruptedException { // Given server.expect().delete().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset").andReturn(HttpURLConnection.HTTP_OK, new PodSet()).once(); - MixedOperation> podSetClient = server.getClient().customResources(new CustomResourceDefinitionBuilder() + MixedOperation> podSetClient = server.getClient().customResources(new CustomResourceDefinitionBuilder() .withNewMetadata().withName("podsets.demo.k8s.io").endMetadata() .withNewSpec() .withGroup("demo.k8s.io") @@ -415,7 +414,7 @@ void testDeleteCustomResource() throws InterruptedException { .withNewNames().withKind("PodSet").withPlural("podsets").endNames() .withScope("Namespaced") .endSpec() - .build(), PodSet.class, PodSetList.class, DoneablePodSet.class); + .build(), PodSet.class, PodSetList.class); // When boolean isDeleted = podSetClient.inNamespace("test").withName("example-podset").delete(); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceListTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceListTest.java index 59b143bb61e..7717ff6506d 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceListTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceListTest.java @@ -100,7 +100,7 @@ void testCreateOrReplaceFailedCreate() { // Given Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build(); server.expect().post().withPath("/api/v1/namespaces/test/pods").andReturn(HTTP_UNAVAILABLE, pod1).once(); - NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable listOp = client.resourceList(new PodListBuilder().addToItems(pod1).build()); + NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable listOp = client.resourceList(new PodListBuilder().addToItems(pod1).build()); // When assertThrows(KubernetesClientException.class, listOp::createOrReplace); @@ -256,7 +256,7 @@ void testPartialSuccessfulWaitUntilCondition() { try (KubernetesClient client = server.getClient()) { KubernetesList list = new KubernetesListBuilder().withItems(pod1, pod2).build(); - final ListVisitFromServerGetDeleteRecreateWaitApplicable ops = client.resourceList(list).inNamespace("ns1"); + final ListVisitFromServerGetDeleteRecreateWaitApplicable ops = client.resourceList(list).inNamespace("ns1"); KubernetesClientTimeoutException ex = assertThrows(KubernetesClientTimeoutException.class, () -> ops.waitUntilCondition(isReady, 5, SECONDS) ); @@ -307,7 +307,7 @@ void testAllFailedWaitUntilCondition() { try (KubernetesClient client = server.getClient()) { KubernetesList list = new KubernetesListBuilder().withItems(pod1, pod2).build(); - final ListVisitFromServerGetDeleteRecreateWaitApplicable ops = client.resourceList(list).inNamespace("ns1"); + final ListVisitFromServerGetDeleteRecreateWaitApplicable ops = client.resourceList(list).inNamespace("ns1"); KubernetesClientTimeoutException ex = assertThrows(KubernetesClientTimeoutException.class, () -> ops.waitUntilCondition(isReady, 5, SECONDS) ); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java index 4295567412b..ef02735a580 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.mock; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodBuilder; @@ -84,7 +83,7 @@ void testCreateOrReplaceWhenCreateFails() { Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build(); server.expect().post().withPath("/api/v1/namespaces/test/pods").andReturn(HttpURLConnection.HTTP_BAD_REQUEST, pod1).once(); KubernetesClient client = server.getClient(); - NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable podOperation = client.resource(pod1); + NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable podOperation = client.resource(pod1); // When assertThrows(KubernetesClientException.class, podOperation::createOrReplace); @@ -136,7 +135,7 @@ void testCreateOrReplaceWithDeleteExistingWithCreateFailed() { void testRequire() { server.expect().get().withPath("/api/v1/namespaces/ns1/pods/pod1").andReturn(HttpURLConnection.HTTP_NOT_FOUND, "").once(); KubernetesClient client = server.getClient(); - PodResource podOp = client.pods().inNamespace("ns1").withName("pod1"); + PodResource podOp = client.pods().inNamespace("ns1").withName("pod1"); Assertions.assertThrows(ResourceNotFoundException.class, podOp::require); } @@ -341,7 +340,7 @@ void testWaitUntilConditionWhenResourceVersionTooOld() throws InterruptedExcepti .anyMatch(c -> "True".equals(c.getStatus())); try (KubernetesClient client = server.getClient()) { - final PodResource ops = client.pods().withName("pod1"); + final PodResource ops = client.pods().withName("pod1"); KubernetesClientException ex = assertThrows(KubernetesClientException.class, () -> ops.waitUntilCondition(isReady, 4, SECONDS) ); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleBindingCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleBindingCrudTest.java index a0bb43e6d8e..7dfc9318fb4 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleBindingCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleBindingCrudTest.java @@ -18,6 +18,7 @@ import io.fabric8.kubernetes.api.model.rbac.*; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; + import org.junit.Rule; import org.junit.jupiter.api.Test; import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; @@ -102,8 +103,8 @@ public void crudTest() { assertEquals("rbac.authorization.k8s.io", kubernetesRoleBindingList.getItems().get(0).getRoleRef().getApiGroup()); //test of updation - roleBinding = client.rbac().roleBindings().withName("read-jobs").edit() - .editSubject(0).withName("jane-new").endSubject().done(); + roleBinding = client.rbac().roleBindings().withName("read-jobs").edit(r -> new RoleBindingBuilder(r) + .editSubject(0).withName("jane-new").endSubject().build()); assertNotNull(roleBinding); assertEquals("RoleBinding", roleBinding.getKind()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleCrudTest.java index 72d9cb8d49c..4ae14285b5d 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/RoleCrudTest.java @@ -121,8 +121,8 @@ public void crudTest(){ //test of updation - kubernetesRole = client.rbac().roles().withName("job-reader").edit() - .editRule(0).addToApiGroups(1, "extensions").endRule().done(); + kubernetesRole = client.rbac().roles().withName("job-reader").edit(r -> new RoleBuilder(r) + .editRule(0).addToApiGroups(1, "extensions").endRule().build()); assertNotNull(kubernetesRole); assertEquals("Role", kubernetesRole.getKind()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/SecretCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/SecretCrudTest.java index 43795e25cf2..c3ec51e4492 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/SecretCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/SecretCrudTest.java @@ -77,7 +77,7 @@ public void testCrud() { assertNotNull(aSecretList); assertEquals(0, aSecretList.getItems().size()); - secret2 = client.secrets().inNamespace("ns2").withName("secret2").edit().removeFromData("one").done(); + secret2 = client.secrets().inNamespace("ns2").withName("secret2").edit(s -> new SecretBuilder(s).removeFromData("one").build()); assertNotNull(secret2); assertEquals(null, secret2.getData()); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceCrudTest.java index 122c230c09b..8c766cf5d00 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceCrudTest.java @@ -68,8 +68,8 @@ public void testCrud() { assertNotNull(aServiceList); assertEquals(2, aServiceList.getItems().size()); - service2 = client.services().inNamespace("ns2").withName("svc2").edit() - .editMetadata().addToLabels("key1", "value1").endMetadata().done(); + service2 = client.services().inNamespace("ns2").withName("svc2").edit(s -> new ServiceBuilder(s) + .editMetadata().addToLabels("key1", "value1").endMetadata().build()); assertNotNull(service2); assertEquals("value1", service2.getMetadata().getLabels().get("key1")); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceTest.java index f1cfc32f9ea..5e50e12f79e 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ServiceTest.java @@ -143,9 +143,9 @@ void testUpdate() { .once(); KubernetesClient client = server.getClient(); - Service responseFromServer = client.services().inNamespace("test").withName("httpbin").edit() + Service responseFromServer = client.services().inNamespace("test").withName("httpbin").edit(s -> new ServiceBuilder(s) .editOrNewMetadata().addToLabels("foo", "bar").endMetadata() - .done(); + .build()); assertNotNull(responseFromServer); assertEquals("bar", responseFromServer.getMetadata().getLabels().get("foo")); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StatefulSetTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StatefulSetTest.java index f043297c029..cb7e75f2216 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StatefulSetTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StatefulSetTest.java @@ -162,7 +162,7 @@ public void testDeleteLoadedResource() { KubernetesClient client = server.getClient(); - Deletable items = client.load(getClass().getResourceAsStream("/test-statefulset.yml")); + Deletable items = client.load(getClass().getResourceAsStream("/test-statefulset.yml")); assertTrue(items.delete()); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StorageSpaceCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StorageSpaceCrudTest.java index d72501682ba..5a966582d65 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StorageSpaceCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/StorageSpaceCrudTest.java @@ -75,9 +75,9 @@ public void testCrud() { assertNull(storageClassList.getItems().get(0).getMetadata().getLabels()); //test update - storageClass = client.storage().storageClasses().withName(name).edit().editOrNewMetadata() + storageClass = client.storage().storageClasses().withName(name).edit(s -> new StorageClassBuilder(s).editOrNewMetadata() .addToLabels("key1", "value1") - .endMetadata().done(); + .endMetadata().build()); logger.info("Updated Storage Class: {} ", storageClass.toString()); assertNotNull(storageClass); assertEquals(1, storageClass.getMetadata().getLabels().size()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedClusterScopeCustomResourceApiTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedClusterScopeCustomResourceApiTest.java index 517133dd11e..3c61153aa62 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedClusterScopeCustomResourceApiTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedClusterScopeCustomResourceApiTest.java @@ -22,7 +22,6 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext; -import io.fabric8.kubernetes.client.mock.crd.DoneableStar; import io.fabric8.kubernetes.client.mock.crd.Star; import io.fabric8.kubernetes.client.mock.crd.StarList; import io.fabric8.kubernetes.client.mock.crd.StarSpec; @@ -46,7 +45,7 @@ class TypedClusterScopeCustomResourceApiTest { @Rule public KubernetesServer server = new KubernetesServer(); - private MixedOperation> starClient; + private MixedOperation> starClient; private CustomResourceDefinition starCrd; private CustomResourceDefinitionContext crdContext; @@ -70,7 +69,7 @@ void setupCrd() { void create() { server.expect().post().withPath("/apis/example.crd.com/v1alpha1/stars").andReturn(200, getStar()).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); Star returnedStar = starClient.inNamespace("test").create(getStar()); assertNotNull(returnedStar); @@ -82,7 +81,7 @@ void list() { StarList starList = new StarList(); starList.setItems(Collections.singletonList(getStar())); server.expect().get().withPath("/apis/example.crd.com/v1alpha1/stars").andReturn(200, starList).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); starList = starClient.inNamespace("test").list(); assertNotNull(starList); @@ -96,7 +95,7 @@ void createOrReplace() { server.expect().post().withPath("/apis/example.crd.com/v1alpha1/stars").andReturn(HttpURLConnection.HTTP_CONFLICT, getStar()).times(2); server.expect().put().withPath("/apis/example.crd.com/v1alpha1/stars/sun").andReturn(HttpURLConnection.HTTP_OK, getStar()).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); Star returnedStar = starClient.inNamespace("test").createOrReplace(getStar()); assertNotNull(returnedStar); @@ -107,7 +106,7 @@ void createOrReplace() { void delete() { server.expect().delete().withPath("/apis/example.crd.com/v1alpha1/stars/sun").andReturn(200, getStar()).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); boolean isDeleted = starClient.inNamespace("test").withName("sun").delete(); assertTrue(isDeleted); @@ -117,7 +116,7 @@ void delete() { void testCascadingDeletion() throws InterruptedException { server.expect().delete().withPath("/apis/example.crd.com/v1alpha1/stars/sun").andReturn(200, getStar()).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); boolean isDeleted = starClient.inNamespace("test").withName("sun").cascading(true).delete(); assertTrue(isDeleted); @@ -131,7 +130,7 @@ void testCascadingDeletion() throws InterruptedException { void testPropagationPolicyDeletion() throws InterruptedException { server.expect().delete().withPath("/apis/example.crd.com/v1alpha1/stars/sun").andReturn(200, getStar()).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); boolean isDeleted = starClient.inNamespace("test").withName("sun").withPropagationPolicy(DeletionPropagation.ORPHAN).delete(); assertTrue(isDeleted); @@ -149,7 +148,7 @@ void testStatusUpdation() throws InterruptedException { updatedStar.setStatus(starStatus); server.expect().put().withPath("/apis/example.crd.com/v1alpha1/stars/sun/status").andReturn(200, updatedStar).once(); - starClient = server.getClient().customResources(crdContext, Star.class, StarList.class, DoneableStar.class); + starClient = server.getClient().customResources(crdContext, Star.class, StarList.class); starClient.inNamespace("test").updateStatus(updatedStar); RecordedRequest recordedRequest = server.getLastRequest(); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedCustomResourceApiTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedCustomResourceApiTest.java index 286fd15a836..acd4940e92e 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedCustomResourceApiTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/TypedCustomResourceApiTest.java @@ -22,7 +22,6 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext; -import io.fabric8.kubernetes.client.mock.crd.DoneablePodSet; import io.fabric8.kubernetes.client.mock.crd.PodSet; import io.fabric8.kubernetes.client.mock.crd.PodSetList; import io.fabric8.kubernetes.client.mock.crd.PodSetSpec; @@ -47,7 +46,7 @@ class TypedCustomResourceApiTest { @Rule public KubernetesServer server = new KubernetesServer(); - private MixedOperation> podSetClient; + private MixedOperation> podSetClient; private CustomResourceDefinition podSetCrd; private CustomResourceDefinitionContext crdContext; @@ -71,7 +70,7 @@ void setupCrd() { void create() { server.expect().post().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets").andReturn(200, getPodSet()).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); PodSet returnedPodSet = podSetClient.inNamespace("test").create(getPodSet()); assertNotNull(returnedPodSet); @@ -83,7 +82,7 @@ void list() { PodSetList podSetList = new PodSetList(); podSetList.setItems(Collections.singletonList(getPodSet())); server.expect().get().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets").andReturn(200, podSetList).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); podSetList = podSetClient.inNamespace("test").list(); assertNotNull(podSetList); @@ -97,7 +96,7 @@ void createOrReplace() { server.expect().post().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets").andReturn(HttpURLConnection.HTTP_CONFLICT, getPodSet()).times(2); server.expect().put().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset").andReturn(HttpURLConnection.HTTP_OK, getPodSet()).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); PodSet returnedPodSet = podSetClient.inNamespace("test").createOrReplace(getPodSet()); assertNotNull(returnedPodSet); @@ -108,7 +107,7 @@ void createOrReplace() { void delete() { server.expect().delete().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset").andReturn(200, getPodSet()).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); boolean isDeleted = podSetClient.inNamespace("test").withName("example-podset").delete(); assertTrue(isDeleted); @@ -118,7 +117,7 @@ void delete() { void testCascadingDeletion() throws InterruptedException { server.expect().delete().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset").andReturn(200, getPodSet()).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); boolean isDeleted = podSetClient.inNamespace("test").withName("example-podset").cascading(true).delete(); assertTrue(isDeleted); @@ -132,7 +131,7 @@ void testCascadingDeletion() throws InterruptedException { void testPropagationPolicyDeletion() throws InterruptedException { server.expect().delete().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset").andReturn(200, getPodSet()).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); boolean isDeleted = podSetClient.inNamespace("test").withName("example-podset").withPropagationPolicy(DeletionPropagation.ORPHAN).delete(); assertTrue(isDeleted); @@ -150,7 +149,7 @@ void testStatusUpdation() throws InterruptedException { updatedPodSet.setStatus(podSetStatus); server.expect().put().withPath("/apis/demo.k8s.io/v1alpha1/namespaces/test/podsets/example-podset/status").andReturn(200, updatedPodSet).once(); - podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class, DoneablePodSet.class); + podSetClient = server.getClient().customResources(crdContext, PodSet.class, PodSetList.class); podSetClient.inNamespace("test").updateStatus(updatedPodSet); RecordedRequest recordedRequest = server.getLastRequest(); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1HorizontalPodAutoscalerTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1HorizontalPodAutoscalerTest.java index 71e67be272b..5ab981452b6 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1HorizontalPodAutoscalerTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1HorizontalPodAutoscalerTest.java @@ -123,7 +123,7 @@ void testEditMissing() { server.expect().withPath("/apis/autoscaling/v1/namespaces/test/horizontalpodautoscalers/horizontalpodautoscaler").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.autoscaling().v1().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(); + client.autoscaling().v1().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(h -> h); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1IngressClassTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1IngressClassTest.java index 9a1a0a30e7f..fdb666b2db0 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1IngressClassTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1IngressClassTest.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.mock; import io.fabric8.kubernetes.api.model.HasMetadata; -import io.fabric8.kubernetes.api.model.networking.v1.DoneableIngressClass; import io.fabric8.kubernetes.api.model.networking.v1.IngressClass; import io.fabric8.kubernetes.api.model.networking.v1.IngressClassBuilder; import io.fabric8.kubernetes.api.model.networking.v1.IngressClassList; @@ -163,7 +162,7 @@ void testCreateWithNameMismatch() { KubernetesClient client = server.getClient(); // When - Resource ingressClassOp = client.network().v1().ingressClasses().withName("myingressClass1"); + Resource ingressClassOp = client.network().v1().ingressClasses().withName("myingressClass1"); // Then Assertions.assertThrows(KubernetesClientException.class, () -> ingressClassOp.create(ingressClass1)); diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta1HorizontalPodAutoscalerTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta1HorizontalPodAutoscalerTest.java index 89ecd779643..9553a89b14b 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta1HorizontalPodAutoscalerTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta1HorizontalPodAutoscalerTest.java @@ -107,7 +107,7 @@ public void testEditMissing() { server.expect().withPath("/apis/autoscaling/v2beta1/namespaces/test/horizontalpodautoscalers/horizontalpodautoscaler").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.autoscaling().v2beta1().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(); + client.autoscaling().v2beta1().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(h -> h); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta2HorizontalPodAutoscalerTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta2HorizontalPodAutoscalerTest.java index eaa00fa30fb..895af9ba8cb 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta2HorizontalPodAutoscalerTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V2beta2HorizontalPodAutoscalerTest.java @@ -122,7 +122,7 @@ public void testEditMissing() { server.expect().withPath("/apis/autoscaling/v2beta2/namespaces/test/horizontalpodautoscalers/horizontalpodautoscaler").andReturn(404, "error message from kubernetes").always(); KubernetesClient client = server.getClient(); - client.autoscaling().v2beta2().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(); + client.autoscaling().v2beta2().horizontalPodAutoscalers().inNamespace("test").withName("horizontalpodautoscaler").edit(h -> h); }); } diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/WatchTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/WatchTest.java index 200a4ab2aab..693ceab2452 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/WatchTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/WatchTest.java @@ -120,7 +120,7 @@ public void onClose(KubernetesClientException cause) { closeLatch.countDown(); } }; - final Watchable> watchable = client.pods().withName("pod1").withResourceVersion("1"); + final Watchable> watchable = client.pods().withName("pod1").withResourceVersion("1"); // When final KubernetesClientException result = Assertions.assertThrows(KubernetesClientException.class, () -> { try (Watch watch = watchable.watch(watcher)) { diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableCronTab.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableCronTab.java deleted file mode 100644 index 58cfaa380d5..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableCronTab.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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.kubernetes.client.mock.crd; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.client.CustomResourceDoneable; - - -public class DoneableCronTab extends CustomResourceDoneable { - public DoneableCronTab(CronTab resource, Function function) { super(resource, function); } -} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableEntandoBundleRelease.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableEntandoBundleRelease.java deleted file mode 100644 index 262e4614d38..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableEntandoBundleRelease.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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.kubernetes.client.mock.crd; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.client.CustomResourceDoneable; - -public class DoneableEntandoBundleRelease extends CustomResourceDoneable { - public DoneableEntandoBundleRelease(EntandoBundleRelease resource, Function function) { super(resource, function); } -} - diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneablePodSet.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneablePodSet.java deleted file mode 100644 index 4db7bf0ed9b..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneablePodSet.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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.kubernetes.client.mock.crd; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.client.CustomResourceDoneable; - - -public class DoneablePodSet extends CustomResourceDoneable { - public DoneablePodSet(PodSet resource, Function function) { super(resource, function); } -} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableStar.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableStar.java deleted file mode 100644 index da57464745d..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/crd/DoneableStar.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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.kubernetes.client.mock.crd; - -import io.fabric8.kubernetes.api.builder.Function; -import io.fabric8.kubernetes.client.CustomResourceDoneable; - -public class DoneableStar extends CustomResourceDoneable { - public DoneableStar(Star resource, Function function) { super(resource, function); } -} diff --git a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/DeploymentConfigCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/DeploymentConfigCrudTest.java index 9ca0a1ea570..2f524a0bad6 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/DeploymentConfigCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/DeploymentConfigCrudTest.java @@ -80,9 +80,9 @@ void testCrud() { assertNotNull(aDeploymentConfigList); assertEquals(2, aDeploymentConfigList.getItems().size()); - deploymentConfig3 = client.deploymentConfigs().inNamespace("ns2").withName("deploymentConfig3").edit() + deploymentConfig3 = client.deploymentConfigs().inNamespace("ns2").withName("deploymentConfig3").edit(d -> new DeploymentConfigBuilder(d) .editMetadata().addToLabels("testkey1","testvalue2").endMetadata() - .done(); + .build()); assertNotNull(deploymentConfig3); assertEquals(2, deploymentConfig3.getMetadata().getLabels().size()); diff --git a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/OpenshiftRoleBindingTest.java b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/OpenshiftRoleBindingTest.java index 3b74e1cf475..806cb7172d0 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/OpenshiftRoleBindingTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/OpenshiftRoleBindingTest.java @@ -243,13 +243,13 @@ void testCreateInline() throws Exception { NamespacedOpenShiftClient client = server.getOpenshiftClient(); - RoleBinding response = client.roleBindings().createNew() + RoleBinding response = client.roleBindings().create(new RoleBindingBuilder() .withNewMetadata().endMetadata() .addNewSubject().withKind("User").withName("testuser1").endSubject() .addNewSubject().withKind("User").withName("testuser2").endSubject() .addNewSubject().withKind("ServiceAccount").withName("svcacct").endSubject() .addNewSubject().withKind("Group").withName("testgroup").endSubject() - .done(); + .build()); assertEquals(expectedRoleBinding, response); RecordedRequest request = server.getLastRequest(); diff --git a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SecurityContextConstraintsTest.java b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SecurityContextConstraintsTest.java index 91c7c5e1b90..cae82a843b5 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SecurityContextConstraintsTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SecurityContextConstraintsTest.java @@ -120,7 +120,7 @@ void testEdit() { server.expect().withPath("/apis/security.openshift.io/v1/securitycontextconstraints/scc1").andReturn(200, new SecurityContextConstraintsBuilder().withNewMetadata().withName("scc1").and().addToAllowedCapabilities("allowed").build()).once(); OpenShiftClient client = server.getOpenshiftClient(); - SecurityContextConstraints scc = client.securityContextConstraints().withName("scc1").edit().addToAllowedCapabilities("allowed").done(); + SecurityContextConstraints scc = client.securityContextConstraints().withName("scc1").edit(s -> new SecurityContextConstraintsBuilder(s).addToAllowedCapabilities("allowed").build()); assertNotNull(scc); assertEquals(1, scc.getAllowedCapabilities().size()); } diff --git a/model-annotator/src/main/java/io/fabric8/kubernetes/ModelAnnotator.java b/model-annotator/src/main/java/io/fabric8/kubernetes/ModelAnnotator.java index 54d4c76f8e9..14cf15b4f03 100755 --- a/model-annotator/src/main/java/io/fabric8/kubernetes/ModelAnnotator.java +++ b/model-annotator/src/main/java/io/fabric8/kubernetes/ModelAnnotator.java @@ -58,11 +58,6 @@ public void propertyOrder(JDefinedClass clazz, JsonNode propertiesNode) { .param("generateBuilderPackage", false) .param("builderPackage", "io.fabric8.kubernetes.api.builder"); - buildable.paramArray("inline").annotate(Inline.class) - .param("type", new JCodeModel()._class("io.fabric8.kubernetes.api.model.Doneable")) - .param("prefix", "Doneable") - .param("value", "done"); - buildable.paramArray("refs").annotate(BuildableReference.class) .param("value", new JCodeModel()._class("io.fabric8.kubernetes.api.model.ObjectMeta")); diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java index 75bde3ce79e..7b7276fc1a3 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java @@ -16,39 +16,17 @@ package io.fabric8.openshift.client; import io.fabric8.kubernetes.api.model.*; -import io.fabric8.kubernetes.api.model.DoneableAPIService; -import io.fabric8.kubernetes.api.model.DoneableBinding; -import io.fabric8.kubernetes.api.model.DoneableComponentStatus; -import io.fabric8.kubernetes.api.model.DoneableConfigMap; -import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.DoneableEvent; -import io.fabric8.kubernetes.api.model.DoneableLimitRange; -import io.fabric8.kubernetes.api.model.DoneableNamespace; -import io.fabric8.kubernetes.api.model.DoneableNode; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolume; -import io.fabric8.kubernetes.api.model.DoneablePersistentVolumeClaim; -import io.fabric8.kubernetes.api.model.DoneablePod; -import io.fabric8.kubernetes.api.model.DoneableReplicationController; -import io.fabric8.kubernetes.api.model.DoneableResourceQuota; -import io.fabric8.kubernetes.api.model.DoneableSecret; -import io.fabric8.kubernetes.api.model.DoneableService; -import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequest; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequestList; -import io.fabric8.kubernetes.api.model.certificates.DoneableCertificateSigningRequest; -import io.fabric8.kubernetes.api.model.authentication.DoneableTokenReview; import io.fabric8.kubernetes.api.model.authentication.TokenReview; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.EventList; -import io.fabric8.kubernetes.api.model.node.v1beta1.DoneableRuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClassList; import io.fabric8.kubernetes.client.*; @@ -75,29 +53,6 @@ import io.fabric8.openshift.api.model.ClusterNetworkList; import io.fabric8.openshift.api.model.DeploymentConfig; import io.fabric8.openshift.api.model.DeploymentConfigList; -import io.fabric8.openshift.api.model.DoneableBuild; -import io.fabric8.openshift.api.model.DoneableBuildConfig; -import io.fabric8.openshift.api.model.DoneableClusterNetwork; -import io.fabric8.openshift.api.model.DoneableDeploymentConfig; -import io.fabric8.openshift.api.model.DoneableEgressNetworkPolicy; -import io.fabric8.openshift.api.model.DoneableGroup; -import io.fabric8.openshift.api.model.DoneableImage; -import io.fabric8.openshift.api.model.DoneableImageStream; -import io.fabric8.openshift.api.model.DoneableImageStreamTag; -import io.fabric8.openshift.api.model.DoneableImageTag; -import io.fabric8.openshift.api.model.DoneableNetNamespace; -import io.fabric8.openshift.api.model.DoneableOAuthAccessToken; -import io.fabric8.openshift.api.model.DoneableOAuthAuthorizeToken; -import io.fabric8.openshift.api.model.DoneableOAuthClient; -import io.fabric8.openshift.api.model.DoneableClusterRoleBinding; -import io.fabric8.openshift.api.model.DoneableRangeAllocation; -import io.fabric8.openshift.api.model.DoneableRole; -import io.fabric8.openshift.api.model.DoneableRoleBinding; -import io.fabric8.openshift.api.model.DoneableRoute; -import io.fabric8.openshift.api.model.DoneableSecurityContextConstraints; -import io.fabric8.openshift.api.model.DoneableSubjectAccessReview; -import io.fabric8.openshift.api.model.DoneableTemplate; -import io.fabric8.openshift.api.model.DoneableUser; import io.fabric8.openshift.api.model.EgressNetworkPolicy; import io.fabric8.openshift.api.model.EgressNetworkPolicyList; import io.fabric8.openshift.api.model.Group; @@ -284,115 +239,115 @@ public OpenShiftOperatorHubAPIGroupDSL operatorHub() { } @Override - public MixedOperation> componentstatuses() { + public MixedOperation> componentstatuses() { return new ComponentStatusOperationsImpl(httpClient, getConfiguration()); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { return new OpenShiftNamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), is, null, true, DeletionPropagation.BACKGROUND) { }; } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata item) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata item) { return delegate.resource(item); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { return delegate.resource(s); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList item) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList item) { return new OpenShiftNamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), item, null, DeletionPropagation.BACKGROUND, true) { }; } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { return resourceList(new KubernetesListBuilder().withItems(items).build()); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { return delegate.resourceList(items); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { return new OpenShiftNamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl(httpClient, getConfiguration(), getNamespace(), null, false, false, new ArrayList<>(), s, null, DeletionPropagation.BACKGROUND, true) { }; } @Override - public MixedOperation> endpoints() { + public MixedOperation> endpoints() { return delegate.endpoints(); } @Override - public MixedOperation, DoneableBinding, Resource> bindings() { + public MixedOperation, Resource> bindings() { return delegate.bindings(); } @Override - public MixedOperation> events() { + public MixedOperation> events() { return delegate.events(); } @Override - public NonNamespaceOperation> namespaces() { + public NonNamespaceOperation> namespaces() { return delegate.namespaces(); } @Override - public NonNamespaceOperation> nodes() { + public NonNamespaceOperation> nodes() { return delegate.nodes(); } @Override - public NonNamespaceOperation> persistentVolumes() { + public NonNamespaceOperation> persistentVolumes() { return delegate.persistentVolumes(); } @Override - public MixedOperation> persistentVolumeClaims() { + public MixedOperation> persistentVolumeClaims() { return delegate.persistentVolumeClaims(); } @Override - public MixedOperation> pods() { + public MixedOperation> pods() { return delegate.pods(); } @Override - public MixedOperation> replicationControllers() { + public MixedOperation> replicationControllers() { return delegate.replicationControllers(); } @Override - public MixedOperation> resourceQuotas() { + public MixedOperation> resourceQuotas() { return delegate.resourceQuotas(); } @Override - public MixedOperation> secrets() { + public MixedOperation> secrets() { return delegate.secrets(); } @Override - public MixedOperation> services() { + public MixedOperation> services() { return delegate.services(); } @Override - public MixedOperation> serviceAccounts() { + public MixedOperation> serviceAccounts() { return delegate.serviceAccounts(); } @Override - public MixedOperation> apiServices() { + public MixedOperation> apiServices() { return delegate.apiServices(); } @@ -402,32 +357,32 @@ public KubernetesListMixedOperation lists() { } @Override - public MixedOperation> configMaps() { + public MixedOperation> configMaps() { return delegate.configMaps(); } @Override - public MixedOperation> limitRanges() { + public MixedOperation> limitRanges() { return delegate.limitRanges(); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass, Class doneClass) { - return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()).withCrdContext(crdContext).withType(resourceType).withListType(listClass).withDoneableType(doneClass)); + public > MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass) { + return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()).withCrdContext(crdContext).withType(resourceType).withListType(listClass)); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()).withCrd(crd).withType(resourceType).withListType(listClass).withDoneableType(doneClass)); + public > MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration()).withCrd(crd).withType(resourceType).withListType(listClass)); } @Override - public , D extends Doneable> MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return customResources(crd, resourceType, listClass); } @Override - public NonNamespaceOperation> customResourceDefinitions() { + public NonNamespaceOperation> customResourceDefinitions() { return new CustomResourceDefinitionOperationsImpl(httpClient, getConfiguration()); } @@ -437,7 +392,7 @@ public ApiextensionsAPIGroupDSL apiextensions() { } @Override - public NonNamespaceOperation> certificateSigningRequests() { + public NonNamespaceOperation> certificateSigningRequests() { return delegate.certificateSigningRequests(); } @@ -447,7 +402,7 @@ public AuthorizationAPIGroupDSL authorization() { } @Override - public Createable tokenReviews() { + public Createable tokenReviews() { return delegate.tokenReviews(); } @@ -456,57 +411,57 @@ public RawCustomResourceOperationsImpl customResource(CustomResourceDefinitionCo } @Override - public MixedOperation> builds() { + public MixedOperation> builds() { return new BuildOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> buildConfigs() { + public MixedOperation> buildConfigs() { return new BuildConfigOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> deploymentConfigs() { + public MixedOperation> deploymentConfigs() { return new DeploymentConfigOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> groups() { + public MixedOperation> groups() { return new GroupOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> images() { + public NonNamespaceOperation> images() { return new ImageOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> imageTags() { + public MixedOperation> imageTags() { return new ImageTagOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> imageStreams() { + public MixedOperation> imageStreams() { return new ImageStreamOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> imageStreamTags() { + public MixedOperation> imageStreamTags() { return new ImageStreamTagOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> oAuthAccessTokens() { + public NonNamespaceOperation> oAuthAccessTokens() { return new OAuthAccessTokenOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> oAuthAuthorizeTokens() { + public NonNamespaceOperation> oAuthAuthorizeTokens() { return new OAuthAuthorizeTokenOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> oAuthClients() { + public NonNamespaceOperation> oAuthClients() { return new OAuthClientOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @@ -521,12 +476,12 @@ public OpenShiftQuotaAPIGroupDSL quotas() { } @Override - public NonNamespaceOperation> rangeAllocations() { + public NonNamespaceOperation> rangeAllocations() { return new RangeAllocationOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> securityContextConstraints() { + public NonNamespaceOperation> securityContextConstraints() { return new SecurityContextConstraintsOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @@ -536,32 +491,32 @@ public ProjectRequestOperation projectrequests() { } @Override - public MixedOperation> roles() { + public MixedOperation> roles() { return new RoleOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> roleBindings() { + public MixedOperation> roleBindings() { return new RoleBindingOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> routes() { + public MixedOperation> routes() { return new RouteOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public ParameterMixedOperation> templates() { + public ParameterMixedOperation> templates() { return new TemplateOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> users() { + public MixedOperation> users() { return new UserOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> clusterRoleBindings() { + public MixedOperation> clusterRoleBindings() { return new ClusterRoleBindingOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @@ -600,7 +555,7 @@ public RunOperations run() { } @Override - public NonNamespaceOperation> runtimeClasses() { + public NonNamespaceOperation> runtimeClasses() { return delegate.runtimeClasses(); } @@ -623,17 +578,17 @@ public AutoscalingAPIGroupDSL autoscaling() { public OpenShiftMonitoringAPIGroupDSL monitoring() { return adapt(OpenShiftMonitoringAPIGroupClient.class); } @Override - public NonNamespaceOperation> netNamespaces() { + public NonNamespaceOperation> netNamespaces() { return new NetNamespaceOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> clusterNetworks() { + public NonNamespaceOperation> clusterNetworks() { return new ClusterNetworkOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> egressNetworkPolicies() { + public MixedOperation> egressNetworkPolicies() { return new EgressNetworkPolicyOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @@ -647,7 +602,7 @@ public MixedOperation subjectAccessReviews() { + public InOutCreateable subjectAccessReviews() { return new OpenShiftSubjectAccessReviewOperationsImpl(httpClient, getConfiguration(), "authorization.openshift.io", "v1", Utils.getPluralFromKind(SubjectAccessReview.class.getSimpleName())); } @@ -689,7 +644,7 @@ public LeaderElectorBuilder leaderElector() { * {@inheritDoc} */ @Override - public MixedOperation> leases() { + public MixedOperation> leases() { return new LeaseOperationsImpl(httpClient, getConfiguration()); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftClient.java index b43f5c82ef3..38989dd8232 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftClient.java @@ -22,29 +22,6 @@ import io.fabric8.kubernetes.client.VersionInfo; import io.fabric8.kubernetes.client.dsl.*; import io.fabric8.openshift.api.model.*; -import io.fabric8.openshift.api.model.DoneableBuild; -import io.fabric8.openshift.api.model.DoneableBuildConfig; -import io.fabric8.openshift.api.model.DoneableClusterNetwork; -import io.fabric8.openshift.api.model.DoneableClusterRoleBinding; -import io.fabric8.openshift.api.model.DoneableDeploymentConfig; -import io.fabric8.openshift.api.model.DoneableEgressNetworkPolicy; -import io.fabric8.openshift.api.model.DoneableGroup; -import io.fabric8.openshift.api.model.DoneableImage; -import io.fabric8.openshift.api.model.DoneableImageStream; -import io.fabric8.openshift.api.model.DoneableImageStreamTag; -import io.fabric8.openshift.api.model.DoneableImageTag; -import io.fabric8.openshift.api.model.DoneableNetNamespace; -import io.fabric8.openshift.api.model.DoneableOAuthAccessToken; -import io.fabric8.openshift.api.model.DoneableOAuthAuthorizeToken; -import io.fabric8.openshift.api.model.DoneableOAuthClient; -import io.fabric8.openshift.api.model.DoneableRangeAllocation; -import io.fabric8.openshift.api.model.DoneableRole; -import io.fabric8.openshift.api.model.DoneableRoleBinding; -import io.fabric8.openshift.api.model.DoneableRoute; -import io.fabric8.openshift.api.model.DoneableSecurityContextConstraints; -import io.fabric8.openshift.api.model.DoneableSubjectAccessReview; -import io.fabric8.openshift.api.model.DoneableTemplate; -import io.fabric8.openshift.api.model.DoneableUser; import io.fabric8.openshift.client.dsl.*; import java.net.URL; @@ -118,21 +95,21 @@ public interface OpenShiftClient extends KubernetesClient { * * @return NonNamespaceOperation instance for NetNamespace object */ - NonNamespaceOperation> netNamespaces(); + NonNamespaceOperation> netNamespaces(); /** * API entrypoint for handling ClusterNetwork(network.openshift.io/v1) * * @return NonNamespaceOperation instance for ClusterNetwork object */ - NonNamespaceOperation> clusterNetworks(); + NonNamespaceOperation> clusterNetworks(); /** * API entrypoint for handling EgressNetworkPolicy(network.openshift.io/v1) * * @return MixedOperation instance for EgressNetworkPolicy object */ - MixedOperation> egressNetworkPolicies(); + MixedOperation> egressNetworkPolicies(); /** * {@inheritDoc} @@ -169,77 +146,77 @@ public interface OpenShiftClient extends KubernetesClient { * * @return MixedOperation instance for Build object */ - MixedOperation> builds(); + MixedOperation> builds(); /** * API entrypoint for handling BuildConfig(build.openshift.io/v1) * * @return MixedOperation instance for BuildConfig object */ - MixedOperation> buildConfigs(); + MixedOperation> buildConfigs(); /** * API entrypoint for handling DeploymentConfig(apps.openshift.io/v1) * * @return MixedOperation instance for DeploymentConfig object */ - MixedOperation> deploymentConfigs(); + MixedOperation> deploymentConfigs(); /** * API entrypoint for handling Group(user.openshift.io/v1) * * @return NonNamespaceOperation instance for Group object */ - NonNamespaceOperation> groups(); + NonNamespaceOperation> groups(); /** * API entrypoint for accessing Image(image.openshift.io/v1) * * @return Non Namespace Operation object for Image */ - NonNamespaceOperation> images(); + NonNamespaceOperation> images(); /** * API entrypoint for accessing ImageTag(image.openshift.io/v1) * * @return MixedOperation object for ImageTag */ - MixedOperation> imageTags(); + MixedOperation> imageTags(); /** * API entrypoint for accessing ImageStream(image.openshift.io/v1) * * @return MixedOperation object for ImageStream */ - MixedOperation> imageStreams(); + MixedOperation> imageStreams(); /** * API entrypoint for accessing ImageStreamTag(image.openshift.io/v1) * * @return MixedOperation object for ImageStreamTag */ - MixedOperation> imageStreamTags(); + MixedOperation> imageStreamTags(); /** * API entrypoint for accessing OAuthAccessToken(oauth.openshift.io/v1) * * @return NonNamespaceOperation object for OAuthAccessToken */ - NonNamespaceOperation> oAuthAccessTokens(); + NonNamespaceOperation> oAuthAccessTokens(); /** * API entrypoint for accessing OAuthAuthorizeToken(oauth.openshift.io/v1) * * @return NonNamespaceOperation object for OAuthAuthorizeToken */ - NonNamespaceOperation> oAuthAuthorizeTokens(); + NonNamespaceOperation> oAuthAuthorizeTokens(); /** * API entrypoint for accessing OAuthClient(oauth.openshift.io/v1) * * @return NonNamespaceOperation object for OAuthClient */ - NonNamespaceOperation> oAuthClients(); + NonNamespaceOperation> oAuthClients(); /** * API entrypoint for accessing Project operations(project.openshift.io/v1) @@ -267,14 +244,14 @@ public interface OpenShiftClient extends KubernetesClient { * * @return MixedOperation object for Role */ - MixedOperation> roles(); + MixedOperation> roles(); /** * API entrypoint for accessing RoleBinding(authorization.openshift.io/v1) * * @return MixedOperation object for RoleBinding */ - MixedOperation> + MixedOperation> roleBindings(); /** @@ -282,37 +259,37 @@ public interface OpenShiftClient extends KubernetesClient { * * @return MixedOperation object for Route */ - MixedOperation> routes(); + MixedOperation> routes(); /** * API entrypoint for accessing Template(template.openshift.io/v1) * * @return {@link ParameterMixedOperation} object for Template operations */ - ParameterMixedOperation> templates(); + ParameterMixedOperation> templates(); /** * API entrypoint for accessing User(user.openshift.io/v1) * * @return NonNamespaceOperation object for User */ - NonNamespaceOperation> users(); + NonNamespaceOperation> users(); /** * API entrypoint for accessing RangeAllocation(security.openshift.io/v1) * * @return NonNamespaceOperation object for RangeAllocation */ - NonNamespaceOperation> rangeAllocations(); + NonNamespaceOperation> rangeAllocations(); /** * API entrypoint for accessing SecurityContextConstraints(security.openshift.io/v1) * * @return NonNamespaceOperation object for SecurityContextConstraints */ - NonNamespaceOperation> securityContextConstraints(); + NonNamespaceOperation> securityContextConstraints(); - Createable subjectAccessReviews(); + InOutCreateable subjectAccessReviews(); OpenShiftLocalSubjectAccessReviewOperationsImpl localSubjectAccessReviews(); @@ -321,7 +298,7 @@ public interface OpenShiftClient extends KubernetesClient { * * @return MixedOperation object for ClusterRoleBinding */ - MixedOperation> clusterRoleBindings(); + MixedOperation> clusterRoleBindings(); /** * Configure Request Config diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfigAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfigAPIGroupClient.java index 2c4078427db..153da6e47f1 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfigAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfigAPIGroupClient.java @@ -25,15 +25,6 @@ import io.fabric8.openshift.api.model.ClusterOperatorList; import io.fabric8.openshift.api.model.ClusterVersion; import io.fabric8.openshift.api.model.ClusterVersionList; -import io.fabric8.openshift.api.model.DoneableAPIServer; -import io.fabric8.openshift.api.model.DoneableClusterOperator; -import io.fabric8.openshift.api.model.DoneableClusterVersion; -import io.fabric8.openshift.api.model.DoneableFeatureGate; -import io.fabric8.openshift.api.model.DoneableInfrastructure; -import io.fabric8.openshift.api.model.DoneableOAuth; -import io.fabric8.openshift.api.model.DoneableOperatorHub; -import io.fabric8.openshift.api.model.DoneableProxy; -import io.fabric8.openshift.api.model.DoneableScheduler; import io.fabric8.openshift.api.model.FeatureGate; import io.fabric8.openshift.api.model.FeatureGateList; import io.fabric8.openshift.api.model.Infrastructure; @@ -68,47 +59,47 @@ public OpenShiftConfigAPIGroupClient(OkHttpClient httpClient, final Config confi } @Override - public NonNamespaceOperation> apiServers() { + public NonNamespaceOperation> apiServers() { return new APIServerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> clusterOperators() { + public NonNamespaceOperation> clusterOperators() { return new ClusterOperatorOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> clusterVersions() { + public NonNamespaceOperation> clusterVersions() { return new ClusterVersionOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> featureGates() { + public NonNamespaceOperation> featureGates() { return new FeatureGateOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> infrastructures() { + public NonNamespaceOperation> infrastructures() { return new InfrastructureOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> oAuths() { + public NonNamespaceOperation> oAuths() { return new OAuthOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> operatorHubs() { + public NonNamespaceOperation> operatorHubs() { return new OperatorHubOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> proxies() { + public NonNamespaceOperation> proxies() { return new ProxyOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> schedulers() { + public NonNamespaceOperation> schedulers() { return new SchedulerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConsoleAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConsoleAPIGroupClient.java index f964cc2e748..c6759708bd2 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConsoleAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConsoleAPIGroupClient.java @@ -29,11 +29,6 @@ import io.fabric8.openshift.api.model.console.v1.ConsoleNotificationList; import io.fabric8.openshift.api.model.console.v1.ConsoleYAMLSample; import io.fabric8.openshift.api.model.console.v1.ConsoleYAMLSampleList; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleCLIDownload; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleExternalLogLink; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleLink; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleNotification; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleYAMLSample; import io.fabric8.openshift.client.dsl.OpenShiftConsoleAPIGroupDSL; import io.fabric8.openshift.client.dsl.internal.ConsoleCLIDownloadOperationsImpl; import io.fabric8.openshift.client.dsl.internal.ConsoleExternalLogLinkOperationsImpl; @@ -52,27 +47,27 @@ public OpenShiftConsoleAPIGroupClient(OkHttpClient httpClient, final Config conf } @Override - public NonNamespaceOperation> consoleCLIDownloads() { + public NonNamespaceOperation> consoleCLIDownloads() { return new ConsoleCLIDownloadOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> consoleExternalLogLinks() { + public NonNamespaceOperation> consoleExternalLogLinks() { return new ConsoleExternalLogLinkOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> consoleLinks() { + public NonNamespaceOperation> consoleLinks() { return new ConsoleLinkOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> consoleNotifications() { + public NonNamespaceOperation> consoleNotifications() { return new ConsoleNotificationOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> consoleYAMLSamples() { + public NonNamespaceOperation> consoleYAMLSamples() { return new ConsoleYAMLSampleOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftLocalSubjectAccessReviewOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftLocalSubjectAccessReviewOperationsImpl.java index 78b42fbba5e..575676b7a63 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftLocalSubjectAccessReviewOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftLocalSubjectAccessReviewOperationsImpl.java @@ -17,11 +17,10 @@ import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.KubernetesClientException; -import io.fabric8.kubernetes.client.dsl.Createable; +import io.fabric8.kubernetes.client.dsl.InOutCreateable; import io.fabric8.kubernetes.client.dsl.Namespaceable; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.kubernetes.client.dsl.base.OperationSupport; -import io.fabric8.openshift.api.model.DoneableLocalSubjectAccessReview; import io.fabric8.openshift.api.model.LocalSubjectAccessReview; import io.fabric8.openshift.api.model.SubjectAccessReviewResponse; import okhttp3.OkHttpClient; @@ -29,7 +28,7 @@ import java.io.IOException; import java.util.concurrent.ExecutionException; -public class OpenShiftLocalSubjectAccessReviewOperationsImpl extends OperationSupport implements Createable, Namespaceable { +public class OpenShiftLocalSubjectAccessReviewOperationsImpl extends OperationSupport implements InOutCreateable, Namespaceable { private final String subjectAccessApiGroupName; private final String subjectAccessApiGroupVersion; private final String plural; @@ -79,11 +78,6 @@ public SubjectAccessReviewResponse create(LocalSubjectAccessReview item) { } } - @Override - public DoneableLocalSubjectAccessReview createNew() { - throw new IllegalStateException("This operation is not currently supported"); - } - @Override public OpenShiftLocalSubjectAccessReviewOperationsImpl inNamespace(String namespace) { this.namespace = namespace; diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftMonitoringAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftMonitoringAPIGroupClient.java index 346b3984d4f..0bec48264ef 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftMonitoringAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftMonitoringAPIGroupClient.java @@ -21,11 +21,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.openshift.api.model.monitoring.v1.Alertmanager; import io.fabric8.openshift.api.model.monitoring.v1.AlertmanagerList; -import io.fabric8.openshift.api.model.monitoring.v1.DoneableAlertmanager; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePodMonitor; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePrometheus; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePrometheusRule; -import io.fabric8.openshift.api.model.monitoring.v1.DoneableServiceMonitor; import io.fabric8.openshift.api.model.monitoring.v1.PodMonitor; import io.fabric8.openshift.api.model.monitoring.v1.PodMonitorList; import io.fabric8.openshift.api.model.monitoring.v1.Prometheus; @@ -52,27 +47,27 @@ public OpenShiftMonitoringAPIGroupClient(OkHttpClient httpClient, final Config c } @Override - public MixedOperation> prometheuses() { + public MixedOperation> prometheuses() { return new PrometheusOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> podMonitors() { + public MixedOperation> podMonitors() { return new PodMonitorOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> alertmanagers() { + public MixedOperation> alertmanagers() { return new AlertmanagerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> prometheusRules() { + public MixedOperation> prometheusRules() { return new PrometheusRuleOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> serviceMonitors() { + public MixedOperation> serviceMonitors() { return new ServiceMonitorOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorAPIGroupClient.java index d99590a49fe..03d2d5b27b9 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorAPIGroupClient.java @@ -30,24 +30,6 @@ import io.fabric8.openshift.api.model.operator.v1.DNSList; import io.fabric8.openshift.api.model.operator.v1.DNSRecord; import io.fabric8.openshift.api.model.operator.v1.DNSRecordList; -import io.fabric8.openshift.api.model.operator.v1.DoneableAuthentication; -import io.fabric8.openshift.api.model.operator.v1.DoneableCSISnapshotController; -import io.fabric8.openshift.api.model.operator.v1.DoneableConsole; -import io.fabric8.openshift.api.model.operator.v1.DoneableDNS; -import io.fabric8.openshift.api.model.operator.v1.DoneableDNSRecord; -import io.fabric8.openshift.api.model.operator.v1.DoneableEtcd; -import io.fabric8.openshift.api.model.operator.v1.DoneableImagePruner; -import io.fabric8.openshift.api.model.operator.v1.DoneableIngressController; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeControllerManager; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeScheduler; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeStorageVersionMigrator; -import io.fabric8.openshift.api.model.operator.v1.DoneableNetwork; -import io.fabric8.openshift.api.model.operator.v1.DoneableOpenShiftAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableOpenShiftControllerManager; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCA; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCatalogAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCatalogControllerManager; import io.fabric8.openshift.api.model.operator.v1.Etcd; import io.fabric8.openshift.api.model.operator.v1.EtcdList; import io.fabric8.openshift.api.model.operator.v1.ImagePruner; @@ -74,7 +56,6 @@ import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogAPIServerList; import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogControllerManager; import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogControllerManagerList; -import io.fabric8.openshift.api.model.operator.v1alpha1.DoneableImageContentSourcePolicy; import io.fabric8.openshift.api.model.operator.v1alpha1.ImageContentSourcePolicy; import io.fabric8.openshift.api.model.operator.v1alpha1.ImageContentSourcePolicyList; import io.fabric8.openshift.client.dsl.OpenShiftOperatorAPIGroupDSL; @@ -109,97 +90,97 @@ public OpenShiftOperatorAPIGroupClient(OkHttpClient httpClient, final Config con } @Override - public NonNamespaceOperation> etcds() { + public NonNamespaceOperation> etcds() { return new EtcdOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> kubeStorageVersionMigrators() { + public NonNamespaceOperation> kubeStorageVersionMigrators() { return new KubeStorageVersionMigratorOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> kubeControllerManagers() { + public NonNamespaceOperation> kubeControllerManagers() { return new KubeControllerManagerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> csiSnapshotControllers() { + public NonNamespaceOperation> csiSnapshotControllers() { return new CSISnapshotControllerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> networks() { + public NonNamespaceOperation> networks() { return new NetworkOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> kubeSchedulers() { + public NonNamespaceOperation> kubeSchedulers() { return new KubeSchedulerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> consoles() { + public NonNamespaceOperation> consoles() { return new ConsoleOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> serviceCatalogControllerManagers() { + public NonNamespaceOperation> serviceCatalogControllerManagers() { return new ServiceCatalogControllerManagerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> serviceCAs() { + public NonNamespaceOperation> serviceCAs() { return new ServiceCAOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> imageContentSourcePolicies() { + public NonNamespaceOperation> imageContentSourcePolicies() { return new ImageContentSourcePolicyOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> dnses() { + public NonNamespaceOperation> dnses() { return new DNSOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> dnsRecords() { + public MixedOperation> dnsRecords() { return new DNSRecordOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> openShiftControllerManagers() { + public NonNamespaceOperation> openShiftControllerManagers() { return new OpenShiftControllerManagerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> openShiftAPIServers() { + public NonNamespaceOperation> openShiftAPIServers() { return new OpenShiftAPIServerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> kubeAPIServers() { + public NonNamespaceOperation> kubeAPIServers() { return new KubeAPIServerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> ingressControllers() { + public MixedOperation> ingressControllers() { return new IngressControllerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> imagePruners() { + public NonNamespaceOperation> imagePruners() { return new ImagePrunerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> serviceCatalogAPIServers() { + public NonNamespaceOperation> serviceCatalogAPIServers() { return new ServiceCatalogAPIServerOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public NonNamespaceOperation> authentications() { + public NonNamespaceOperation> authentications() { return new AuthenticationOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorHubAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorHubAPIGroupClient.java index af9dd1a6c89..360027e6321 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorHubAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftOperatorHubAPIGroupClient.java @@ -19,17 +19,12 @@ import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.openshift.api.model.operatorhub.v1.DoneableOperatorGroup; import io.fabric8.openshift.api.model.operatorhub.v1.OperatorGroup; import io.fabric8.openshift.api.model.operatorhub.v1.OperatorGroupList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSource; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSourceList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.ClusterServiceVersion; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.ClusterServiceVersionList; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableCatalogSource; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableClusterServiceVersion; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableInstallPlan; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableSubscription; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.InstallPlan; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.InstallPlanList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription; @@ -52,27 +47,27 @@ public OpenShiftOperatorHubAPIGroupClient(OkHttpClient httpClient, final Config } @Override - public MixedOperation> catalogSources() { + public MixedOperation> catalogSources() { return new CatalogSourceOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> operatorGroups() { + public MixedOperation> operatorGroups() { return new OperatorGroupOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> subscriptions() { + public MixedOperation> subscriptions() { return new SubscriptionOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> installPlans() { + public MixedOperation> installPlans() { return new InstallPlanOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> clusterServiceVersions() { + public MixedOperation> clusterServiceVersions() { return new ClusterServiceVersionOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftQuotaAPIGroupClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftQuotaAPIGroupClient.java index 2d0dd65ffe9..2932c237ee6 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftQuotaAPIGroupClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftQuotaAPIGroupClient.java @@ -23,8 +23,6 @@ import io.fabric8.openshift.api.model.AppliedClusterResourceQuotaList; import io.fabric8.openshift.api.model.ClusterResourceQuota; import io.fabric8.openshift.api.model.ClusterResourceQuotaList; -import io.fabric8.openshift.api.model.DoneableAppliedClusterResourceQuota; -import io.fabric8.openshift.api.model.DoneableClusterResourceQuota; import io.fabric8.openshift.client.dsl.OpenShiftQuotaAPIGroupDSL; import io.fabric8.openshift.client.dsl.internal.AppliedClusterResourceQuotaOperationsImpl; import io.fabric8.openshift.client.dsl.internal.ClusterResourceQuotaOperationsImpl; @@ -40,12 +38,12 @@ public OpenShiftQuotaAPIGroupClient(OkHttpClient httpClient, final Config config } @Override - public MixedOperation> appliedClusterResourceQuotas() { + public MixedOperation> appliedClusterResourceQuotas() { return new AppliedClusterResourceQuotaOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } @Override - public MixedOperation> clusterResourceQuotas() { + public MixedOperation> clusterResourceQuotas() { return new ClusterResourceQuotaOperationsImpl(httpClient, OpenShiftConfig.wrap(getConfiguration())); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigOperation.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigOperation.java index b45fdab265d..2d2b0c246f6 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigOperation.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigOperation.java @@ -23,12 +23,11 @@ import io.fabric8.openshift.api.model.Build; import io.fabric8.openshift.api.model.BuildConfig; import io.fabric8.openshift.api.model.BuildConfigList; -import io.fabric8.openshift.api.model.DoneableBuildConfig; import io.fabric8.openshift.api.model.WebHookTrigger; import io.fabric8.openshift.client.dsl.buildconfig.CommitterAuthorMessageAsFileTimeoutInputStreamable; -public interface BuildConfigOperation extends BuildConfigResource, - MixedOperation>, +public interface BuildConfigOperation extends BuildConfigResource, + MixedOperation>, Typeable>, Triggerable, Secretable>>, diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigResource.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigResource.java index 22264d9097e..859a103d364 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigResource.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildConfigResource.java @@ -23,7 +23,7 @@ import io.fabric8.openshift.api.model.BuildRequest; import io.fabric8.openshift.api.model.WebHookTrigger; -public interface BuildConfigResource extends Resource, +public interface BuildConfigResource extends Resource, Instantiateable, Typeable>, Triggerable, diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildResource.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildResource.java index 93adc5e145a..bb2e81983e5 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildResource.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/BuildResource.java @@ -19,6 +19,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.TimestampBytesLimitTerminateTimeTailPrettyLoggable; -public interface BuildResource extends Resource, - TimestampBytesLimitTerminateTimeTailPrettyLoggable { +public interface BuildResource extends Resource, + TimestampBytesLimitTerminateTimeTailPrettyLoggable { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/DeployableScalableResource.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/DeployableScalableResource.java index 653a2be494d..4ace1d2a4ac 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/DeployableScalableResource.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/DeployableScalableResource.java @@ -17,6 +17,6 @@ import io.fabric8.kubernetes.client.dsl.ScalableResource; -public interface DeployableScalableResource extends ScalableResource, +public interface DeployableScalableResource extends ScalableResource, Deployable { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConfigAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConfigAPIGroupDSL.java index 85bf71e3d00..8b1a8859890 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConfigAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConfigAPIGroupDSL.java @@ -24,15 +24,6 @@ import io.fabric8.openshift.api.model.ClusterOperatorList; import io.fabric8.openshift.api.model.ClusterVersion; import io.fabric8.openshift.api.model.ClusterVersionList; -import io.fabric8.openshift.api.model.DoneableAPIServer; -import io.fabric8.openshift.api.model.DoneableClusterOperator; -import io.fabric8.openshift.api.model.DoneableClusterVersion; -import io.fabric8.openshift.api.model.DoneableFeatureGate; -import io.fabric8.openshift.api.model.DoneableInfrastructure; -import io.fabric8.openshift.api.model.DoneableOAuth; -import io.fabric8.openshift.api.model.DoneableOperatorHub; -import io.fabric8.openshift.api.model.DoneableProxy; -import io.fabric8.openshift.api.model.DoneableScheduler; import io.fabric8.openshift.api.model.FeatureGate; import io.fabric8.openshift.api.model.FeatureGateList; import io.fabric8.openshift.api.model.Infrastructure; @@ -52,53 +43,53 @@ public interface OpenShiftConfigAPIGroupDSL extends Client { * * @return NonNamespaceOperation object for APIServer type */ - NonNamespaceOperation> apiServers(); + NonNamespaceOperation> apiServers(); /** * API entrypoint for ClusterOperator related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for ClusterOperator type */ - NonNamespaceOperation> clusterOperators(); + NonNamespaceOperation> clusterOperators(); /** * API entrypoint for ClusterVersion related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for ClusterVersion type */ - NonNamespaceOperation> clusterVersions(); + NonNamespaceOperation> clusterVersions(); /** * API entrypoint for FeatureGate related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for FeatureGate type */ - NonNamespaceOperation> featureGates(); + NonNamespaceOperation> featureGates(); /** * API entrypoint for Infrastructure related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for Infrastructure type */ - NonNamespaceOperation> infrastructures(); + NonNamespaceOperation> infrastructures(); /** * API entrypoint for OAuth related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for OAuth type */ - NonNamespaceOperation> oAuths(); + NonNamespaceOperation> oAuths(); /** * API entrypoint for OperatorHub related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for OperatorHub type */ - NonNamespaceOperation> operatorHubs(); + NonNamespaceOperation> operatorHubs(); /** * API entrypoint for Proxy related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for Proxy type */ - NonNamespaceOperation> proxies(); + NonNamespaceOperation> proxies(); /** * API entrypoint for Scheduler related operations(config.openshift.io/v1) * * @return NonNamespaceOperation object for Scheduler type */ - NonNamespaceOperation> schedulers(); + NonNamespaceOperation> schedulers(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConsoleAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConsoleAPIGroupDSL.java index 5cb0fc802d4..9ad53e74374 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConsoleAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftConsoleAPIGroupDSL.java @@ -28,11 +28,6 @@ import io.fabric8.openshift.api.model.console.v1.ConsoleNotificationList; import io.fabric8.openshift.api.model.console.v1.ConsoleYAMLSample; import io.fabric8.openshift.api.model.console.v1.ConsoleYAMLSampleList; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleCLIDownload; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleExternalLogLink; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleLink; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleNotification; -import io.fabric8.openshift.api.model.console.v1.DoneableConsoleYAMLSample; public interface OpenShiftConsoleAPIGroupDSL extends Client { /** @@ -40,29 +35,29 @@ public interface OpenShiftConsoleAPIGroupDSL extends Client { * * @return NonNamespaceOperation object for ConsoleCLIDownload type */ - NonNamespaceOperation> consoleCLIDownloads(); + NonNamespaceOperation> consoleCLIDownloads(); /** * API entrypoint for ConsoleExternalLogLink related operations(console.openshift.io/v1) * * @return NonNamespaceOperation object for ConsoleExternalLogLink type */ - NonNamespaceOperation> consoleExternalLogLinks(); + NonNamespaceOperation> consoleExternalLogLinks(); /** * API entrypoint for ConsoleLink related operations(console.openshift.io/v1) * * @return NonNamespaceOperation object for ConsoleLink type */ - NonNamespaceOperation> consoleLinks(); + NonNamespaceOperation> consoleLinks(); /** * API entrypoint for ConsoleNotification related operations(console.openshift.io/v1) * * @return NonNamespaceOperation object for ConsoleNotification type */ - NonNamespaceOperation> consoleNotifications(); + NonNamespaceOperation> consoleNotifications(); /** * API entrypoint for ConsoleYAMLSample related operations(console.openshift.io/v1) * * @return NonNamespaceOperation object for ConsoleYAMLSample type */ - NonNamespaceOperation> consoleYAMLSamples(); + NonNamespaceOperation> consoleYAMLSamples(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftMonitoringAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftMonitoringAPIGroupDSL.java index afd53ef249f..ade0240429a 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftMonitoringAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftMonitoringAPIGroupDSL.java @@ -20,11 +20,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.openshift.api.model.monitoring.v1.Alertmanager; import io.fabric8.openshift.api.model.monitoring.v1.AlertmanagerList; -import io.fabric8.openshift.api.model.monitoring.v1.DoneableAlertmanager; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePodMonitor; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePrometheus; -import io.fabric8.openshift.api.model.monitoring.v1.DoneablePrometheusRule; -import io.fabric8.openshift.api.model.monitoring.v1.DoneableServiceMonitor; import io.fabric8.openshift.api.model.monitoring.v1.PodMonitor; import io.fabric8.openshift.api.model.monitoring.v1.PodMonitorList; import io.fabric8.openshift.api.model.monitoring.v1.Prometheus; @@ -40,29 +35,29 @@ public interface OpenShiftMonitoringAPIGroupDSL extends Client { * * @return MixedOperation object for Prometheus type */ - MixedOperation> prometheuses(); + MixedOperation> prometheuses(); /** * API entrypoint for PodMonitor related operations(monitoring.coreos.com/v1) * * @return MixedOperation object for PodMonitor type */ - MixedOperation> podMonitors(); + MixedOperation> podMonitors(); /** * API entrypoint for Alertmanager related operations(monitoring.coreos.com/v1) * * @return MixedOperation object for Alertmanager type */ - MixedOperation> alertmanagers(); + MixedOperation> alertmanagers(); /** * API entrypoint for PrometheusRule related operations(monitoring.coreos.com/v1) * * @return MixedOperation object for PrometheusRule type */ - MixedOperation> prometheusRules(); + MixedOperation> prometheusRules(); /** * API entrypoint for ServiceMonitor related operations(monitoring.coreos.com/v1) * * @return MixedOperation object for ServiceMonitor type */ - MixedOperation> serviceMonitors(); + MixedOperation> serviceMonitors(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorAPIGroupDSL.java index 44b6fc40395..656796a8fc6 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorAPIGroupDSL.java @@ -29,24 +29,6 @@ import io.fabric8.openshift.api.model.operator.v1.DNSList; import io.fabric8.openshift.api.model.operator.v1.DNSRecord; import io.fabric8.openshift.api.model.operator.v1.DNSRecordList; -import io.fabric8.openshift.api.model.operator.v1.DoneableAuthentication; -import io.fabric8.openshift.api.model.operator.v1.DoneableCSISnapshotController; -import io.fabric8.openshift.api.model.operator.v1.DoneableConsole; -import io.fabric8.openshift.api.model.operator.v1.DoneableDNS; -import io.fabric8.openshift.api.model.operator.v1.DoneableDNSRecord; -import io.fabric8.openshift.api.model.operator.v1.DoneableEtcd; -import io.fabric8.openshift.api.model.operator.v1.DoneableImagePruner; -import io.fabric8.openshift.api.model.operator.v1.DoneableIngressController; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeControllerManager; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeScheduler; -import io.fabric8.openshift.api.model.operator.v1.DoneableKubeStorageVersionMigrator; -import io.fabric8.openshift.api.model.operator.v1.DoneableNetwork; -import io.fabric8.openshift.api.model.operator.v1.DoneableOpenShiftAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableOpenShiftControllerManager; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCA; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCatalogAPIServer; -import io.fabric8.openshift.api.model.operator.v1.DoneableServiceCatalogControllerManager; import io.fabric8.openshift.api.model.operator.v1.Etcd; import io.fabric8.openshift.api.model.operator.v1.EtcdList; import io.fabric8.openshift.api.model.operator.v1.ImagePruner; @@ -73,7 +55,6 @@ import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogAPIServerList; import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogControllerManager; import io.fabric8.openshift.api.model.operator.v1.ServiceCatalogControllerManagerList; -import io.fabric8.openshift.api.model.operator.v1alpha1.DoneableImageContentSourcePolicy; import io.fabric8.openshift.api.model.operator.v1alpha1.ImageContentSourcePolicy; import io.fabric8.openshift.api.model.operator.v1alpha1.ImageContentSourcePolicyList; @@ -83,113 +64,113 @@ public interface OpenShiftOperatorAPIGroupDSL extends Client { * * @return NonNamespaceOperation object for Etcd type */ - NonNamespaceOperation> etcds(); + NonNamespaceOperation> etcds(); /** * API entrypoint for KubeStorageVersionMigrator related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for KubeStorageVersionMigrator type */ - NonNamespaceOperation> kubeStorageVersionMigrators(); + NonNamespaceOperation> kubeStorageVersionMigrators(); /** * API entrypoint for KubeControllerManager related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for KubeControllerManager type */ - NonNamespaceOperation> kubeControllerManagers(); + NonNamespaceOperation> kubeControllerManagers(); /** * API entrypoint for CSISnapshotController related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for CSISnapshotController type */ - NonNamespaceOperation> csiSnapshotControllers(); + NonNamespaceOperation> csiSnapshotControllers(); /** * API entrypoint for Network related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for Network type */ - NonNamespaceOperation> networks(); + NonNamespaceOperation> networks(); /** * API entrypoint for KubeScheduler related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for KubeScheduler type */ - NonNamespaceOperation> kubeSchedulers(); + NonNamespaceOperation> kubeSchedulers(); /** * API entrypoint for Console related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for Console type */ - NonNamespaceOperation> consoles(); + NonNamespaceOperation> consoles(); /** * API entrypoint for ServiceCatalogControllerManager related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for ServiceCatalogControllerManager type */ - NonNamespaceOperation> serviceCatalogControllerManagers(); + NonNamespaceOperation> serviceCatalogControllerManagers(); /** * API entrypoint for ServiceCA related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for ServiceCA type */ - NonNamespaceOperation> serviceCAs(); + NonNamespaceOperation> serviceCAs(); /** * API entrypoint for ImageContentSourcePolicy related operations(operator.openshift.io/v1alpha1) * * @return NonNamespaceOperation object for ImageContentSourcePolicy type */ - NonNamespaceOperation> imageContentSourcePolicies(); + NonNamespaceOperation> imageContentSourcePolicies(); /** * API entrypoint for DNS related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for DNS type */ - NonNamespaceOperation> dnses(); + NonNamespaceOperation> dnses(); /** * API entrypoint for DNSRecord related operations(operator.openshift.io/v1) * * @return MixedOperation object for DNSRecord type */ - MixedOperation> dnsRecords(); + MixedOperation> dnsRecords(); /** * API entrypoint for OpenShiftControllerManager related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for OpenShiftControllerManager type */ - NonNamespaceOperation> openShiftControllerManagers(); + NonNamespaceOperation> openShiftControllerManagers(); /** * API entrypoint for OpenShiftAPIServer related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for OpenShiftAPIServer type */ - NonNamespaceOperation> openShiftAPIServers(); + NonNamespaceOperation> openShiftAPIServers(); /** * API entrypoint for KubeAPIServer related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for KubeAPIServer type */ - NonNamespaceOperation> kubeAPIServers(); + NonNamespaceOperation> kubeAPIServers(); /** * API entrypoint for IngressController related operations(operator.openshift.io/v1) * * @return MixedOperation object for IngressController type */ - MixedOperation> ingressControllers(); + MixedOperation> ingressControllers(); /** * API entrypoint for ImagePruner related operations(imageregistry.operator.openshift.io/v1) * * @return NonNamespaceOperation object for ImagePruner type */ - NonNamespaceOperation> imagePruners(); + NonNamespaceOperation> imagePruners(); /** * API entrypoint for ServiceCatalogAPIServer related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for ServiceCatalogAPIServer type */ - NonNamespaceOperation> serviceCatalogAPIServers(); + NonNamespaceOperation> serviceCatalogAPIServers(); /** * API entrypoint for Authentication related operations(operator.openshift.io/v1) * * @return NonNamespaceOperation object for Authentication type */ - NonNamespaceOperation> authentications(); + NonNamespaceOperation> authentications(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorHubAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorHubAPIGroupDSL.java index f52f8c78e6c..f366283b4a7 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorHubAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftOperatorHubAPIGroupDSL.java @@ -18,17 +18,12 @@ import io.fabric8.kubernetes.client.Client; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.openshift.api.model.operatorhub.v1.DoneableOperatorGroup; import io.fabric8.openshift.api.model.operatorhub.v1.OperatorGroup; import io.fabric8.openshift.api.model.operatorhub.v1.OperatorGroupList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSource; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSourceList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.ClusterServiceVersion; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.ClusterServiceVersionList; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableCatalogSource; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableClusterServiceVersion; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableInstallPlan; -import io.fabric8.openshift.api.model.operatorhub.v1alpha1.DoneableSubscription; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.InstallPlan; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.InstallPlanList; import io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription; @@ -40,29 +35,29 @@ public interface OpenShiftOperatorHubAPIGroupDSL extends Client { * * @return MixedOperation object for CatalogSource type */ - MixedOperation> catalogSources(); + MixedOperation> catalogSources(); /** * API entrypoint for OperatorGroup related operations(operators.coreos.com/v1) * * @return MixedOperation object for OperatorGroup type */ - MixedOperation> operatorGroups(); + MixedOperation> operatorGroups(); /** * API entrypoint for Subscription related operations(operators.coreos.com/v1alpha1) * * @return MixedOperation object for Subscription type */ - MixedOperation> subscriptions(); + MixedOperation> subscriptions(); /** * API entrypoint for InstallPlan related operations(operators.coreos.com/v1alpha1) * * @return MixedOperation object for InstallPlan type */ - MixedOperation> installPlans(); + MixedOperation> installPlans(); /** * API entrypoint for CatalogSource related ClusterServiceVersion(operators.coreos.com/v1alpha1) * * @return MixedOperation object for ClusterServiceVersion type */ - MixedOperation> clusterServiceVersions(); + MixedOperation> clusterServiceVersions(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftQuotaAPIGroupDSL.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftQuotaAPIGroupDSL.java index 164ad5e0f30..b05b6ad54cc 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftQuotaAPIGroupDSL.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/OpenShiftQuotaAPIGroupDSL.java @@ -22,10 +22,8 @@ import io.fabric8.openshift.api.model.AppliedClusterResourceQuotaList; import io.fabric8.openshift.api.model.ClusterResourceQuota; import io.fabric8.openshift.api.model.ClusterResourceQuotaList; -import io.fabric8.openshift.api.model.DoneableAppliedClusterResourceQuota; -import io.fabric8.openshift.api.model.DoneableClusterResourceQuota; public interface OpenShiftQuotaAPIGroupDSL extends Client { - MixedOperation> appliedClusterResourceQuotas(); - MixedOperation> clusterResourceQuotas(); + MixedOperation> appliedClusterResourceQuotas(); + MixedOperation> clusterResourceQuotas(); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProcessableResource.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProcessableResource.java index 52ab5a24e6b..4361519dfd0 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProcessableResource.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProcessableResource.java @@ -17,6 +17,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; -public interface ProcessableResource extends Resource, +public interface ProcessableResource extends Resource, Processable { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectOperation.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectOperation.java index c1a0faa3721..1c3890d437d 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectOperation.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectOperation.java @@ -18,13 +18,12 @@ import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.fabric8.openshift.api.model.DoneableProject; import io.fabric8.openshift.api.model.Project; import io.fabric8.openshift.api.model.ProjectList; import java.util.List; -public interface ProjectOperation extends NonNamespaceOperation> { +public interface ProjectOperation extends NonNamespaceOperation> { /** * Creating Bootstrap Project Template * diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectRequestOperation.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectRequestOperation.java index d7ad5174769..45cef3380b4 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectRequestOperation.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/ProjectRequestOperation.java @@ -18,10 +18,9 @@ import io.fabric8.kubernetes.api.model.Status; import io.fabric8.kubernetes.client.dsl.Createable; import io.fabric8.kubernetes.client.dsl.Listable; -import io.fabric8.openshift.api.model.DoneableProjectRequest; import io.fabric8.openshift.api.model.ProjectRequest; public interface ProjectRequestOperation extends - Createable, + Createable, Listable { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateOperation.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateOperation.java index 371b3ed0976..a53099632fc 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateOperation.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateOperation.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.api.model.KubernetesList; import io.fabric8.kubernetes.client.dsl.ParameterMixedOperation; -import io.fabric8.openshift.api.model.DoneableTemplate; import io.fabric8.openshift.api.model.Template; import io.fabric8.openshift.api.model.TemplateList; -public interface TemplateOperation extends TemplateResource, - ParameterMixedOperation> { +public interface TemplateOperation extends TemplateResource, + ParameterMixedOperation> { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateResource.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateResource.java index 5c49d42bbff..84957fcf822 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateResource.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/TemplateResource.java @@ -15,6 +15,6 @@ */ package io.fabric8.openshift.client.dsl; -public interface TemplateResource extends ProcessableResource { +public interface TemplateResource extends ProcessableResource { } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildConfigOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildConfigOperationsImpl.java index 80c7e3e6f14..47c92693873 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildConfigOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildConfigOperationsImpl.java @@ -31,7 +31,6 @@ import io.fabric8.openshift.api.model.BuildConfigList; import io.fabric8.openshift.api.model.BuildList; import io.fabric8.openshift.api.model.BuildRequest; -import io.fabric8.openshift.api.model.DoneableBuildConfig; import io.fabric8.openshift.api.model.WebHookTrigger; import io.fabric8.openshift.client.OpenShiftConfig; import io.fabric8.openshift.client.dsl.BuildConfigOperation; @@ -66,8 +65,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.BUILD; -public class BuildConfigOperationsImpl extends OpenShiftOperation> +public class BuildConfigOperationsImpl extends OpenShiftOperation> implements BuildConfigOperation { private static final Logger logger = LoggerFactory.getLogger(BuildConfigOperationsImpl.class); @@ -98,7 +96,6 @@ public BuildConfigOperationsImpl(BuildConfigOperationContext context) { this.type = BuildConfig.class; this.listType = BuildConfigList.class; - this.doneableType = DoneableBuildConfig.class; this.triggerType = context.getTriggerType(); this.secret = context.getSecret(); @@ -164,7 +161,7 @@ public Triggerable withType(String triggerType) { } @Override - public BuildConfigResource withResourceVersion(String resourceVersion) { + public BuildConfigResource withResourceVersion(String resourceVersion) { return new BuildConfigOperationsImpl(getContext().withResourceVersion(resourceVersion)); } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildOperationsImpl.java index c0403298b86..eb15e03b644 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/BuildOperationsImpl.java @@ -15,7 +15,6 @@ */ package io.fabric8.openshift.client.dsl.internal; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.kubernetes.client.dsl.BytesLimitTerminateTimeTailPrettyLoggable; @@ -35,7 +34,6 @@ import okhttp3.OkHttpClient; import io.fabric8.openshift.api.model.Build; import io.fabric8.openshift.api.model.BuildList; -import io.fabric8.openshift.api.model.DoneableBuild; import io.fabric8.openshift.client.OpenShiftConfig; import okhttp3.Request; import okhttp3.Response; @@ -55,9 +53,9 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.BUILD; -public class BuildOperationsImpl extends OpenShiftOperation> implements - BuildResource { +public class BuildOperationsImpl extends OpenShiftOperation> implements + BuildResource { public static final String OPENSHIFT_IO_BUILD_NAME = "openshift.io/build.name"; private final InputStream in; @@ -89,7 +87,6 @@ public BuildOperationsImpl(BuildOperationContext context) { .withPlural("builds")); this.type = Build.class; this.listType = BuildList.class; - this.doneableType = DoneableBuild.class; this.in = context.getIn(); this.out = context.getOut(); @@ -209,54 +206,54 @@ public LogWatch watchLog(OutputStream out) { } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new BuildOperationsImpl((BuildOperationContext)context, logWaitTimeout); } @Override - public Loggable withPrettyOutput() { + public Loggable withPrettyOutput() { return new BuildOperationsImpl(getContext().withPrettyOutput(true)); } @Override - public PrettyLoggable tailingLines(int tailingLines) { + public PrettyLoggable tailingLines(int tailingLines) { return new BuildOperationsImpl(getContext().withTailingLines(tailingLines)); } @Override - public TimeTailPrettyLoggable terminated() { + public TimeTailPrettyLoggable terminated() { return new BuildOperationsImpl(getContext().withTerminatedStatus(true)); } @Override - public TailPrettyLoggable sinceTime(String sinceTimestamp) { + public TailPrettyLoggable sinceTime(String sinceTimestamp) { return new BuildOperationsImpl(getContext().withSinceTimestamp(sinceTimestamp)); } @Override - public TailPrettyLoggable sinceSeconds(int sinceSeconds) { + public TailPrettyLoggable sinceSeconds(int sinceSeconds) { return new BuildOperationsImpl(getContext().withSinceSeconds(sinceSeconds)); } @Override - public BytesLimitTerminateTimeTailPrettyLoggable limitBytes(int limitBytes) { + public BytesLimitTerminateTimeTailPrettyLoggable limitBytes(int limitBytes) { return new BuildOperationsImpl(getContext().withLimitBytes(limitBytes)); } @Override - public BytesLimitTerminateTimeTailPrettyLoggable usingTimestamps() { + public BytesLimitTerminateTimeTailPrettyLoggable usingTimestamps() { return new BuildOperationsImpl(getContext().withTimestamps(true)); } private void waitUntilBuildPodBecomesReady(Build build) { - List> podOps = PodOperationUtil.getPodOperationsForController(context, build.getMetadata().getUid(), + List> podOps = PodOperationUtil.getPodOperationsForController(context, build.getMetadata().getUid(), getBuildPodLabels(build), withPrettyOutput, podLogWaitTimeout); waitForBuildPodToBecomeReady(podOps, podLogWaitTimeout != null ? podLogWaitTimeout : DEFAULT_POD_LOG_WAIT_TIMEOUT); } - private static void waitForBuildPodToBecomeReady(List> podOps, Integer podLogWaitTimeout) { - for (PodResource podOp : podOps) { + private static void waitForBuildPodToBecomeReady(List> podOps, Integer podLogWaitTimeout) { + for (PodResource podOp : podOps) { PodOperationUtil.waitUntilReadyBeforeFetchingLogs(podOp, podLogWaitTimeout); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ClusterRoleBindingOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ClusterRoleBindingOperationsImpl.java index b9acd32952d..e012c1db663 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ClusterRoleBindingOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ClusterRoleBindingOperationsImpl.java @@ -20,12 +20,11 @@ import okhttp3.OkHttpClient; import io.fabric8.openshift.api.model.ClusterRoleBinding; import io.fabric8.openshift.api.model.ClusterRoleBindingList; -import io.fabric8.openshift.api.model.DoneableClusterRoleBinding; import io.fabric8.openshift.client.OpenShiftConfig; import static io.fabric8.openshift.client.OpenShiftAPIGroups.AUTHORIZATION; -public class ClusterRoleBindingOperationsImpl extends OpenShiftOperation> { +public class ClusterRoleBindingOperationsImpl extends OpenShiftOperation> { public ClusterRoleBindingOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -36,7 +35,6 @@ public ClusterRoleBindingOperationsImpl(OperationContext context) { .withPlural("clusterrolebindings")); this.type = ClusterRoleBinding.class; this.listType = ClusterRoleBindingList.class; - this.doneableType = DoneableClusterRoleBinding.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/DeploymentConfigOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/DeploymentConfigOperationsImpl.java index 8abf5efcebd..b2b8916dfc2 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/DeploymentConfigOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/DeploymentConfigOperationsImpl.java @@ -15,7 +15,6 @@ */ package io.fabric8.openshift.client.dsl.internal; -import io.fabric8.kubernetes.api.model.DoneablePod; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.autoscaling.v1.Scale; import io.fabric8.kubernetes.client.Config; @@ -42,6 +41,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Function; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Executors; @@ -54,14 +55,13 @@ import io.fabric8.kubernetes.client.utils.Utils; import io.fabric8.openshift.api.model.DeploymentConfig; import io.fabric8.openshift.api.model.DeploymentConfigList; -import io.fabric8.openshift.api.model.DoneableDeploymentConfig; import io.fabric8.openshift.client.dsl.DeployableScalableResource; import okhttp3.OkHttpClient; import static io.fabric8.openshift.client.OpenShiftAPIGroups.APPS; -public class DeploymentConfigOperationsImpl extends OpenShiftOperation> implements DeployableScalableResource { +public class DeploymentConfigOperationsImpl extends OpenShiftOperation> implements DeployableScalableResource { private static final Logger LOG = LoggerFactory.getLogger(DeploymentConfigOperationsImpl.class); private static final Integer DEFAULT_POD_LOG_WAIT_TIMEOUT = 5; @@ -76,7 +76,6 @@ public DeploymentConfigOperationsImpl(RollingOperationContext context) { super(context.withApiGroupName(APPS).withPlural("deploymentconfigs")); this.type = DeploymentConfig.class; this.listType = DeploymentConfigList.class; - this.doneableType = DoneableDeploymentConfig.class; } private DeploymentConfigOperationsImpl(RollingOperationContext context, Integer podLogWaitTimeout) { @@ -90,13 +89,22 @@ public DeploymentConfigOperationsImpl newInstance(OperationContext context) { } @Override - public DoneableDeploymentConfig edit() { + public DeploymentConfig edit(Function function) { if (isCascading()) { - return cascading(false).edit(); + return cascading(false).edit(function); } - return super.edit(); + return super.edit(function); } + @Override + public DeploymentConfig accept(Consumer consumer) { + if (isCascading()) { + return cascading(false).accept(consumer); + } + return super.accept(consumer); + } + + @Override public DeploymentConfig replace(DeploymentConfig item) { if (isCascading()) { @@ -124,7 +132,8 @@ public DeploymentConfig deployLatest(boolean wait) { if(currentVersion == null){ currentVersion = 1L; } - DeploymentConfig deployment = cascading(false).edit().editStatus().withLatestVersion(++currentVersion).endStatus().done(); + final Long latestVersion = currentVersion + 1; + DeploymentConfig deployment = cascading(false).accept(d -> d.getStatus().setLatestVersion(latestVersion)); if (wait) { waitUntilDeploymentConfigIsScaled(deployment.getSpec().getReplicas()); deployment = getMandatory(); @@ -139,7 +148,7 @@ public DeploymentConfig scale(int count) { @Override public DeploymentConfig scale(int count, boolean wait) { - DeploymentConfig deployment = cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); + DeploymentConfig deployment = cascading(false).accept(d -> d.getSpec().setReplicas(count)); if (wait) { waitUntilDeploymentConfigIsScaled(count); deployment = getMandatory(); @@ -276,19 +285,19 @@ private HttpUrl getResourceLogUrl(Boolean withPrettyOutput, Boolean follow) thro } @Override - public Loggable withLogWaitTimeout(Integer logWaitTimeout) { + public Loggable withLogWaitTimeout(Integer logWaitTimeout) { return new DeploymentConfigOperationsImpl((RollingOperationContext)context, podLogWaitTimeout); } private void waitUntilDeploymentConfigPodBecomesReady(DeploymentConfig deploymentConfig) { - List> podOps = PodOperationUtil.getPodOperationsForController(context, deploymentConfig.getMetadata().getUid(), + List> podOps = PodOperationUtil.getPodOperationsForController(context, deploymentConfig.getMetadata().getUid(), getDeploymentConfigPodLabels(deploymentConfig), false, podLogWaitTimeout); waitForBuildPodToBecomeReady(podOps, podLogWaitTimeout != null ? podLogWaitTimeout : DEFAULT_POD_LOG_WAIT_TIMEOUT); } - private static void waitForBuildPodToBecomeReady(List> podOps, Integer podLogWaitTimeout) { - for (PodResource podOp : podOps) { + private static void waitForBuildPodToBecomeReady(List> podOps, Integer podLogWaitTimeout) { + for (PodResource podOp : podOps) { PodOperationUtil.waitUntilReadyBeforeFetchingLogs(podOp, podLogWaitTimeout); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/GroupOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/GroupOperationsImpl.java index 3bb6ebc1afa..7d1ec50cbc3 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/GroupOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/GroupOperationsImpl.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableGroup; import io.fabric8.openshift.api.model.Group; import io.fabric8.openshift.api.model.GroupList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -28,7 +27,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.USER; -public class GroupOperationsImpl extends OpenShiftOperation> { +public class GroupOperationsImpl extends OpenShiftOperation> { public GroupOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -39,7 +38,6 @@ public GroupOperationsImpl(OperationContext context) { .withPlural("groups")); this.type = Group.class; this.listType = GroupList.class; - this.doneableType = DoneableGroup.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAccessTokenOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAccessTokenOperationsImpl.java index bb88f9291f0..863d5fc3931 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAccessTokenOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAccessTokenOperationsImpl.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableOAuthAccessToken; import io.fabric8.openshift.api.model.OAuthAccessToken; import io.fabric8.openshift.api.model.OAuthAccessTokenList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -26,8 +25,8 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.OAUTH; -public class OAuthAccessTokenOperationsImpl extends OpenShiftOperation> { +public class OAuthAccessTokenOperationsImpl extends OpenShiftOperation> { public OAuthAccessTokenOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -38,7 +37,6 @@ public OAuthAccessTokenOperationsImpl(OperationContext context) { .withPlural("oauthaccesstokens")); this.type = OAuthAccessToken.class; this.listType = OAuthAccessTokenList.class; - this.doneableType = DoneableOAuthAccessToken.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAuthorizeTokenOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAuthorizeTokenOperationsImpl.java index d3426030f5e..9803476ee04 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAuthorizeTokenOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthAuthorizeTokenOperationsImpl.java @@ -19,7 +19,6 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.openshift.api.model.OAuthAccessToken; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableOAuthAuthorizeToken; import io.fabric8.openshift.api.model.OAuthAuthorizeToken; import io.fabric8.openshift.api.model.OAuthAuthorizeTokenList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -30,8 +29,8 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.AUTHORIZATION; import static io.fabric8.openshift.client.OpenShiftAPIGroups.OAUTH; -public class OAuthAuthorizeTokenOperationsImpl extends OpenShiftOperation> { +public class OAuthAuthorizeTokenOperationsImpl extends OpenShiftOperation> { public OAuthAuthorizeTokenOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -42,7 +41,6 @@ public OAuthAuthorizeTokenOperationsImpl(OperationContext context) { .withPlural("oauthauthorizetokens")); this.type = OAuthAuthorizeToken.class; this.listType = OAuthAuthorizeTokenList.class; - this.doneableType = DoneableOAuthAuthorizeToken.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthClientOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthClientOperationsImpl.java index c4b74b610ba..984cc8f8c1f 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthClientOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OAuthClientOperationsImpl.java @@ -18,7 +18,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableOAuthClient; import io.fabric8.openshift.api.model.OAuthClient; import io.fabric8.openshift.api.model.OAuthClientList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -28,8 +27,8 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.OAUTH; -public class OAuthClientOperationsImpl extends OpenShiftOperation> { +public class OAuthClientOperationsImpl extends OpenShiftOperation> { public OAuthClientOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -40,7 +39,6 @@ public OAuthClientOperationsImpl(OperationContext context) { .withPlural("oauthclients")); this.type = OAuthClient.class; this.listType = OAuthClientList.class; - this.doneableType = DoneableOAuthClient.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftOperation.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftOperation.java index f1d4d210b59..eaa48012301 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftOperation.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftOperation.java @@ -15,7 +15,6 @@ */ package io.fabric8.openshift.client.dsl.internal; -import io.fabric8.kubernetes.api.model.Doneable; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.client.Config; @@ -34,8 +33,8 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; -public class OpenShiftOperation, D extends Doneable, R extends Resource> - extends HasMetadataOperation { +public class OpenShiftOperation, R extends Resource> + extends HasMetadataOperation { public static final String OPENSHIFT_APIGROUP_SUFFIX = "openshift.io"; diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftSubjectAccessReviewOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftSubjectAccessReviewOperationsImpl.java index c366404ead8..e77f1f9993e 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftSubjectAccessReviewOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/OpenShiftSubjectAccessReviewOperationsImpl.java @@ -17,10 +17,9 @@ import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.KubernetesClientException; -import io.fabric8.kubernetes.client.dsl.Createable; +import io.fabric8.kubernetes.client.dsl.InOutCreateable; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.kubernetes.client.dsl.base.OperationSupport; -import io.fabric8.openshift.api.model.DoneableSubjectAccessReview; import io.fabric8.openshift.api.model.SubjectAccessReview; import io.fabric8.openshift.api.model.SubjectAccessReviewResponse; import okhttp3.OkHttpClient; @@ -29,7 +28,7 @@ import java.util.concurrent.ExecutionException; -public class OpenShiftSubjectAccessReviewOperationsImpl extends OperationSupport implements Createable { +public class OpenShiftSubjectAccessReviewOperationsImpl extends OperationSupport implements InOutCreateable { public OpenShiftSubjectAccessReviewOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural) { this(new OperationContext().withOkhttpClient(client).withConfig(config), apiGroupName, apiGroupVersion, plural); @@ -73,11 +72,6 @@ public SubjectAccessReviewResponse create(SubjectAccessReview item) { } } - @Override - public DoneableSubjectAccessReview createNew() { - throw new IllegalStateException("This operation is not currently supported"); - } - @Override public boolean isResourceNamespaced() { return false; diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectOperationsImpl.java index a4b11f77b93..7b708fc6e20 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectOperationsImpl.java @@ -25,7 +25,6 @@ import io.fabric8.openshift.api.model.ProjectBuilder; import io.fabric8.openshift.client.dsl.ProjectOperation; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableProject; import io.fabric8.openshift.api.model.Project; import io.fabric8.openshift.api.model.ProjectList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -35,8 +34,8 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.PROJECT; -public class ProjectOperationsImpl extends OpenShiftOperation> implements ProjectOperation { +public class ProjectOperationsImpl extends OpenShiftOperation> implements ProjectOperation { public static final String OPENSHIFT_IO_DESCRIPTION_ANNOTATION = "openshift.io/description"; public static final String OPENSHIFT_IO_DISPLAY_NAME_ANNOTATION = "openshift.io/display-name"; public static final String OPENSHIFT_IO_REQUESTER_ANNOTATION = "openshift.io/requester"; @@ -53,7 +52,6 @@ public ProjectOperationsImpl(OperationContext context) { .withPlural("projects")); this.type = Project.class; this.listType = ProjectList.class; - this.doneableType = DoneableProject.class; } @Override public ProjectOperationsImpl newInstance(OperationContext context) { diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectRequestsOperationImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectRequestsOperationImpl.java index 92315fd2649..7cc5ccb569a 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectRequestsOperationImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/ProjectRequestsOperationImpl.java @@ -22,7 +22,6 @@ import io.fabric8.kubernetes.client.dsl.base.OperationContext; import io.fabric8.kubernetes.client.dsl.base.OperationSupport; import io.fabric8.kubernetes.client.utils.Utils; -import io.fabric8.openshift.api.model.DoneableProjectRequest; import io.fabric8.openshift.api.model.ProjectRequest; import io.fabric8.openshift.client.OpenShiftConfig; import io.fabric8.openshift.client.dsl.ProjectRequestOperation; @@ -102,17 +101,6 @@ public ProjectRequest create(ProjectRequest resource) { return create(new ProjectRequest[]{resource}); } - @Override - public DoneableProjectRequest createNew() { - return new DoneableProjectRequest(item -> { - try { - return create(item); - } catch (Exception e) { - throw KubernetesClientException.launderThrowable(e); - } - }); - } - @Override public Status list() { try { diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleBindingOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleBindingOperationsImpl.java index db9f1b6af70..d7948d80e04 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleBindingOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleBindingOperationsImpl.java @@ -20,7 +20,6 @@ import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.openshift.api.model.DoneableRoleBinding; import io.fabric8.openshift.api.model.RoleBinding; import io.fabric8.openshift.api.model.RoleBindingBuilder; import io.fabric8.openshift.api.model.RoleBindingList; @@ -33,7 +32,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.AUTHORIZATION; -public class RoleBindingOperationsImpl extends OpenShiftOperation> { +public class RoleBindingOperationsImpl extends OpenShiftOperation> { public static final String SERVICE_ACCOUNT = "ServiceAccount"; public static final String USER = "User"; @@ -48,7 +47,6 @@ public RoleBindingOperationsImpl(OperationContext context) { .withPlural("rolebindings")); this.type = RoleBinding.class; this.listType = RoleBindingList.class; - this.doneableType = DoneableRoleBinding.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleOperationsImpl.java index 4e923863786..b6bfc27ae91 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/RoleOperationsImpl.java @@ -17,7 +17,6 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.openshift.api.model.DoneableRole; import io.fabric8.openshift.api.model.Role; import io.fabric8.openshift.api.model.RoleList; import io.fabric8.openshift.client.OpenShiftConfig; @@ -25,7 +24,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.AUTHORIZATION; -public class RoleOperationsImpl extends OpenShiftOperation> { +public class RoleOperationsImpl extends OpenShiftOperation> { public RoleOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this((new OperationContext()).withOkhttpClient(client).withConfig(config)); @@ -35,7 +34,6 @@ public RoleOperationsImpl(OperationContext context) { super(context.withApiGroupName(AUTHORIZATION).withApiGroupVersion("v1").withPlural("roles")); this.type = Role.class; this.listType = RoleList.class; - this.doneableType = DoneableRole.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/SecurityContextConstraintsOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/SecurityContextConstraintsOperationsImpl.java index 3e705d7293a..f0db3be81df 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/SecurityContextConstraintsOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/SecurityContextConstraintsOperationsImpl.java @@ -16,7 +16,6 @@ package io.fabric8.openshift.client.dsl.internal; import io.fabric8.kubernetes.client.dsl.base.OperationContext; -import io.fabric8.openshift.api.model.DoneableSecurityContextConstraints; import io.fabric8.openshift.api.model.SecurityContextConstraints; import io.fabric8.openshift.api.model.SecurityContextConstraintsList; import io.fabric8.kubernetes.client.dsl.Resource; @@ -28,7 +27,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.SECURITY; -public class SecurityContextConstraintsOperationsImpl extends OpenShiftOperation> { +public class SecurityContextConstraintsOperationsImpl extends OpenShiftOperation> { public SecurityContextConstraintsOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -39,7 +38,6 @@ public SecurityContextConstraintsOperationsImpl(OperationContext context) { .withPlural("securitycontextconstraints")); this.type = SecurityContextConstraints.class; this.listType = SecurityContextConstraintsList.class; - this.doneableType = DoneableSecurityContextConstraints.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/TemplateOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/TemplateOperationsImpl.java index 5145d90bf06..b4ad663dfef 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/TemplateOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/TemplateOperationsImpl.java @@ -27,7 +27,6 @@ import io.fabric8.kubernetes.client.utils.Serialization; import io.fabric8.kubernetes.client.utils.URLUtils; import io.fabric8.kubernetes.client.utils.Utils; -import io.fabric8.openshift.api.model.DoneableTemplate; import io.fabric8.openshift.api.model.Parameter; import io.fabric8.openshift.api.model.Template; import io.fabric8.openshift.api.model.TemplateBuilder; @@ -59,7 +58,7 @@ import static io.fabric8.openshift.client.OpenShiftAPIGroups.TEMPLATE; public class TemplateOperationsImpl - extends OpenShiftOperation> + extends OpenShiftOperation> implements TemplateOperation { private static final Logger logger = LoggerFactory.getLogger(TemplateOperationsImpl.class); @@ -79,7 +78,6 @@ public TemplateOperationsImpl(TemplateOperationContext context) { this.parameters = context.getParameters(); this.type = Template.class; this.listType = TemplateList.class; - this.doneableType = DoneableTemplate.class; } @Override public TemplateOperationsImpl newInstance(OperationContext context) { @@ -164,7 +162,7 @@ public KubernetesList processLocally(ParameterValue... values) { } @Override - public MixedOperation> withParameters(Map parameters) { + public MixedOperation> withParameters(Map parameters) { return new TemplateOperationsImpl(getContext().withParameters(parameters)); } @@ -233,7 +231,7 @@ private URL getProcessUrl() throws MalformedURLException { } @Override - public TemplateResource load(InputStream is) { + public TemplateResource load(InputStream is) { String generatedName = Utils.randomString("template-", 10); Template template = null; Object item = Serialization.unmarshal(is, parameters); diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/UserOperationsImpl.java b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/UserOperationsImpl.java index 77f65b10c4c..7c0bfe81286 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/UserOperationsImpl.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/dsl/internal/UserOperationsImpl.java @@ -18,14 +18,13 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.base.OperationContext; import okhttp3.OkHttpClient; -import io.fabric8.openshift.api.model.DoneableUser; import io.fabric8.openshift.api.model.User; import io.fabric8.openshift.api.model.UserList; import io.fabric8.openshift.client.OpenShiftConfig; import static io.fabric8.openshift.client.OpenShiftAPIGroups.USER; -public class UserOperationsImpl extends OpenShiftOperation> { +public class UserOperationsImpl extends OpenShiftOperation> { public UserOperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config)); @@ -36,7 +35,6 @@ public UserOperationsImpl(OperationContext context) { .withPlural("users")); this.type = User.class; this.listType = UserList.class; - this.doneableType = DoneableUser.class; } @Override diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java index 600c23648a1..43fba9ee828 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java @@ -17,24 +17,16 @@ package io.fabric8.openshift.client.osgi; import io.fabric8.kubernetes.api.model.*; -import io.fabric8.kubernetes.api.model.DoneableAPIService; import io.fabric8.kubernetes.api.model.Event; -import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.EventList; -import io.fabric8.kubernetes.api.model.DoneableSecret; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList; -import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.DoneableCustomResourceDefinition; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequest; import io.fabric8.kubernetes.api.model.certificates.CertificateSigningRequestList; -import io.fabric8.kubernetes.api.model.certificates.DoneableCertificateSigningRequest; -import io.fabric8.kubernetes.api.model.authentication.DoneableTokenReview; import io.fabric8.kubernetes.api.model.authentication.TokenReview; -import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; -import io.fabric8.kubernetes.api.model.node.v1beta1.DoneableRuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClass; import io.fabric8.kubernetes.api.model.node.v1beta1.RuntimeClassList; import io.fabric8.kubernetes.client.AdmissionRegistrationAPIGroupDSL; @@ -50,15 +42,6 @@ import io.fabric8.kubernetes.client.utils.URLUtils; import io.fabric8.kubernetes.client.informers.SharedInformerFactory; import io.fabric8.openshift.api.model.*; -import io.fabric8.openshift.api.model.DoneableClusterNetwork; -import io.fabric8.openshift.api.model.DoneableEgressNetworkPolicy; -import io.fabric8.openshift.api.model.DoneableImage; -import io.fabric8.openshift.api.model.DoneableImageTag; -import io.fabric8.openshift.api.model.DoneableNetNamespace; -import io.fabric8.openshift.api.model.DoneableRangeAllocation; -import io.fabric8.openshift.api.model.DoneableRole; -import io.fabric8.openshift.api.model.DoneableRoleBinding; -import io.fabric8.openshift.api.model.DoneableSubjectAccessReview; import io.fabric8.openshift.client.DefaultOpenShiftClient; import io.fabric8.openshift.client.NamespacedOpenShiftClient; import io.fabric8.openshift.client.OpenShiftClient; @@ -220,63 +203,63 @@ public OpenShiftOperatorHubAPIGroupDSL operatorHub() { } @Override - public MixedOperation> builds() { + public MixedOperation> builds() { return delegate.builds(); } @Override - public MixedOperation> componentstatuses() { + public MixedOperation> componentstatuses() { return delegate.componentstatuses(); } @Override - public MixedOperation> buildConfigs() { + public MixedOperation> buildConfigs() { return delegate.buildConfigs(); } @Override - public MixedOperation> deploymentConfigs() { + public MixedOperation> deploymentConfigs() { return delegate.deploymentConfigs(); } @Override - public NonNamespaceOperation> groups() { + public NonNamespaceOperation> groups() { return delegate.groups(); } @Override - public NonNamespaceOperation> images() { + public NonNamespaceOperation> images() { return delegate.images(); } @Override - public MixedOperation> imageTags() { + public MixedOperation> imageTags() { return delegate.imageTags(); } @Override - public MixedOperation> imageStreams() { + public MixedOperation> imageStreams() { return delegate.imageStreams(); } @Override - public MixedOperation> imageStreamTags() { + public MixedOperation> imageStreamTags() { return delegate.imageStreamTags(); } @Override - public NonNamespaceOperation> oAuthAccessTokens() { + public NonNamespaceOperation> oAuthAccessTokens() { return delegate.oAuthAccessTokens(); } @Override - public NonNamespaceOperation> oAuthAuthorizeTokens() { + public NonNamespaceOperation> oAuthAuthorizeTokens() { return delegate.oAuthAuthorizeTokens(); } @Override - public NonNamespaceOperation> oAuthClients() { + public NonNamespaceOperation> oAuthClients() { return delegate.oAuthClients(); } @@ -296,137 +279,137 @@ public ProjectRequestOperation projectrequests() { } @Override - public MixedOperation> roles() { + public MixedOperation> roles() { return delegate.roles(); } @Override - public MixedOperation> roleBindings() { + public MixedOperation> roleBindings() { return delegate.roleBindings(); } @Override - public MixedOperation> routes() { + public MixedOperation> routes() { return delegate.routes(); } @Override - public ParameterMixedOperation> templates() { + public ParameterMixedOperation> templates() { return delegate.templates(); } @Override - public NonNamespaceOperation> users() { + public NonNamespaceOperation> users() { return delegate.users(); } @Override - public MixedOperation> clusterRoleBindings() { + public MixedOperation> clusterRoleBindings() { return delegate.clusterRoleBindings(); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { return delegate.load(is); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { return delegate.resourceList(is); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(HasMetadata... items) { return delegate.resourceList(items); } @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { + public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(Collection items) { return delegate.resourceList(items); } @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { + public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { return delegate.resourceList(s); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata item) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(HasMetadata item) { return delegate.resource(item); } @Override - public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { + public NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicable resource(String s) { return delegate.resource(s); } @Override - public MixedOperation> endpoints() { + public MixedOperation> endpoints() { return delegate.endpoints(); } @Override - public MixedOperation, DoneableBinding, Resource> bindings() { + public MixedOperation, Resource> bindings() { return delegate.bindings(); } @Override - public MixedOperation> events() { + public MixedOperation> events() { return delegate.events(); } @Override - public NonNamespaceOperation> namespaces() { + public NonNamespaceOperation> namespaces() { return delegate.namespaces(); } @Override - public NonNamespaceOperation> nodes() { + public NonNamespaceOperation> nodes() { return delegate.nodes(); } @Override - public NonNamespaceOperation> persistentVolumes() { + public NonNamespaceOperation> persistentVolumes() { return delegate.persistentVolumes(); } @Override - public MixedOperation> persistentVolumeClaims() { + public MixedOperation> persistentVolumeClaims() { return delegate.persistentVolumeClaims(); } @Override - public MixedOperation> pods() { + public MixedOperation> pods() { return delegate.pods(); } @Override - public MixedOperation> replicationControllers() { + public MixedOperation> replicationControllers() { return delegate.replicationControllers(); } @Override - public MixedOperation> resourceQuotas() { + public MixedOperation> resourceQuotas() { return delegate.resourceQuotas(); } @Override - public MixedOperation> secrets() { + public MixedOperation> secrets() { return delegate.secrets(); } @Override - public MixedOperation> services() { + public MixedOperation> services() { return delegate.services(); } @Override - public MixedOperation> serviceAccounts() { + public MixedOperation> serviceAccounts() { return delegate.serviceAccounts(); } @Override - public MixedOperation> apiServices() { + public MixedOperation> apiServices() { return delegate.apiServices(); } @@ -436,42 +419,42 @@ public KubernetesListMixedOperation lists() { } @Override - public NonNamespaceOperation> rangeAllocations() { + public NonNamespaceOperation> rangeAllocations() { return delegate.rangeAllocations(); } @Override - public NonNamespaceOperation> securityContextConstraints() { + public NonNamespaceOperation> securityContextConstraints() { return delegate.securityContextConstraints(); } @Override - public MixedOperation> configMaps() { + public MixedOperation> configMaps() { return delegate.configMaps(); } @Override - public MixedOperation> limitRanges() { + public MixedOperation> limitRanges() { return delegate.limitRanges(); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass, Class doneClass) { - return delegate.customResources(crdContext, resourceType, listClass, doneClass); + public > MixedOperation> customResources(CustomResourceDefinitionContext crdContext, Class resourceType, Class listClass) { + return delegate.customResources(crdContext, resourceType, listClass); } @Override - public , D extends Doneable> MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return delegate.customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResources(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return delegate.customResources(crd, resourceType, listClass); } @Override - public , D extends Doneable> MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass, Class doneClass) { - return customResources(crd, resourceType, listClass, doneClass); + public > MixedOperation> customResource(CustomResourceDefinition crd, Class resourceType, Class listClass) { + return customResources(crd, resourceType, listClass); } @Override - public NonNamespaceOperation> customResourceDefinitions() { + public NonNamespaceOperation> customResourceDefinitions() { return delegate.customResourceDefinitions(); } @@ -481,7 +464,7 @@ public ApiextensionsAPIGroupDSL apiextensions() { } @Override - public NonNamespaceOperation> certificateSigningRequests() { + public NonNamespaceOperation> certificateSigningRequests() { return delegate.certificateSigningRequests(); } @@ -491,7 +474,7 @@ public AuthorizationAPIGroupDSL authorization() { } @Override - public Createable tokenReviews() { + public Createable tokenReviews() { return delegate.tokenReviews(); } @@ -556,7 +539,7 @@ public RunOperations run() { } @Override - public NonNamespaceOperation> runtimeClasses() { + public NonNamespaceOperation> runtimeClasses() { return delegate.runtimeClasses(); } @@ -581,17 +564,17 @@ public OpenShiftMonitoringAPIGroupDSL monitoring() { } @Override - public NonNamespaceOperation> netNamespaces() { + public NonNamespaceOperation> netNamespaces() { return delegate.netNamespaces(); } @Override - public NonNamespaceOperation> clusterNetworks() { + public NonNamespaceOperation> clusterNetworks() { return delegate.clusterNetworks(); } @Override - public MixedOperation> egressNetworkPolicies() { + public MixedOperation> egressNetworkPolicies() { return delegate.egressNetworkPolicies(); } @@ -620,7 +603,7 @@ public MixedOperation subjectAccessReviews() { + public InOutCreateable subjectAccessReviews() { return delegate.subjectAccessReviews(); } @@ -641,7 +624,7 @@ public LeaderElectorBuilder leaderElector() { } @Override - public MixedOperation> leases() { + public MixedOperation> leases() { return delegate.leases(); } diff --git a/openshift-client/src/main/resources/resource-operation.vm b/openshift-client/src/main/resources/resource-operation.vm index e183c389455..19f8f1f8284 100644 --- a/openshift-client/src/main/resources/resource-operation.vm +++ b/openshift-client/src/main/resources/resource-operation.vm @@ -45,16 +45,14 @@ import io.fabric8.openshift.client.OpenShiftConfig; import okhttp3.OkHttpClient; -import ${model.packageName}.Doneable${model.name}; import ${model.packageName}.${model.name}; import ${model.packageName}.${model.name}List; -import ${model.packageName}.Doneable${model.name}; import java.util.Map; import java.util.TreeMap; -public class ${model.name}OperationsImpl extends OpenShiftOperation<${model.name}, ${model.name}List, Doneable${model.name}, Resource<${model.name}, Doneable${model.name}>> { +public class ${model.name}OperationsImpl extends OpenShiftOperation<${model.name}, ${model.name}List, Resource<${model.name}>> { public ${model.name}OperationsImpl(OkHttpClient client, OpenShiftConfig config) { this(new OperationContext().withOkhttpClient(client).withConfig(config).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY)); @@ -66,7 +64,6 @@ public class ${model.name}OperationsImpl extends OpenShiftOperation<${model.name .withPlural("#pluralize ($model.name.toLowerCase())")); this.type = ${model.name}.class; this.listType = ${model.name}List.class; - this.doneableType = Doneable${model.name}.class; } public ${model.name}OperationsImpl newInstance(OperationContext context) {