Skip to content

Commit

Permalink
Merge pull request #67 from zzxwill/more-outputs
Browse files Browse the repository at this point in the history
make more outputs for ack and make a new release
  • Loading branch information
zzxwill authored Jul 19, 2021
2 parents 63d9f92 + ab68043 commit 585c6a6
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= oamdev/terraform-controller:latest
IMG ?= oamdev/terraform-controller:0.1.13

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
Expand Down Expand Up @@ -127,4 +127,4 @@ ifeq (, $(shell which goimports))
GOIMPORTS=$(GOBIN)/goimports
else
GOIMPORTS=$(shell which goimports)
endif
endif
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
name: terraform-controller-chart
version: 0.1.12
version: 0.1.13
description: A Kubernetes Terraform controller
home: https://github.com/oam-dev/terraform-controller
2 changes: 1 addition & 1 deletion chart/templates/tf_controller_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tf-controller-read-provider-creds-rolebinding
namespace: {{ .Values.credentialsNamespace }}
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
6 changes: 2 additions & 4 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
replicaCount: 1

version: 0.1.12
version: 0.1.13

image:
name: oamdev/terraform-controller:latest
name: oamdev/terraform-controller:0.1.13
imagePullPolicy: Always

credentialsNamespace: vela-system
4 changes: 2 additions & 2 deletions controllers/configuration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (
)

const (
terraformInitContainerImg = "registry.cn-hangzhou.aliyuncs.com/vela/busybox:latest"
terraformInitContainerImg = "busybox:latest"
// TerraformImage is the Terraform image which can run `terraform init/plan/apply`
terraformImage = "zzxwill/docker-terraform:1.0.3.alpha-2"
terraformImage = "oamdev/docker-terraform:1.0.3-beta.1"
TerraformWorkspace = "default"
)

Expand Down
2 changes: 1 addition & 1 deletion controllers/util/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func ValidConfiguration(configuration *v1beta1.Configuration, controllerNamespac
}

// CompareTwoContainerEnvs compares two slices of v1.EnvVar
func CompareTwoContainerEnvs(s1 []v1.EnvVar, s2 []v1.EnvVar) bool{
func CompareTwoContainerEnvs(s1 []v1.EnvVar, s2 []v1.EnvVar) bool {
less := func(env1 v1.EnvVar, env2 v1.EnvVar) bool {
return env1.Name < env2.Name
}
Expand Down
1 change: 0 additions & 1 deletion controllers/util/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/google/go-cmp/cmp"
v1 "k8s.io/api/core/v1"

)

func TestCompareTwoContainerEnvs(t *testing.T) {
Expand Down
20 changes: 19 additions & 1 deletion examples/alibaba/cs/configuration_ack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
variable "k8s_name_prefix" {
description = "The name prefix used to create several kubernetes clusters. Default to variable `example_name`"
type = string
default = "poc1023"
default = "poc"
}
variable "new_nat_gateway" {
Expand Down Expand Up @@ -212,6 +212,24 @@ spec:
value = module.kubernetes.kubeconfig
}
output "cluster_ca_cert" {
value = module.kubernetes.cluster_ca_cert
}
output "client_cert" {
value = module.kubernetes.client_cert
}
output "client_key" {
value = module.kubernetes.client_key
}
output "api_server_internet" {
value = module.kubernetes.api_server_internet
}
backend:
Expand Down
18 changes: 16 additions & 2 deletions examples/tf-native/alibaba/cs/ack.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


module "kubernetes" {
source = "github.com/zzxwill/terraform-alicloud-kubernetes"

Expand Down Expand Up @@ -207,3 +205,19 @@ output "name" {
output "kubeconfig" {
value = module.kubernetes.kubeconfig
}

output "cluster_ca_cert" {
value = module.kubernetes.cluster_ca_cert
}

output "client_cert" {
value = module.kubernetes.client_cert
}

output "client_key" {
value = module.kubernetes.client_key
}

output "api_server_internet" {
value = module.kubernetes.api_server_internet
}
6 changes: 3 additions & 3 deletions examples/tf-native/alibaba/hcl/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ variable "instance_name" {

variable "account_name" {
description = "RDS instance user account name"
type = "string"
type = string
default = "oam"
}

variable "password" {
description = "RDS instance account password"
type = "string"
type = string
default = "Xyfff83jfewGGfaked"
}
}
3 changes: 2 additions & 1 deletion hack/prepare-alibaba-credentials.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

echo "accessKeyID: ${ALICLOUD_ACCESS_KEY}\naccessKeySecret: ${ALICLOUD_SECRET_KEY}\nsecurityToken: ${ALICLOUD_SECURITY_TOKEN}" > alibaba-credentials.conf
kubectl create namespace vela-system
kubectl create secret generic alibaba-account-creds -n vela-system --from-file=credentials=alibaba-credentials.conf
rm -f alibaba-credentials.conf
rm -f alibaba-credentials.conf

0 comments on commit 585c6a6

Please sign in to comment.