Skip to content

Commit c6d69a8

Browse files
Feat: support private terraform registry (#352)
Co-authored-by: qiaozp <[email protected]>
1 parent 841b0d1 commit c6d69a8

File tree

8 files changed

+990
-74
lines changed

8 files changed

+990
-74
lines changed

api/types/state.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ type ConfigurationState string
2121

2222
// Reasons a resource is or is not ready.
2323
const (
24-
Authorizing ConfigurationState = "Authorizing"
25-
ProviderNotFound ConfigurationState = "ProviderNotFound"
26-
ProviderNotReady ConfigurationState = "ProviderNotReady"
27-
ConfigurationStaticCheckFailed ConfigurationState = "ConfigurationSpecNotValid"
28-
Available ConfigurationState = "Available"
29-
ConfigurationProvisioningAndChecking ConfigurationState = "ProvisioningAndChecking"
30-
ConfigurationDestroying ConfigurationState = "Destroying"
31-
ConfigurationApplyFailed ConfigurationState = "ApplyFailed"
32-
ConfigurationDestroyFailed ConfigurationState = "DestroyFailed"
33-
ConfigurationReloading ConfigurationState = "ConfigurationReloading"
34-
GeneratingOutputs ConfigurationState = "GeneratingTerraformOutputs"
35-
InvalidRegion ConfigurationState = "InvalidRegion"
36-
TerraformInitError ConfigurationState = "TerraformInitError"
37-
InvalidGitCredentialsSecretReference ConfigurationState = "InvalidGitCredentialsSecretReference"
24+
Authorizing ConfigurationState = "Authorizing"
25+
ProviderNotFound ConfigurationState = "ProviderNotFound"
26+
ProviderNotReady ConfigurationState = "ProviderNotReady"
27+
ConfigurationStaticCheckFailed ConfigurationState = "ConfigurationSpecNotValid"
28+
Available ConfigurationState = "Available"
29+
ConfigurationProvisioningAndChecking ConfigurationState = "ProvisioningAndChecking"
30+
ConfigurationDestroying ConfigurationState = "Destroying"
31+
ConfigurationApplyFailed ConfigurationState = "ApplyFailed"
32+
ConfigurationDestroyFailed ConfigurationState = "DestroyFailed"
33+
ConfigurationReloading ConfigurationState = "ConfigurationReloading"
34+
GeneratingOutputs ConfigurationState = "GeneratingTerraformOutputs"
35+
InvalidRegion ConfigurationState = "InvalidRegion"
36+
TerraformInitError ConfigurationState = "TerraformInitError"
37+
InvalidGitCredentialsSecretReference ConfigurationState = "InvalidGitCredentialsSecretReference"
38+
InvalidTerraformCredentialsSecretReference ConfigurationState = "InvalidTerraformCredentialsSecretReference"
39+
InvalidTerraformRCConfigMapReference ConfigurationState = "InvalidTerraformRCConfigMapReference"
40+
InvalidTerraformCredentialsHelperConfigMapReference ConfigurationState = "InvalidTerraformCredentialsHelperConfigMapReference"
3841
)
3942

4043
// Stage is the Terraform stage

api/v1beta1/configuration_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ type ConfigurationSpec struct {
5151

5252
// GitCredentialsSecretReference specifies the reference to the secret containing the git credentials
5353
GitCredentialsSecretReference *v1.SecretReference `json:"gitCredentialsSecretReference,omitempty"`
54+
55+
// TerraformCredentialsSecretReference specifies the reference to the secret containing the terraform credentials
56+
TerraformCredentialsSecretReference *v1.SecretReference `json:"terraformCredentialsSecretReference,omitempty"`
57+
58+
// TerraformRCConfigMapReference specifies the reference to a config map containing the terraform registry configuration
59+
TerraformRCConfigMapReference *v1.SecretReference `json:"terraformRCConfigMapReference,omitempty"`
60+
61+
// TerraformCredentialsHelperConfigMapReference specifies the reference to a configmap containing the terraform registry credentials helper
62+
TerraformCredentialsHelperConfigMapReference *v1.SecretReference `json:"terraformCredentialsHelperConfigMapReference,omitempty"`
5463
}
5564

5665
// BaseConfigurationSpec defines the common fields of a ConfigurationSpec

api/v1beta1/zz_generated.deepcopy.go

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

api/v1beta2/configuration_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ type ConfigurationSpec struct {
7979

8080
// GitCredentialsSecretReference specifies the reference to the secret containing the git credentials
8181
GitCredentialsSecretReference *v1.SecretReference `json:"gitCredentialsSecretReference,omitempty"`
82+
83+
// TerraformCredentialsSecretReference specifies the reference to the secret containing the terraform credentials and terraform registry details
84+
TerraformCredentialsSecretReference *v1.SecretReference `json:"terraformCredentialsSecretReference,omitempty"`
85+
86+
// TerraformRCConfigMapReference specifies the reference to a config map containing the terraform registry configuration
87+
TerraformRCConfigMapReference *v1.SecretReference `json:"terraformRCConfigMapReference,omitempty"`
88+
89+
// TerraformCredentialsHelperConfigMapReference specifies the reference to a configmap containing the terraform registry credentials helper
90+
TerraformCredentialsHelperConfigMapReference *v1.SecretReference `json:"terraformCredentialsHelperConfigMapReference,omitempty"`
8291
}
8392

8493
// ConfigurationStatus defines the observed state of Configuration

api/v1beta2/zz_generated.deepcopy.go

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

chart/crds/terraform.core.oam.dev_configurations.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,46 @@ spec:
111111
description: Remote is a git repo which contains hcl files. Currently,
112112
only public git repos are supported.
113113
type: string
114+
terraformCredentialsHelperConfigMapReference:
115+
description: TerraformCredentialsHelperConfigMapReference specifies
116+
the reference to a configmap containing the terraform registry credentials
117+
helper
118+
properties:
119+
name:
120+
description: Name is unique within a namespace to reference a
121+
secret resource.
122+
type: string
123+
namespace:
124+
description: Namespace defines the space within which the secret
125+
name must be unique.
126+
type: string
127+
type: object
128+
terraformCredentialsSecretReference:
129+
description: TerraformCredentialsSecretReference specifies the reference
130+
to the secret containing the terraform credentials
131+
properties:
132+
name:
133+
description: Name is unique within a namespace to reference a
134+
secret resource.
135+
type: string
136+
namespace:
137+
description: Namespace defines the space within which the secret
138+
name must be unique.
139+
type: string
140+
type: object
141+
terraformRCConfigMapReference:
142+
description: TerraformRCConfigMapReference specifies the reference
143+
to a config map containing the terraform registry configuration
144+
properties:
145+
name:
146+
description: Name is unique within a namespace to reference a
147+
secret resource.
148+
type: string
149+
namespace:
150+
description: Namespace defines the space within which the secret
151+
name must be unique.
152+
type: string
153+
type: object
114154
variable:
115155
type: object
116156
x-kubernetes-preserve-unknown-fields: true
@@ -318,6 +358,47 @@ spec:
318358
description: Remote is a git repo which contains hcl files. Currently,
319359
only public git repos are supported.
320360
type: string
361+
terraformCredentialsHelperConfigMapReference:
362+
description: TerraformCredentialsHelperConfigMapReference specifies
363+
the reference to a configmap containing the terraform registry credentials
364+
helper
365+
properties:
366+
name:
367+
description: Name is unique within a namespace to reference a
368+
secret resource.
369+
type: string
370+
namespace:
371+
description: Namespace defines the space within which the secret
372+
name must be unique.
373+
type: string
374+
type: object
375+
terraformCredentialsSecretReference:
376+
description: TerraformCredentialsSecretReference specifies the reference
377+
to the secret containing the terraform credentials and terraform
378+
registry details
379+
properties:
380+
name:
381+
description: Name is unique within a namespace to reference a
382+
secret resource.
383+
type: string
384+
namespace:
385+
description: Namespace defines the space within which the secret
386+
name must be unique.
387+
type: string
388+
type: object
389+
terraformRCConfigMapReference:
390+
description: TerraformRCConfigMapReference specifies the reference
391+
to a config map containing the terraform registry configuration
392+
properties:
393+
name:
394+
description: Name is unique within a namespace to reference a
395+
secret resource.
396+
type: string
397+
namespace:
398+
description: Namespace defines the space within which the secret
399+
name must be unique.
400+
type: string
401+
type: object
321402
variable:
322403
type: object
323404
x-kubernetes-preserve-unknown-fields: true

0 commit comments

Comments
 (0)