This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add controller side changes and tests
Signed-off-by: Oscar Ward <[email protected]>
- Loading branch information
Oscar Ward
committed
Feb 14, 2024
1 parent
643edce
commit aba032b
Showing
23 changed files
with
880 additions
and
2 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
54 changes: 54 additions & 0 deletions
54
pkg/controller/defaults/testdata/memory/two-ccc-defaults-different-regions/existing.yaml
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 @@ | ||
--- | ||
kind: ClusterComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 1Mi # 1Mi | ||
supportedRegions: [local] | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ClusterComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class-other | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
supportedRegions: [non-local] | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 2Mi # 2Mi | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ProjectInstance | ||
apiVersion: internal.acorn.io/v1 | ||
metadata: | ||
name: app-namespace | ||
spec: {} | ||
status: | ||
defaultRegion: local | ||
supportedRegions: | ||
- local |
62 changes: 62 additions & 0 deletions
62
pkg/controller/defaults/testdata/memory/two-ccc-defaults-different-regions/expected.golden
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,62 @@ | ||
`apiVersion: internal.acorn.io/v1 | ||
kind: AppInstance | ||
metadata: | ||
creationTimestamp: null | ||
name: app-name | ||
namespace: app-namespace | ||
uid: 1234567890abcdef | ||
spec: | ||
image: test | ||
memory: | ||
oneimage: 1048576 | ||
status: | ||
appImage: | ||
buildContext: {} | ||
id: test | ||
imageData: {} | ||
vcs: {} | ||
appSpec: | ||
containers: | ||
oneimage: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: image-name | ||
metrics: {} | ||
ports: | ||
- port: 80 | ||
protocol: http | ||
targetPort: 81 | ||
probes: null | ||
sidecars: | ||
left: | ||
image: foo | ||
metrics: {} | ||
ports: | ||
- port: 90 | ||
protocol: tcp | ||
targetPort: 91 | ||
probes: null | ||
appStatus: {} | ||
columns: {} | ||
conditions: | ||
reason: Success | ||
status: "True" | ||
success: true | ||
type: defaults | ||
defaults: | ||
memory: | ||
"": 1048576 | ||
left: 1048576 | ||
oneimage: 1048576 | ||
region: local | ||
namespace: app-created-namespace | ||
observedGeneration: 1 | ||
resolvedOfferings: {} | ||
staged: | ||
appImage: | ||
buildContext: {} | ||
imageData: {} | ||
vcs: {} | ||
summary: {} | ||
` |
33 changes: 33 additions & 0 deletions
33
pkg/controller/defaults/testdata/memory/two-ccc-defaults-different-regions/input.yaml
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,33 @@ | ||
kind: AppInstance | ||
apiVersion: internal.acorn.io/v1 | ||
metadata: | ||
name: app-name | ||
namespace: app-namespace | ||
uid: 1234567890abcdef | ||
spec: | ||
image: test | ||
memory: | ||
oneimage: 1048576 # 1Mi | ||
status: | ||
observedGeneration: 1 | ||
namespace: app-created-namespace | ||
appImage: | ||
id: test | ||
appSpec: | ||
containers: | ||
oneimage: | ||
sidecars: | ||
left: | ||
image: "foo" | ||
ports: | ||
- port: 90 | ||
targetPort: 91 | ||
protocol: tcp | ||
ports: | ||
- port: 80 | ||
targetPort: 81 | ||
protocol: http | ||
image: "image-name" | ||
build: | ||
dockerfile: "Dockerfile" | ||
context: "." |
56 changes: 56 additions & 0 deletions
56
pkg/controller/defaults/testdata/memory/two-pcc-defaults-different-regions/existing.yaml
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 @@ | ||
--- | ||
kind: ProjectComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class | ||
namespace: app-namespace | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 1Mi # 1Mi | ||
supportedRegions: [local] | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ProjectComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class-other | ||
namespace: app-namespace | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
supportedRegions: [non-local] | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 2Mi # 2Mi | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ProjectInstance | ||
apiVersion: internal.acorn.io/v1 | ||
metadata: | ||
name: app-namespace | ||
spec: {} | ||
status: | ||
defaultRegion: local | ||
supportedRegions: | ||
- local |
62 changes: 62 additions & 0 deletions
62
pkg/controller/defaults/testdata/memory/two-pcc-defaults-different-regions/expected.golden
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,62 @@ | ||
`apiVersion: internal.acorn.io/v1 | ||
kind: AppInstance | ||
metadata: | ||
creationTimestamp: null | ||
name: app-name | ||
namespace: app-namespace | ||
uid: 1234567890abcdef | ||
spec: | ||
image: test | ||
memory: | ||
oneimage: 1048576 | ||
status: | ||
appImage: | ||
buildContext: {} | ||
id: test | ||
imageData: {} | ||
vcs: {} | ||
appSpec: | ||
containers: | ||
oneimage: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: image-name | ||
metrics: {} | ||
ports: | ||
- port: 80 | ||
protocol: http | ||
targetPort: 81 | ||
probes: null | ||
sidecars: | ||
left: | ||
image: foo | ||
metrics: {} | ||
ports: | ||
- port: 90 | ||
protocol: tcp | ||
targetPort: 91 | ||
probes: null | ||
appStatus: {} | ||
columns: {} | ||
conditions: | ||
reason: Success | ||
status: "True" | ||
success: true | ||
type: defaults | ||
defaults: | ||
memory: | ||
"": 0 | ||
left: 1048576 | ||
oneimage: 1048576 | ||
region: local | ||
namespace: app-created-namespace | ||
observedGeneration: 1 | ||
resolvedOfferings: {} | ||
staged: | ||
appImage: | ||
buildContext: {} | ||
imageData: {} | ||
vcs: {} | ||
summary: {} | ||
` |
33 changes: 33 additions & 0 deletions
33
pkg/controller/defaults/testdata/memory/two-pcc-defaults-different-regions/input.yaml
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,33 @@ | ||
kind: AppInstance | ||
apiVersion: internal.acorn.io/v1 | ||
metadata: | ||
name: app-name | ||
namespace: app-namespace | ||
uid: 1234567890abcdef | ||
spec: | ||
image: test | ||
memory: | ||
oneimage: 1048576 # 1Mi | ||
status: | ||
observedGeneration: 1 | ||
namespace: app-created-namespace | ||
appImage: | ||
id: test | ||
appSpec: | ||
containers: | ||
oneimage: | ||
sidecars: | ||
left: | ||
image: "foo" | ||
ports: | ||
- port: 90 | ||
targetPort: 91 | ||
protocol: tcp | ||
ports: | ||
- port: 80 | ||
targetPort: 81 | ||
protocol: http | ||
image: "image-name" | ||
build: | ||
dockerfile: "Dockerfile" | ||
context: "." |
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
54 changes: 54 additions & 0 deletions
54
.../resolvedofferings/testdata/computeclass/two-ccc-defaults-different-regions/existing.yaml
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 @@ | ||
--- | ||
kind: ClusterComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
supportedRegions: [local] | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 1Mi # 1Mi | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ClusterComputeClassInstance | ||
apiVersion: internal.admin.acorn.io/v1 | ||
metadata: | ||
name: sample-compute-class-other | ||
description: Simple description for a simple ComputeClass | ||
cpuScaler: 0.25 | ||
default: true | ||
supportedRegions: [non-local] | ||
memory: | ||
min: 1Mi # 1Mi | ||
max: 2Mi # 2Mi | ||
default: 2Mi # 2Mi | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: foo | ||
operator: In | ||
values: | ||
- bar | ||
--- | ||
kind: ProjectInstance | ||
apiVersion: internal.acorn.io/v1 | ||
metadata: | ||
name: app-namespace | ||
spec: {} | ||
status: | ||
defaultRegion: local | ||
supportedRegions: | ||
- local |
Oops, something went wrong.