Skip to content

Commit 0efcdde

Browse files
authored
adding references to custom resources (#18)
Issue #, if available: aws-controllers-k8s/community#1472 Description of changes: Once we add resource reference, emr-containers jobruns can reference virtualcluster custom resources directly. This is more k8s friendly and avoids exporting and importing variables By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 45709dd commit 0efcdde

17 files changed

+150
-78
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2022-09-06T12:54:50Z"
3-
build_hash: 585f06bbd6d4cc1b738acb85901e7a009bf452c7
4-
go_version: go1.17.5
5-
version: v0.20.0
6-
api_directory_checksum: bc5fed2df0bfab2a176531654d33d69e8153dc42
2+
build_date: "2022-09-12T20:46:01Z"
3+
build_hash: 2944c8772f216656d84ee02d392eaca501274c1e
4+
go_version: go1.18.1
5+
version: v0.20.1
6+
api_directory_checksum: 2322dd513cbf25a6b2e4b99236b5f3ee0fb8c22e
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.42.0
99
generator_config_info:
10-
file_checksum: 7a666081b91b39305bf1eedcc9cc538703e34948
10+
file_checksum: 8452039ec1ac012add845247a98a2f640647b7b0
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ resources:
3434
fields:
3535
Name:
3636
is_immutable: true
37-
VirtualClusterID:
37+
VirtualClusterId:
3838
is_immutable: true
39+
references:
40+
resource: VirtualCluster
41+
path: Status.ID
3942
ExecutionRoleARN:
4043
is_immutable: true
4144
ReleaseLabel:

apis/v1alpha1/job_run.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/emrcontainers.services.k8s.aws_jobruns.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.7.0
6+
controller-gen.kubebuilder.io/version: v0.9.2
87
creationTimestamp: null
98
name: jobruns.emrcontainers.services.k8s.aws
109
spec:
@@ -73,11 +72,23 @@ spec:
7372
description: The virtual cluster ID for which the job run request
7473
is submitted.
7574
type: string
75+
virtualClusterRef:
76+
description: 'AWSResourceReferenceWrapper provides a wrapper around
77+
*AWSResourceReference type to provide more user friendly syntax
78+
for references using ''from'' field Ex: APIIDRef: from: name: my-api'
79+
properties:
80+
from:
81+
description: AWSResourceReference provides all the values necessary
82+
to reference another k8s resource for finding the identifier(Id/ARN/Name)
83+
properties:
84+
name:
85+
type: string
86+
type: object
87+
type: object
7688
required:
7789
- executionRoleARN
7890
- jobDriver
7991
- releaseLabel
80-
- virtualClusterID
8192
type: object
8293
status:
8394
description: JobRunStatus defines the observed state of JobRun
@@ -152,9 +163,3 @@ spec:
152163
storage: true
153164
subresources:
154165
status: {}
155-
status:
156-
acceptedNames:
157-
kind: ""
158-
plural: ""
159-
conditions: []
160-
storedVersions: []

config/crd/bases/emrcontainers.services.k8s.aws_virtualclusters.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.7.0
6+
controller-gen.kubebuilder.io/version: v0.9.2
87
creationTimestamp: null
98
name: virtualclusters.emrcontainers.services.k8s.aws
109
spec:
@@ -147,9 +146,3 @@ spec:
147146
storage: true
148147
subresources:
149148
status: {}
150-
status:
151-
acceptedNames:
152-
kind: ""
153-
plural: ""
154-
conditions: []
155-
storedVersions: []

config/crd/common/bases/services.k8s.aws_fieldexports.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ spec:
6666
description: FieldExportTarget provides the values necessary to identify
6767
the output path for a field export.
6868
properties:
69-
key:
70-
description: Key overrides the default value (`<namespace>.<FieldExport-resource-name>`)
71-
for the FieldExport target
72-
type: string
7369
kind:
7470
description: FieldExportOutputType represents all types that can
7571
be produced by a field export operation

config/iam/recommended-policy-arn

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/rbac/cluster-role-controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: rbac.authorization.k8s.io/v1
43
kind: ClusterRole

generator.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ resources:
3434
fields:
3535
Name:
3636
is_immutable: true
37-
VirtualClusterID:
37+
VirtualClusterId:
3838
is_immutable: true
39+
references:
40+
resource: VirtualCluster
41+
path: Status.ID
3942
ExecutionRoleARN:
4043
is_immutable: true
4144
ReleaseLabel:

0 commit comments

Comments
 (0)