mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
Initial 1Password Operator commit
This commit is contained in:
10
pkg/onepassword/deployments.go
Normal file
10
pkg/onepassword/deployments.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package onepassword
|
||||
|
||||
import appsv1 "k8s.io/api/apps/v1"
|
||||
|
||||
func IsDeploymentUsingSecrets(deployment *appsv1.Deployment, secrets map[string]bool) bool {
|
||||
volumes := deployment.Spec.Template.Spec.Volumes
|
||||
containers := deployment.Spec.Template.Spec.Containers
|
||||
containers = append(containers, deployment.Spec.Template.Spec.InitContainers...)
|
||||
return AreAnnotationsUsingSecrets(deployment.Annotations, secrets) || AreContainersUsingSecrets(containers, secrets) || AreVolumesUsingSecrets(volumes, secrets)
|
||||
}
|
Reference in New Issue
Block a user