Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added ability to load terraform registry url and credentials fo… #1

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ramekris3163
Copy link
Owner

…rm a kubernetes secret.

// Terraform credentials
TerraformCredentials = "credentials.tfrc.json"
// Terraform Registry
TerraformRegistry = "terraformrc"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the var is named TerraformRegistry?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the variable in named terraformregistry because the secret contains the details of the custom terraform registry URL we want to connect to.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this rc file can contains other configurations too. Only TerraformRegistry is inaccurate.

needSecretKeys := []string{TerraformRegistry, TerraformCredentials}
for _, key := range needSecretKeys {
if _, ok := secret.Data[key]; !ok {
err := errors.Errorf("'%s' not in git credentials secret", key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message not right.

terraformCredentialsSecretVolume := corev1.Volume{Name: TerraformCredentialsConfigVolumeName}
terraformCredentialsSecretVolume.Secret = &corev1.SecretVolumeSource{
SecretName: "terraform-credentials",
DefaultMode: &gitSecretDefaultMode,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe introduce another var.

@chivalryq
Copy link

Also let's send the PR to https://github.com/kubevela/terraform-controller

@ramekris3163 ramekris3163 force-pushed the feat/supportprivateterraformregistry branch from 62520e5 to 6a1232f Compare January 16, 2023 21:02
ramekris3163 and others added 15 commits January 18, 2023 22:14
…rm a kubernetes secret.

Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
…tials-helper form configmaps.

Signed-off-by: raradhakrishnan <[email protected]>
…ry as per review commments.

Signed-off-by: raradhakrishnan <[email protected]>
… or configMap. Review comment fixed.

Signed-off-by: raradhakrishnan <[email protected]>
…tent for secret and configmaps check. Fixed review comments.

Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Co-authored-by: qiaozp <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
Co-authored-by: qiaozp <[email protected]>
Signed-off-by: raradhakrishnan <[email protected]>
@ramekris3163 ramekris3163 force-pushed the feat/supportprivateterraformregistry branch from 6a6cb4c to 5b3fffb Compare January 19, 2023 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants