-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use pvmigrate rbac in integration tests (#179)
* use pvmigrate rbac in integration tests * f * f * use krew * f * create token help * manually create secret * add ttl-sh build * run pvmigrate inside the cluster * no .git * welp * end wait after failure * why * entrypoint?
- Loading branch information
Showing
7 changed files
with
116 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,12 @@ jobs: | |
with: | ||
go-version: 1.21 | ||
|
||
- name: Build | ||
run: make build | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
file: testing/Dockerfile | ||
tags: ttl.sh/build-test/pvmigrate:latest | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
|
@@ -41,7 +45,7 @@ jobs: | |
run: ./testing/init.sh | ||
|
||
- name: Run PVMigrate | ||
run: ./bin/pvmigrate --source-sc int-source --dest-sc int-dest | ||
run: kubectl apply -f testing/yaml/migrate-job.yaml | ||
|
||
- name: Validate Cluster End State | ||
run: ./testing/validate.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
FROM golang:1.21-alpine AS build | ||
|
||
RUN apk add --no-cache make git bash | ||
|
||
WORKDIR /go/src/github.com/replicatedhq/pvmigrate | ||
COPY cmd cmd | ||
COPY pkg pkg | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
COPY Makefile Makefile | ||
|
||
RUN make build | ||
|
||
FROM scratch | ||
COPY --from=build /go/src/github.com/replicatedhq/pvmigrate/bin/pvmigrate /pvmigrate | ||
ENTRYPOINT ["/pvmigrate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kind: Job | ||
apiVersion: batch/v1 | ||
metadata: | ||
name: pvmigrate | ||
namespace: default | ||
spec: | ||
completions: 1 | ||
template: | ||
spec: | ||
serviceAccountName: pvmigrate | ||
restartPolicy: Never | ||
containers: | ||
- name: pvmigrate | ||
image: ttl.sh/build-test/pvmigrate:latest | ||
command: [ "/pvmigrate" ] | ||
args: [ "--source-sc", "int-source", "--dest-sc", "int-dest" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: pvmigrate | ||
namespace: default | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: pvmigrate | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: pvmigrate | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pvmigrate | ||
namespace: default | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: pvmigrate-secret | ||
annotations: | ||
kubernetes.io/service-account.name: pvmigrate | ||
type: kubernetes.io/service-account-token | ||
--- |