Skip to content

Commit b94345e

Browse files
authored
Support JobRun ConfigurationOverrides field (#21)
Issue #, if available: aws-controllers-k8s/community#1445 Description of changes: - Support JobRun `ConfigurationOverrides` field By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d97de75 commit b94345e

File tree

18 files changed

+226
-17
lines changed

18 files changed

+226
-17
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2022-09-12T20:46:01Z"
2+
build_date: "2022-10-26T14:38:17Z"
33
build_hash: 2944c8772f216656d84ee02d392eaca501274c1e
44
go_version: go1.18.1
5-
version: v0.20.1
6-
api_directory_checksum: 2322dd513cbf25a6b2e4b99236b5f3ee0fb8c22e
5+
version: v0.20.1-dirty
6+
api_directory_checksum: bf57d462582340d7b4409d8f75f13a5f6552a1f6
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 8452039ec1ac012add845247a98a2f640647b7b0
10+
file_checksum: a0f3b99e009427dd814f4d54ea99932c78bc3502
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ resources:
4545
is_immutable: true
4646
JobDriver:
4747
is_immutable: true
48+
# The default ConfigurationOverrides that is part of JobRun API's does not work well with ACK. By design a CRD must be describable using an OpenAPIv3 schema. ConfigurationOverrides has a property within ApplicationConfiguration called 'configurations' which is recursive and is the root of the issue. Hence, we are creating custom JSON blob to accomodate ConfigurationOverrides and we have to manually handle how to unmarshall this field so that customers can define all/any properties available
49+
configurationOverrides:
50+
type: "string"
51+
is_immutable: true
52+
is_required: False
53+
compare:
54+
is_ignored: true
55+
hooks:
56+
delta_pre_compare:
57+
code: customPreCompare(delta, a, b)
58+
sdk_create_post_build_request:
59+
template_path: hooks/configurationOverrides/sdk_create_post_build_request.go.tpl
60+
sdk_read_one_pre_set_output:
61+
template_path: hooks/configurationOverrides/sdk_read_one_pre_set_output.go.tpl
4862
exceptions:
4963
terminal_codes:
5064
- ValidationException

apis/v1alpha1/job_run.go

Lines changed: 2 additions & 0 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ spec:
3838
jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR
3939
on EKS."
4040
properties:
41+
configurationOverrides:
42+
type: string
4143
executionRoleARN:
4244
description: The execution role ARN for the job run.
4345
type: string

generator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ resources:
4545
is_immutable: true
4646
JobDriver:
4747
is_immutable: true
48+
# The default ConfigurationOverrides that is part of JobRun API's does not work well with ACK. By design a CRD must be describable using an OpenAPIv3 schema. ConfigurationOverrides has a property within ApplicationConfiguration called 'configurations' which is recursive and is the root of the issue. Hence, we are creating custom JSON blob to accomodate ConfigurationOverrides and we have to manually handle how to unmarshall this field so that customers can define all/any properties available
49+
configurationOverrides:
50+
type: "string"
51+
is_immutable: true
52+
is_required: False
53+
compare:
54+
is_ignored: true
55+
hooks:
56+
delta_pre_compare:
57+
code: customPreCompare(delta, a, b)
58+
sdk_create_post_build_request:
59+
template_path: hooks/configurationOverrides/sdk_create_post_build_request.go.tpl
60+
sdk_read_one_pre_set_output:
61+
template_path: hooks/configurationOverrides/sdk_read_one_pre_set_output.go.tpl
4862
exceptions:
4963
terminal_codes:
5064
- ValidationException

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.17
55
require (
66
github.com/aws-controllers-k8s/runtime v0.20.1
77
github.com/aws/aws-sdk-go v1.44.93
8+
github.com/ghodss/yaml v1.0.0
89
github.com/go-logr/logr v1.2.0
910
github.com/spf13/pflag v1.0.5
1011
k8s.io/api v0.23.0

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWp
140140
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
141141
github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
142142
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
143+
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
143144
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
144145
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
145146
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=

helm/crds/emrcontainers.services.k8s.aws_jobruns.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ spec:
3838
jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR
3939
on EKS."
4040
properties:
41+
configurationOverrides:
42+
type: string
4143
executionRoleARN:
4244
description: The execution role ARN for the job run.
4345
type: string

pkg/resource/job_run/delta.go

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

0 commit comments

Comments
 (0)