-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test (gradle-plugin/it) : Add test for setting ServiceAccount name in…
… generated controller (#2187) Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
0dde32e
commit c7e7818
Showing
10 changed files
with
504 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/build.gradle
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,43 @@ | ||
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() | ||
} | ||
|
||
kubernetes { | ||
offline = true | ||
images { | ||
image { | ||
name = 'repository/serviceaccountname-via-groovy-dsl:latest' | ||
build { | ||
from = 'quay.io/jkube/jkube-java-11' | ||
} | ||
} | ||
} | ||
resources { | ||
serviceAccount = "my-serviceaccount" | ||
} | ||
} | ||
|
||
openshift { | ||
offline = true | ||
images { | ||
image { | ||
name = 'repository/serviceaccountname-via-groovy-dsl:latest' | ||
build { | ||
from = 'quay.io/jkube/jkube-java-11' | ||
} | ||
} | ||
} | ||
resources { | ||
serviceAccount = "my-serviceaccount" | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...viceaccountname-via-groovy-dsl/expected/fragment-overriding-serviceaccount/kubernetes.yml
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,62 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccount-from-fragment | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: 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: serviceaccountname-via-groovy-dsl | ||
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/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: serviceaccount-from-fragment |
65 changes: 65 additions & 0 deletions
65
...rviceaccountname-via-groovy-dsl/expected/fragment-overriding-serviceaccount/openshift.yml
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,65 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccount-from-fragment | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: repository/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: serviceaccount-from-fragment |
53 changes: 53 additions & 0 deletions
53
...le-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/no-fragment/kubernetes.yml
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,53 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: 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: serviceaccountname-via-groovy-dsl | ||
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/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: my-serviceaccount |
56 changes: 56 additions & 0 deletions
56
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/no-fragment/openshift.yml
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,56 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: repository/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: my-serviceaccount |
53 changes: 53 additions & 0 deletions
53
...in/it/src/it/serviceaccountname-via-groovy-dsl/expected/unrelated-fragment/kubernetes.yml
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,53 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: 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: serviceaccountname-via-groovy-dsl | ||
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/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: my-serviceaccount |
56 changes: 56 additions & 0 deletions
56
...gin/it/src/it/serviceaccountname-via-groovy-dsl/expected/unrelated-fragment/openshift.yml
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,56 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- 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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: serviceaccountname-via-groovy-dsl | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
app: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
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: serviceaccountname-via-groovy-dsl | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: repository/serviceaccountname-via-groovy-dsl:latest | ||
imagePullPolicy: IfNotPresent | ||
name: repository-serviceaccountname-via-groovy-dsl | ||
securityContext: | ||
privileged: false | ||
serviceAccountName: my-serviceaccount |
Oops, something went wrong.