Skip to content

Commit

Permalink
test (gradle-plugin/it) : Add Gradle Integration test for WellKnownLa…
Browse files Browse the repository at this point in the history
…belsEnricher

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia authored and manusa committed Jan 18, 2024
1 parent 6a64e3b commit 11c7048
Show file tree
Hide file tree
Showing 8 changed files with 804 additions and 0 deletions.
42 changes: 42 additions & 0 deletions gradle-plugin/it/src/it/well-known-labels/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2019 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at:
*
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
plugins {
id 'org.eclipse.jkube.kubernetes' version "${jKubeVersion}"
id 'org.eclipse.jkube.openshift' version "${jKubeVersion}"
id 'java'
}

group = 'org.eclipse.jkube.integration.tests.gradle'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
mavenCentral()
}

def extensionConfig = {
offline = true
images {
image {
name = 'repository/well-known-labels:latest'
build {
from = 'quay.io/jkube/jkube-java-11'
ports = ['8080']
}
}
}
}

kubernetes(extensionConfig)
openshift(extensionConfig)
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
- apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
template:
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
spec:
containers:
- env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
image: repository/well-known-labels:latest
imagePullPolicy: IfNotPresent
name: repository-well-known-labels
ports:
- containerPort: 8080
name: http
protocol: TCP
securityContext:
privileged: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
annotations:
app.openshift.io/vcs-ref: "@ignore@"
jkube.eclipse.org/git-url: "@ignore@"
app.openshift.io/vcs-uri: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
app.openshift.io/vcs-ref: "@ignore@"
jkube.eclipse.org/git-url: "@ignore@"
app.openshift.io/vcs-uri: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
strategy:
rollingParams:
timeoutSeconds: 3600
type: Rolling
template:
metadata:
annotations:
app.openshift.io/vcs-ref: "@ignore@"
jkube.eclipse.org/git-url: "@ignore@"
app.openshift.io/vcs-uri: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
spec:
containers:
- env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: repository/well-known-labels:latest
imagePullPolicy: IfNotPresent
name: repository-well-known-labels
ports:
- containerPort: 8080
name: http
protocol: TCP
securityContext:
privileged: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- repository-well-known-labels
from:
kind: ImageStreamTag
name: well-known-labels:latest
type: ImageChange
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
app.openshift.io/vcs-ref: "@ignore@"
jkube.eclipse.org/git-url: "@ignore@"
app.openshift.io/vcs-uri: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/component: custom-component
app.kubernetes.io/managed-by: custom-managed-by
app.kubernetes.io/name: custom-app
app.kubernetes.io/part-of: custom-part-of
app.kubernetes.io/version: "@ignore@"
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
port:
targetPort: 8080
to:
kind: Service
name: well-known-labels
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: well-known-labels
app.kubernetes.io/version: "@ignore@"
app.kubernetes.io/part-of: org.eclipse.jkube.integration.tests.gradle
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: well-known-labels
app.kubernetes.io/part-of: org.eclipse.jkube.integration.tests.gradle
- apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: well-known-labels
app.kubernetes.io/version: "@ignore@"
app.kubernetes.io/part-of: org.eclipse.jkube.integration.tests.gradle
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
name: well-known-labels
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: "well-known-labels"
provider: "jkube"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: well-known-labels
app.kubernetes.io/part-of: org.eclipse.jkube.integration.tests.gradle
template:
metadata:
annotations:
jkube.eclipse.org/git-url: "@ignore@"
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app: "well-known-labels"
provider: "jkube"
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: well-known-labels
app.kubernetes.io/version: "@ignore@"
app.kubernetes.io/part-of: org.eclipse.jkube.integration.tests.gradle
spec:
containers:
- env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
image: repository/well-known-labels:latest
imagePullPolicy: IfNotPresent
name: repository-well-known-labels
ports:
- containerPort: 8080
name: http
protocol: TCP
securityContext:
privileged: false
Loading

0 comments on commit 11c7048

Please sign in to comment.