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.
feat (jkube-kit/enricher) : VolumePermissionEnricher : Use `.spec.sto…
…rageClassName` instead of annotation to set PersistentVolume class (eclipse-jkube#1361) VolumePermissionEnricher should now add StorageClass name in `.spec.storageClassName` field instead of an annotation in metadata. Add a new configuration field `useStorageClassAnnotation` in VolumePermissionEnricher configuration for backward compatibility. User can switch back to annotation by setting this field to `true`. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
9c076a1
commit 8123b4d
Showing
11 changed files
with
364 additions
and
19 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
117 changes: 117 additions & 0 deletions
117
...plugin/it/src/it/volume-permission/expected/custom-storageclass-annotation/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,117 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
jkube.io/iconUrl: "@ignore@" | ||
jkube.io/git-url: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
jkube.io/git-branch: "@ignore@" | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
expose: "true" | ||
group: org.eclipse.jkube.devops.apps | ||
name: jkube-docker-registry | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 5000 | ||
selector: | ||
app: jkube-docker-registry | ||
provider: jkube | ||
group: org.eclipse.jkube.devops.apps | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
annotations: | ||
volume.beta.kubernetes.io/storage-class: cheese | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: jkube-docker-registry-storage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
- apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
jkube.io/iconUrl: https://cdn.rawgit.com/jkubeio/jkube-devops/master/jkube-docker-registry/src/main/jkube/icon.png | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.devops.apps | ||
name: jkube-docker-registry | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
provider: jkube | ||
app: volume-permission | ||
group: org.eclipse.jkube.devops.apps | ||
template: | ||
metadata: | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.devops.apps | ||
name: volume-permission | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
image: registry:2 | ||
imagePullPolicy: IfNotPresent | ||
name: jkube-docker-registry | ||
ports: | ||
- containerPort: 5000 | ||
name: http | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" | ||
securityContext: | ||
privileged: false | ||
volumeMounts: | ||
- mountPath: /var/lib/registry | ||
name: jkube-docker-registry-storage | ||
readOnly: false | ||
initContainers: | ||
- command: | ||
- chmod | ||
- "777" | ||
- /var/lib/registry | ||
image: busybox | ||
imagePullPolicy: IfNotPresent | ||
name: jkube-volume-permission | ||
volumeMounts: | ||
- mountPath: /var/lib/registry | ||
name: jkube-docker-registry-storage | ||
volumes: | ||
- name: jkube-docker-registry-storage | ||
persistentVolumeClaim: | ||
claimName: jkube-docker-registry-storage |
152 changes: 152 additions & 0 deletions
152
...-plugin/it/src/it/volume-permission/expected/custom-storageclass-annotation/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,152 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
jkube.io/git-branch: "@ignore@" | ||
jkube.io/iconUrl: https://cdn.rawgit.com/jkubeio/jkube-devops/master/jkube-docker-registry/src/main/jkube/icon.png | ||
jkube.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
expose: "true" | ||
group: org.eclipse.jkube.devops.apps | ||
name: jkube-docker-registry | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 5000 | ||
selector: | ||
app: jkube-docker-registry | ||
provider: jkube | ||
group: org.eclipse.jkube.devops.apps | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
annotations: | ||
volume.beta.kubernetes.io/storage-class: cheese | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.integration.tests.gradle | ||
name: jkube-docker-registry-storage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
annotations: | ||
jkube.io/iconUrl: https://cdn.rawgit.com/jkubeio/jkube-devops/master/jkube-docker-registry/src/main/jkube/icon.png | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.devops.apps | ||
name: jkube-docker-registry | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
provider: jkube | ||
app: volume-permission | ||
group: org.eclipse.jkube.devops.apps | ||
strategy: | ||
rollingParams: | ||
timeoutSeconds: 3600 | ||
type: Rolling | ||
template: | ||
metadata: | ||
annotations: | ||
jkube.io/iconUrl: https://cdn.rawgit.com/jkubeio/jkube-devops/master/jkube-docker-registry/src/main/jkube/icon.png | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.devops.apps | ||
name: volume-permission | ||
spec: | ||
containers: | ||
- env: | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: registry:2 | ||
imagePullPolicy: IfNotPresent | ||
name: jkube-docker-registry | ||
ports: | ||
- containerPort: 5000 | ||
name: http | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" | ||
securityContext: | ||
privileged: false | ||
volumeMounts: | ||
- mountPath: /var/lib/registry | ||
name: jkube-docker-registry-storage | ||
readOnly: false | ||
initContainers: | ||
- command: | ||
- chmod | ||
- "777" | ||
- /var/lib/registry | ||
image: busybox | ||
imagePullPolicy: IfNotPresent | ||
name: jkube-volume-permission | ||
volumeMounts: | ||
- mountPath: /var/lib/registry | ||
name: jkube-docker-registry-storage | ||
volumes: | ||
- name: jkube-docker-registry-storage | ||
persistentVolumeClaim: | ||
claimName: jkube-docker-registry-storage | ||
triggers: | ||
- type: ConfigChange | ||
- imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- jkube-docker-registry | ||
from: | ||
kind: ImageStreamTag | ||
name: registry:2 | ||
type: ImageChange | ||
- apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
jkube.io/git-branch: "@ignore@" | ||
jkube.io/iconUrl: https://cdn.rawgit.com/jkubeio/jkube-devops/master/jkube-docker-registry/src/main/jkube/icon.png | ||
jkube.io/git-url: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.io/git-commit: "@ignore@" | ||
labels: | ||
app: volume-permission | ||
provider: jkube | ||
version: "@ignore@" | ||
group: org.eclipse.jkube.devops.apps | ||
name: jkube-docker-registry | ||
spec: | ||
port: | ||
targetPort: 80 | ||
to: | ||
kind: Service | ||
name: jkube-docker-registry |
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
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.