Skip to content

Commit

Permalink
fix configMapSelector typo
Browse files Browse the repository at this point in the history
fixes from `configMapSeclector` to `configMapSelector` in the crd.
  • Loading branch information
isaaguilar committed Oct 3, 2023
1 parent 57fc258 commit 791b4b5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions deploy/crds/tf.galleybytes.com_terraforms_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,16 @@ spec:
terraform module.
properties:
configMapSeclector:
description: Typoed form of configMapSelector
properties:
key:
type: string
name:
type: string
required:
- name
type: object
configMapSelector:
description: "ConfigMapSelector is an option that points to an
existing configmap on the executing cluster. The configmap is
expected to contains has the terraform module (ie keys ending
Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/tf/v1beta1/terraform_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ type Module struct {
//
// If a key is defined, the value is used as the module else the entirety of the data objects will be
// loaded as files.
ConfigMapSelector *ConfigMapSelector `json:"configMapSeclector,omitempty"`
ConfigMapSelector *ConfigMapSelector `json:"configMapSelector,omitempty"`

// Typoed form of configMapSelector
ConfigMapSeclector_x *ConfigMapSelector `json:"configMapSeclector,omitempty"`

// Inline used to define an entire terraform module inline and then mounted in the TFO_MAIN_MODULE path.
Inline string `json:"inline,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/tf/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion pkg/apis/tf/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/controllers/terraform_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,12 @@ func (r *ReconcileTerraform) setupAndRun(ctx context.Context, tf *tfv1beta1.Terr
// Add add inline to configmap and instruct the pod to fetch the
// configmap as the main module
runOpts.mainModulePluginData["inline-module.tf"] = tf.Spec.TerraformModule.Inline
} else if tf.Spec.TerraformModule.ConfigMapSeclector_x != nil {
b, err := json.Marshal(tf.Spec.TerraformModule.ConfigMapSeclector_x)
if err != nil {
return err
}
runOpts.mainModulePluginData[".__TFO__ConfigMapModule.json"] = string(b)
} else if tf.Spec.TerraformModule.ConfigMapSelector != nil {
// Instruct the setup pod to fetch the configmap as the main module
b, err := json.Marshal(tf.Spec.TerraformModule.ConfigMapSelector)
Expand Down

0 comments on commit 791b4b5

Please sign in to comment.