Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test (gradle-plugin/it) : Add Gradle Integration test for WellKnownLabelsEnricher #2533

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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