Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #271 from silotrd/master
Browse files Browse the repository at this point in the history
[ISSUE #270] Bug fixed, OAM example can not run correctlly.
  • Loading branch information
wonderflow authored Oct 27, 2020
2 parents ad311db + cd573e5 commit 4898d0c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 22 deletions.
4 changes: 2 additions & 2 deletions examples/component-versioning/component-mutable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
name: example-appconfig
spec:
components:
- revisionName: example-component-brkaek3ipt3d60vfo4u0
- revisionName: example-component-v1
traits:
- trait:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
spec:
replicaCount: 3
replicaCount: 3
16 changes: 15 additions & 1 deletion examples/dependency/demo-with-conditions.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dependency-clusterrole
labels:
rbac.oam.dev/aggregate-to-controller: "true"
rules:
- apiGroups:
- example.com
resources:
- 'foo'
verbs:
- '*'
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
Expand Down Expand Up @@ -43,4 +57,4 @@ spec:
- valueFrom:
dataOutputName: example-key
toFieldPaths:
- "spec.key"
- "spec.key"
20 changes: 18 additions & 2 deletions examples/dependency/demo-with-valuefrom.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dependency-clusterrole
labels:
rbac.oam.dev/aggregate-to-controller: "true"
rules:
- apiGroups:
- example.com
resources:
- 'foo'
verbs:
- '*'
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
Expand Down Expand Up @@ -28,6 +42,8 @@ apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
name: example-appconfig
labels:
state: running
spec:
components:
- componentName: source
Expand All @@ -37,11 +53,11 @@ spec:
conditions:
- op: eq
valueFrom:
fieldPath: metadata.annotations[oam.updateVersion]
fieldPath: metadata.labels[state]
fieldPath: "status.state"
- componentName: sink
dataInputs:
- valueFrom:
dataOutputName: example-key
toFieldPaths:
- "spec.key"
- "spec.key"
27 changes: 21 additions & 6 deletions examples/dependency/demo.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dependency-clusterrole
labels:
rbac.oam.dev/aggregate-to-controller: "true"
rules:
- apiGroups:
- example.com
resources:
- 'foo'
verbs:
- '*'
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
Expand All @@ -8,15 +22,16 @@ spec:
kind: Foo
metadata:
name: source
status: {}
# Uncomment the following and apply again will make dependency satisfied.
# status:
# key: test
status:
key:
- name: a
value: aa
- name: b
value: bb
# status:
# key:
# - name: a
# value: aa
# - name: b
# value: bb
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
Expand Down
27 changes: 20 additions & 7 deletions examples/flight-tracker/tracker-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ data:
endpoint: ZGItd29ya2xvYWQ=
password: ZGJwYXNzd29yZA==
username: cG9zdGdyZXM=

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: flight-tracker-clusterrole
labels:
rbac.oam.dev/aggregate-to-controller: "true"
rules:
- apiGroups:
- extensions
resources:
- 'ingresses'
verbs:
- '*'
---
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
Expand Down Expand Up @@ -43,15 +56,15 @@ spec:
- componentName: quakes-api
parameterValues:
- name: dataUri
value: "http://data-api.default.svc.cluster.local:3009/"
value: "http://data-api.default.svc.cluster.local:3009/"
traits:
- trait:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
metadata:
name: quakes-api
spec:
replicaCount: 2
replicaCount: 2
- componentName: weather-api
parameterValues:
- name: dataUri
Expand All @@ -63,7 +76,7 @@ spec:
metadata:
name: weather-api
spec:
replicaCount: 2
replicaCount: 2
- componentName: service-tracker-ui
parameterValues:
- name: flightsUri
Expand All @@ -79,6 +92,6 @@ spec:
metadata:
name: tracker-ingress
spec:
backend:
serviceName: web-ui
servicePort: 8080
backend:
serviceName: web-ui
servicePort: 8080
5 changes: 1 addition & 4 deletions examples/typed-component/sample_application_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ spec:
workloadRefs:
- apiVersion: core.oam.dev/v1alpha2
kind: ContainerizedWorkload
name: example-component
- apiVersion: core.oam.dev/v1alpha2
kind: ContainerizedWorkload
name: example-component2
name: web-service-component
---
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
Expand Down

0 comments on commit 4898d0c

Please sign in to comment.