forked from eclipse-jkube/jkube
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 (eclipse-jkube#2187) Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
0dde32e
commit d6be6b8
Showing
10 changed files
with
500 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
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,57 @@ | ||
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" | ||
} | ||
enricher { | ||
config { | ||
'jkube-serviceaccount' { | ||
skipCreate = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
openshift { | ||
offline = true | ||
images { | ||
image { | ||
name = 'repository/serviceaccountname-via-groovy-dsl:latest' | ||
build { | ||
from = 'quay.io/jkube/jkube-java-11' | ||
} | ||
} | ||
} | ||
resources { | ||
serviceAccount = "my-serviceaccount" | ||
} | ||
enricher { | ||
config { | ||
'jkube-serviceaccount' { | ||
skipCreate = true | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...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,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: serviceaccount-from-fragment |
56 changes: 56 additions & 0 deletions
56
...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,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: serviceaccount-from-fragment |
53 changes: 53 additions & 0 deletions
53
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/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/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
...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 |
Oops, something went wrong.