mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
Addressing pr comments
This commit is contained in:
@@ -64,7 +64,7 @@ func CreateOnePasswordCRSecretFromReference(opClient connect.Client, kubeClient
|
|||||||
|
|
||||||
currentOnepassworditem := &onepasswordv1.OnePasswordItem{}
|
currentOnepassworditem := &onepasswordv1.OnePasswordItem{}
|
||||||
err = kubeClient.Get(context.Background(), types.NamespacedName{Name: onepassworditem.Name, Namespace: onepassworditem.Namespace}, currentOnepassworditem)
|
err = kubeClient.Get(context.Background(), types.NamespacedName{Name: onepassworditem.Name, Namespace: onepassworditem.Namespace}, currentOnepassworditem)
|
||||||
if err != nil && errors.IsNotFound(err) {
|
if errors.IsNotFound(err) {
|
||||||
log.Info(fmt.Sprintf("Creating OnePasswordItem CR %v at namespace '%v'", onepassworditem.Name, onepassworditem.Namespace))
|
log.Info(fmt.Sprintf("Creating OnePasswordItem CR %v at namespace '%v'", onepassworditem.Name, onepassworditem.Namespace))
|
||||||
return kubeClient.Create(context.Background(), onepassworditem)
|
return kubeClient.Create(context.Background(), onepassworditem)
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
@@ -162,14 +162,14 @@ func (h *SecretUpdateHandler) updateInjectedSecrets() (map[string]map[string]*on
|
|||||||
onepasswordItems := &onepasswordv1.OnePasswordItemList{}
|
onepasswordItems := &onepasswordv1.OnePasswordItemList{}
|
||||||
err := h.client.List(context.Background(), onepasswordItems)
|
err := h.client.List(context.Background(), onepasswordItems)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err, "Failed to list OneOasswordItems")
|
log.Error(err, "Failed to list OnePasswordItems")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
updatedItems := map[string]map[string]*onepasswordv1.OnePasswordItem{}
|
updatedItems := map[string]map[string]*onepasswordv1.OnePasswordItem{}
|
||||||
for _, item := range onepasswordItems.Items {
|
for _, item := range onepasswordItems.Items {
|
||||||
|
|
||||||
// if onepassworditem was generated by injecting a secret into a deployment then ignore
|
// if onepassworditem was not generated by injecting a secret into a deployment then ignore
|
||||||
_, injected := item.Annotations[InjectedAnnotation]
|
_, injected := item.Annotations[InjectedAnnotation]
|
||||||
if !injected {
|
if !injected {
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user