-
Notifications
You must be signed in to change notification settings - Fork 533
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) : WellKnownLabelEnricher also considers labe…
…ls added via resource configuration While adding labels and selectors to a resource, WellKnownLabelEnricher and ProjectLabelEnricher would give precedence to label configured via resource label XML/Groovy DSL configuration. This precedence would depend on the type of resource label configuration used. If `all` has been provided in configuration, this means precedence would be given for all resources. However, if some specific resource label configuration is used; precedence would only be given for that specific resource Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
51a80d3
commit ed4154b
Showing
10 changed files
with
547 additions
and
56 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
103 changes: 103 additions & 0 deletions
103
gradle-plugin/it/src/it/well-known-labels/expected/labelsViaResourceConfig/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,103 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-service | ||
group: via-resource-groovy-dsl-labels-service | ||
provider: via-resource-groovy-dsl-labels-service | ||
version: via-resource-groovy-dsl-labels-service | ||
name: well-known-labels | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-service | ||
group: via-resource-groovy-dsl-labels-service | ||
provider: via-resource-groovy-dsl-labels-service | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
version: via-resource-groovy-dsl-labels-all | ||
name: well-known-labels | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
template: | ||
metadata: | ||
annotations: | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
version: via-resource-groovy-dsl-labels-all | ||
name: well-known-labels | ||
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 |
144 changes: 144 additions & 0 deletions
144
gradle-plugin/it/src/it/well-known-labels/expected/labelsViaResourceConfig/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,144 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-service | ||
group: via-resource-groovy-dsl-labels-service | ||
provider: via-resource-groovy-dsl-labels-service | ||
version: via-resource-groovy-dsl-labels-service | ||
name: well-known-labels | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-service | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-service | ||
group: via-resource-groovy-dsl-labels-service | ||
provider: via-resource-groovy-dsl-labels-service | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
version: via-resource-groovy-dsl-labels-all | ||
name: well-known-labels | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
strategy: | ||
rollingParams: | ||
timeoutSeconds: 3600 | ||
type: Rolling | ||
template: | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: "@ignore@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
version: via-resource-groovy-dsl-labels-all | ||
name: well-known-labels | ||
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@" | ||
app.openshift.io/vcs-uri: "@ignore@" | ||
jkube.eclipse.org/git-branch: "@ignore@" | ||
jkube.eclipse.org/git-commit: "@ignore@" | ||
jkube.eclipse.org/git-url: "@ignore@" | ||
labels: | ||
app: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/component: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/managed-by: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/name: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/part-of: via-resource-groovy-dsl-labels-all | ||
app.kubernetes.io/version: via-resource-groovy-dsl-labels-all | ||
group: via-resource-groovy-dsl-labels-all | ||
provider: via-resource-groovy-dsl-labels-all | ||
version: via-resource-groovy-dsl-labels-all | ||
name: well-known-labels | ||
spec: | ||
port: | ||
targetPort: 8080 | ||
to: | ||
kind: Service | ||
name: well-known-labels |
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.