Skip to content

Commit

Permalink
Merge pull request #108 from zzxwill/logging
Browse files Browse the repository at this point in the history
    Fix syntax checking issue
  • Loading branch information
zzxwill authored Sep 14, 2021
2 parents c1afac4 + 788f36e commit af7cf3e
Show file tree
Hide file tree
Showing 19 changed files with 245 additions and 107 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.13 as builder
FROM golang:1.16 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -19,9 +19,14 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM golang:1.16
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot
#USER nonroot:nonroot

# COPY terraform binary
COPY bin/terraform /usr/bin/terraform
#RUN chmod +x /usr/bin/terraform
RUN apt-get install git

ENTRYPOINT ["/manager"]
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:0.1.17
IMG ?= oamdev/terraform-controller:0.1.19

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
Expand Down Expand Up @@ -42,7 +42,7 @@ deploy: manifests
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=tf-api-role webhook paths="./..." output:crd:artifacts:config=chart/crds
mv config/rbac/role.yaml chart/templates/tf_api_role.yaml
# mv config/rbac/role.yaml chart/templates/tf_api_role.yaml

# Run go fmt against code
fmt: goimports
Expand Down
File renamed without changes.
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
version: 0.1.17
version: 0.1.19
description: A Kubernetes Terraform controller
home: https://github.com/oam-dev/terraform-controller
1 change: 1 addition & 0 deletions chart/templates/read_provider_creds_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: read-provider-creds
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
Expand Down
101 changes: 60 additions & 41 deletions chart/templates/tf_api_role.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,67 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: tf-api-role
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations/status
verbs:
- get
- patch
- update
- apiGroups:
- terraform.core.oam.dev
resources:
- providers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- providers/status
verbs:
- get
- patch
- update
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations/status
verbs:
- get
- patch
- update
- apiGroups:
- terraform.core.oam.dev
resources:
- providers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- providers/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- "secrets"
verbs:
- "get"
- "list"
- "create"
- "update"
- "delete"
- apiGroups:
- "coordination.k8s.io"
resources:
- "leases"
verbs:
- "create"
- "update"
- "get"
- "delete"
2 changes: 1 addition & 1 deletion chart/templates/tf_api_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: tf-controller-service-account
namespace: {{.Release.Namespace}}
namespace: {{ .Release.Namespace }}
2 changes: 2 additions & 0 deletions chart/templates/tf_controller_clusterrole.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tf-controller-clusterrole
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
Expand All @@ -20,6 +21,7 @@ rules:
- "create"
- "update"
- "watch"
- "delete"
- apiGroups:
- "batch"
resources:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/tf_controller_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tf-controller-role
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
Expand Down
1 change: 1 addition & 0 deletions chart/templates/tf_executor_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rules:
- "list"
- "create"
- "update"
- "delete"
- apiGroups:
- "coordination.k8s.io"
resources:
Expand Down
4 changes: 2 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

version: 0.1.17
version: 0.1.19

image:
name: oamdev/terraform-controller:0.1.17
name: oamdev/terraform-controller:0.1.19
imagePullPolicy: Always
48 changes: 48 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: tf-api-role
rules:
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- configurations/status
verbs:
- get
- patch
- update
- apiGroups:
- terraform.core.oam.dev
resources:
- providers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- terraform.core.oam.dev
resources:
- providers/status
verbs:
- get
- patch
- update
Loading

0 comments on commit af7cf3e

Please sign in to comment.