Search in sources :

Example 1 with ClusterRoleBinding

use of io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding in project syndesis-qe by syndesisio.

the class Jaeger method processResources.

private void processResources() {
    for (String jaegerResource : JAEGER_RESOURCES) {
        // version 1.20.0 ==> repo v1.20.0
        jaegerResource = String.format(jaegerResource, "v" + TestConfiguration.jaegerVersion());
        log.info("Processing " + jaegerResource);
        try (InputStream is = new URL(jaegerResource).openStream()) {
            List<HasMetadata> resources = OpenShiftUtils.getInstance().load(is).get();
            // Change the namespace in the resources to the current
            for (HasMetadata resource : resources) {
                if (resource instanceof ClusterRoleBinding) {
                    for (Subject subject : ((ClusterRoleBinding) resource).getSubjects()) {
                        subject.setNamespace(TestConfiguration.openShiftNamespace());
                    }
                }
                resource.getMetadata().setNamespace(TestConfiguration.openShiftNamespace());
                processedResources.add(resource);
                // change docker image to quay
                if (resource instanceof Deployment) {
                    ((Deployment) resource).getSpec().getTemplate().getSpec().getContainers().get(0).setImage("quay.io/jaegertracing/jaeger-operator:" + TestConfiguration.jaegerVersion());
                }
            }
        } catch (IOException e) {
            fail("Unable to process Jaeger resource " + jaegerResource, e);
        }
    }
}
Also used : HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) InputStream(java.io.InputStream) ClusterRoleBinding(io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) IOException(java.io.IOException) URL(java.net.URL) Subject(io.fabric8.kubernetes.api.model.rbac.Subject)

Example 2 with ClusterRoleBinding

use of io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding in project jointware by isdream.

the class KubernetesKeyValueStyleGeneratorTest method testOpenShiftWithAllKind.

protected static void testOpenShiftWithAllKind() throws Exception {
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Policy());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Group());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new User());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new OAuthClient());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new ClusterRoleBinding());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new ImageStreamTag());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new ImageStream());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Build());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new BuildConfig());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new RoleBinding());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Route());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new PolicyBinding());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new OAuthAuthorizeToken());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Role());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new Project());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new OAuthAccessToken());
    info(OPENSHIFT_KIND, OpenShiftDocumentKeyValueStyleGenerator.class.getName(), new DeploymentConfig());
}
Also used : NetworkPolicy(io.fabric8.kubernetes.api.model.extensions.NetworkPolicy) Policy(io.fabric8.openshift.api.model.Policy) Group(io.fabric8.openshift.api.model.Group) User(io.fabric8.openshift.api.model.User) OAuthClient(io.fabric8.openshift.api.model.OAuthClient) ClusterRoleBinding(io.fabric8.openshift.api.model.ClusterRoleBinding) ImageStreamTag(io.fabric8.openshift.api.model.ImageStreamTag) ImageStream(io.fabric8.openshift.api.model.ImageStream) PolicyBinding(io.fabric8.openshift.api.model.PolicyBinding) OAuthAuthorizeToken(io.fabric8.openshift.api.model.OAuthAuthorizeToken) Role(io.fabric8.openshift.api.model.Role) Project(io.fabric8.openshift.api.model.Project) Build(io.fabric8.openshift.api.model.Build) OpenShiftDocumentKeyValueStyleGenerator(com.github.isdream.chameleon.docs.OpenShiftDocumentKeyValueStyleGenerator) BuildConfig(io.fabric8.openshift.api.model.BuildConfig) OAuthAccessToken(io.fabric8.openshift.api.model.OAuthAccessToken) ClusterRoleBinding(io.fabric8.openshift.api.model.ClusterRoleBinding) RoleBinding(io.fabric8.openshift.api.model.RoleBinding) DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig) Route(io.fabric8.openshift.api.model.Route)

Aggregations

OpenShiftDocumentKeyValueStyleGenerator (com.github.isdream.chameleon.docs.OpenShiftDocumentKeyValueStyleGenerator)1 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)1 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)1 NetworkPolicy (io.fabric8.kubernetes.api.model.extensions.NetworkPolicy)1 ClusterRoleBinding (io.fabric8.kubernetes.api.model.rbac.ClusterRoleBinding)1 Subject (io.fabric8.kubernetes.api.model.rbac.Subject)1 Build (io.fabric8.openshift.api.model.Build)1 BuildConfig (io.fabric8.openshift.api.model.BuildConfig)1 ClusterRoleBinding (io.fabric8.openshift.api.model.ClusterRoleBinding)1 DeploymentConfig (io.fabric8.openshift.api.model.DeploymentConfig)1 Group (io.fabric8.openshift.api.model.Group)1 ImageStream (io.fabric8.openshift.api.model.ImageStream)1 ImageStreamTag (io.fabric8.openshift.api.model.ImageStreamTag)1 OAuthAccessToken (io.fabric8.openshift.api.model.OAuthAccessToken)1 OAuthAuthorizeToken (io.fabric8.openshift.api.model.OAuthAuthorizeToken)1 OAuthClient (io.fabric8.openshift.api.model.OAuthClient)1 Policy (io.fabric8.openshift.api.model.Policy)1 PolicyBinding (io.fabric8.openshift.api.model.PolicyBinding)1 Project (io.fabric8.openshift.api.model.Project)1 Role (io.fabric8.openshift.api.model.Role)1