Skip to content

Commit

Permalink
Initial Release (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuladhar authored Aug 9, 2023
1 parent b718987 commit a55c5d7
Show file tree
Hide file tree
Showing 52 changed files with 1,531 additions and 995 deletions.
5 changes: 5 additions & 0 deletions .abs/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
replace-chart-version-with-git: true
generate-metadata: true
chart-dir: ./helm/teleport-operator
destination: ./build
# ct-config: ./.circleci/ct-config.yaml
88 changes: 31 additions & 57 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,15 @@
version: 2.1
orbs:
architect: giantswarm/[email protected]

jobs:
unit-tests:
executor: architect/architect
steps:
- checkout
- run:
name: "Run unit tests"
command: CGO_ENABLED=0 make test-unit
integration-tests:
executor: architect/machine
machine:
image: 'ubuntu-2004:202010-01'
steps:
- checkout
- architect/machine-install-go
- run:
name: Install Docker Compose
environment:
COMPOSE_VERSION: '1.29.2'
command: |
curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/bin/docker-compose
- run:
name: "Run integration tests"
command: |
CGO_ENABLED=0 make test-integration
orbs:
architect: giantswarm/[email protected]

workflows:
package-and-push-chart-on-tag:
build:
jobs:
- unit-tests:
filters:
tags:
only: /^v.*/

- integration-tests:
filters:
tags:
only: /^v.*/

- architect/go-build:
context: architect
name: go-build
binary: teleport-operator
resource_class: xlarge
requires:
- unit-tests
- integration-tests
resource_class: large
filters:
tags:
only: /^v.*/
Expand All @@ -62,37 +21,52 @@ workflows:
username_envar: "QUAY_USERNAME"
password_envar: "QUAY_PASSWORD"
requires:
- go-build
- go-build
# Needed to trigger job also on git tag.
filters:
# Trigger the job also on git tag.
tags:
only: /^v.*/

- architect/push-to-docker:
context: "architect"
name: push-teleport-operator-to-docker
image: "docker.io/giantswarm/teleport-operator"
username_envar: "DOCKER_USERNAME"
password_envar: "DOCKER_PASSWORD"
requires:
- go-build
- go-build
# Needed to trigger job also on git tag.
filters:
tags:
only: /^v.*/

- architect/push-to-app-catalog:
context: "architect"
# executor: "app-build-suite" # uncomment this if you want automatic metadata generation and helm chart linting
name: push-to-app-catalog
executor: "app-build-suite" # uncomment this if you want automatic metadata generation and helm chart linting
name: push-teleport-operator-to-app-catalog
app_catalog: "control-plane-catalog"
app_catalog_test: "control-plane-test-catalog"
chart: "teleport-operator"
requires:
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
# Trigger job on git tag.
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
# Needed to trigger job also on git tag.
filters:
tags:
only: /^v.*/

- architect/push-to-app-collection:
name: aws-app-collection
context: "architect"
app_name: "teleport-operator"
app_namespace: "giantswarm"
app_collection_repo: "aws-app-collection"
requires:
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
- push-teleport-operator-to-app-catalog
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/

Expand All @@ -102,9 +76,9 @@ workflows:
app_name: "teleport-operator"
app_collection_repo: "capa-app-collection"
requires:
- push-teleport-operator-to-docker
- push-teleport-operator-to-quay
- push-to-app-catalog
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
- push-teleport-operator-to-app-catalog
filters:
branches:
ignore: /.*/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre_commit_go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
- uses: actions/setup-python@v4
- uses: actions/setup-go@v3
with:
go-version: "1.18.4"
go-version: "1.19"
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
- name: Install golangci-lint
env:
GOLANGCI_LINT_VERSION: "v1.47.2"
GOLANGCI_LINT_VERSION: "v1.53.2"
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sudo sh -s -- -b $GOPATH/bin ${GOLANGCI_LINT_VERSION}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Dockerfile.cross

# Test binary, build with `go test -c`
*.test
teleport-operator

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
Expand Down
2 changes: 2 additions & 0 deletions .nancy-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pkg:golang/k8s.io/[email protected]
CVE-2020-8561 until=2023-10-01
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]



[Unreleased]: https://github.com/giantswarm/teleport-operator/tree/main
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ COPY go.sum go.sum
RUN go mod download

# Copy the go source
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY main.go main.go
COPY internal/controller/ internal/controller/

COPY internal/pkg/ internal/pkg/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
144 changes: 0 additions & 144 deletions config/default/kustomization.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions config/default/manager_auth_proxy_patch.yaml

This file was deleted.

Loading

0 comments on commit a55c5d7

Please sign in to comment.