Skip to content

allow optional labels on generated Job template #8

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

Merged
merged 2 commits into from
Feb 8, 2022
Merged

allow optional labels on generated Job template #8

merged 2 commits into from
Feb 8, 2022

Conversation

zswanson
Copy link
Contributor

@zswanson zswanson commented Oct 5, 2021

Fixes #6
Adds an additional field to the Migration CRD spec labels that are copied to the migration Job's template metadata. This allows the Job's Pod to match against other controllers in the cluster that may be required - in my case I needed the migrator to match both an EKS IRSA and a PodSecurityPolicy

I wasn't sure about adding a new field for labels or just using the metadata that might be on the Migration CRD itself, but figured the specific field was more clear on usage.

GIthub workflow tests are broken until #7 is merged

20:02:29 ❯ make test
go/bin//controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
api/v1beta1/migrator_types.go
api/v1beta1/zz_generated.deepcopy.go
go vet ./...
go/bin//controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go test ./... -coverprofile cover.out
?   	github.com/coderanger/migrations-operator	[no test files]
?   	github.com/coderanger/migrations-operator/api/v1beta1	[no test files]
?   	github.com/coderanger/migrations-operator/cmd/waiter	[no test files]
ok  	github.com/coderanger/migrations-operator/components	0.635s	coverage: 76.6% of statements
ok  	github.com/coderanger/migrations-operator/controllers	11.401s	coverage: 100.0% of statements
ok  	github.com/coderanger/migrations-operator/http	7.388s	coverage: 83.3% of statements
ok  	github.com/coderanger/migrations-operator/integration	0.878s	coverage: [no statements]
?   	github.com/coderanger/migrations-operator/utils	[no test files]
ok  	github.com/coderanger/migrations-operator/webhook	7.524s	coverage: 85.3% of statements
32.43s user 26.22s system 258% cpu 22.666s total

@coderanger coderanger merged commit 3781502 into coderanger:main Feb 8, 2022
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.

Need ability to copy or add labels to the Job pods for AWS IRSA/SecurityPolicy
2 participants