Skip to content

Commit 791b4b5

Browse files
committed
fix configMapSelector typo
fixes from `configMapSeclector` to `configMapSelector` in the crd.
1 parent 57fc258 commit 791b4b5

5 files changed

+32
-2
lines changed

deploy/crds/tf.galleybytes.com_terraforms_crd.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,16 @@ spec:
24722472
terraform module.
24732473
properties:
24742474
configMapSeclector:
2475+
description: Typoed form of configMapSelector
2476+
properties:
2477+
key:
2478+
type: string
2479+
name:
2480+
type: string
2481+
required:
2482+
- name
2483+
type: object
2484+
configMapSelector:
24752485
description: "ConfigMapSelector is an option that points to an
24762486
existing configmap on the executing cluster. The configmap is
24772487
expected to contains has the terraform module (ie keys ending

pkg/apis/tf/v1beta1/terraform_types.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ type Module struct {
257257
//
258258
// If a key is defined, the value is used as the module else the entirety of the data objects will be
259259
// loaded as files.
260-
ConfigMapSelector *ConfigMapSelector `json:"configMapSeclector,omitempty"`
260+
ConfigMapSelector *ConfigMapSelector `json:"configMapSelector,omitempty"`
261+
262+
// Typoed form of configMapSelector
263+
ConfigMapSeclector_x *ConfigMapSelector `json:"configMapSeclector,omitempty"`
261264

262265
// Inline used to define an entire terraform module inline and then mounted in the TFO_MAIN_MODULE path.
263266
Inline string `json:"inline,omitempty"`

pkg/apis/tf/v1beta1/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/tf/v1beta1/zz_generated.openapi.go

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controllers/terraform_controller.go

+6
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,12 @@ func (r *ReconcileTerraform) setupAndRun(ctx context.Context, tf *tfv1beta1.Terr
17961796
// Add add inline to configmap and instruct the pod to fetch the
17971797
// configmap as the main module
17981798
runOpts.mainModulePluginData["inline-module.tf"] = tf.Spec.TerraformModule.Inline
1799+
} else if tf.Spec.TerraformModule.ConfigMapSeclector_x != nil {
1800+
b, err := json.Marshal(tf.Spec.TerraformModule.ConfigMapSeclector_x)
1801+
if err != nil {
1802+
return err
1803+
}
1804+
runOpts.mainModulePluginData[".__TFO__ConfigMapModule.json"] = string(b)
17991805
} else if tf.Spec.TerraformModule.ConfigMapSelector != nil {
18001806
// Instruct the setup pod to fetch the configmap as the main module
18011807
b, err := json.Marshal(tf.Spec.TerraformModule.ConfigMapSelector)

0 commit comments

Comments
 (0)