-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #992 from piyush1594/iss_969
- Loading branch information
Showing
18 changed files
with
576 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../main/java/io/fabric8/kubernetes/client/dsl/internal/PodSecurityPolicyOperationsImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* 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.dsl.internal; | ||
|
||
import io.fabric8.kubernetes.client.dsl.Resource; | ||
import io.fabric8.kubernetes.api.model.extensions.PodSecurityPolicy; | ||
import io.fabric8.kubernetes.api.model.extensions.PodSecurityPolicyList; | ||
import io.fabric8.kubernetes.api.model.extensions.DoneablePodSecurityPolicy; | ||
import io.fabric8.kubernetes.client.Config; | ||
import okhttp3.OkHttpClient; | ||
import io.fabric8.kubernetes.client.dsl.base.HasMetadataOperation; | ||
|
||
import java.util.Map; | ||
import java.util.TreeMap; | ||
|
||
public class PodSecurityPolicyOperationsImpl extends HasMetadataOperation<PodSecurityPolicy, PodSecurityPolicyList, DoneablePodSecurityPolicy, Resource<PodSecurityPolicy, DoneablePodSecurityPolicy>>{ | ||
|
||
public PodSecurityPolicyOperationsImpl(OkHttpClient client, Config config, String namespace) { | ||
this(client, config, "v1beta1", namespace, null, true, null, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()); | ||
} | ||
|
||
public PodSecurityPolicyOperationsImpl(OkHttpClient client, Config config, String apiVersion, String namespace, String name, Boolean cascading,PodSecurityPolicy item, String resourceVersion, Boolean reloadingFromServer, long gracePeriodSeconds, Map<String, String> labels, Map<String, String> labelsNot, Map<String, String[]> labelsIn, Map<String, String[]> labelsNotIn, Map<String, String> fields) { | ||
super(client, config, "extensions", apiVersion, "podsecuritypolicies", namespace, name, cascading, item, resourceVersion, reloadingFromServer, gracePeriodSeconds, labels, labelsNot, labelsIn, labelsNotIn, fields); | ||
} | ||
|
||
@Override | ||
public boolean isResourceNamespaced() { | ||
return false; | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
...-client/src/main/java/io/fabric8/kubernetes/client/handlers/PodSecurityPolicyHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* 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.handlers; | ||
|
||
import io.fabric8.kubernetes.client.Watch; | ||
import io.fabric8.kubernetes.client.Watcher; | ||
import okhttp3.OkHttpClient; | ||
import io.fabric8.kubernetes.api.model.extensions.PodSecurityPolicy; | ||
import io.fabric8.kubernetes.api.model.extensions.PodSecurityPolicyBuilder; | ||
import io.fabric8.kubernetes.client.Config; | ||
import io.fabric8.kubernetes.client.ResourceHandler; | ||
import io.fabric8.kubernetes.client.dsl.internal.PodSecurityPolicyOperationsImpl; | ||
import org.apache.felix.scr.annotations.Component; | ||
import org.apache.felix.scr.annotations.Service; | ||
|
||
import java.util.TreeMap; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Component | ||
@Service | ||
public class PodSecurityPolicyHandler implements ResourceHandler<PodSecurityPolicy, PodSecurityPolicyBuilder> { | ||
|
||
@Override | ||
public String getKind() { | ||
return PodSecurityPolicy.class.getSimpleName(); | ||
} | ||
|
||
@Override | ||
public PodSecurityPolicy create(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).create(); | ||
} | ||
|
||
@Override | ||
public PodSecurityPolicy replace(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, true, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).replace(item); | ||
} | ||
|
||
@Override | ||
public PodSecurityPolicy reload(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).fromServer().get(); | ||
} | ||
|
||
@Override | ||
public PodSecurityPolicyBuilder edit(PodSecurityPolicy item) { | ||
return new PodSecurityPolicyBuilder(item); | ||
} | ||
|
||
@Override | ||
public Boolean delete(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).delete(item); | ||
} | ||
|
||
@Override | ||
public Watch watch(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item, Watcher<PodSecurityPolicy> watcher) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).watch(watcher); | ||
} | ||
|
||
@Override | ||
public Watch watch(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item, String resourceVersion, Watcher<PodSecurityPolicy> watcher) { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).watch(resourceVersion, watcher); | ||
} | ||
|
||
@Override | ||
public PodSecurityPolicy waitUntilReady(OkHttpClient client, Config config, String namespace, PodSecurityPolicy item, long amount, TimeUnit timeUnit) throws InterruptedException { | ||
return new PodSecurityPolicyOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).waitUntilReady(amount, timeUnit); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.