forked from eclipse-jkube/jkube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix (jkube-kit/enricher) : Move ServiceAccount addition to ServiceAcc…
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
dc10bdf
commit e78198e
Showing
26 changed files
with
771 additions
and
98 deletions.
There are no files selected for viewing
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
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" | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/default/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,54 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
jkube.io/git-url: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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.io/git-url: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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: | ||
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 |
67 changes: 67 additions & 0 deletions
67
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/default/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,67 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
jkube.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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: | ||
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 | ||
triggers: | ||
- type: ConfigChange | ||
- imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- repository-serviceaccountname-via-groovy-dsl | ||
from: | ||
kind: ImageStreamTag | ||
name: serviceaccountname-via-groovy-dsl:latest | ||
type: ImageChange |
53 changes: 53 additions & 0 deletions
53
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/fragments/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.io/git-url: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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.io/git-url: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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 |
58 changes: 58 additions & 0 deletions
58
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/expected/fragments/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,58 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
jkube.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/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 | ||
triggers: | ||
- type: ConfigChange |
16 changes: 16 additions & 0 deletions
16
gradle-plugin/it/src/it/serviceaccountname-via-groovy-dsl/fragmentdir/deployment.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,16 @@ | ||
# | ||
# 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 | ||
# | ||
|
||
spec: | ||
replicas: 1 |
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
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
Oops, something went wrong.