fix priority (#217)

* fix priority

* fix build
This commit is contained in:
Boshi Lian 2023-09-03 04:36:40 -07:00 • committed by GitHub
parent 2256c137c8
commit 65b6b5868d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View file

@ -55,7 +55,7 @@ services:
# - default
command:
- bash
- -c
- -cx
- |
(kind get kubeconfig -q -n sshpipertest || kind create cluster -n sshpipertest)
docker network connect kind $$(hostname) # self contain
@ -63,8 +63,9 @@ services:
kind export kubeconfig -n sshpipertest --internal
kind load docker-image -n sshpipertest e2e_piper-imageonly
kubectl wait --for=condition=ready pod -A --all --timeout=2m
kubectl delete -f /kubernetes/crd.yaml --force
kubectl delete -f /kubernetes/workload.yaml --force
kubectl delete -f /kubernetes/crd.yaml --force --ignore-not-found
kubectl delete -f /kubernetes/workload.yaml --force --ignore-not-found
set -e
kubectl wait --for=delete pod --all --timeout=2m # ensure no leftover
kubectl apply -f /kubernetes/crd.yaml
kubectl apply -f /kubernetes/workload.yaml

View file

@ -131,6 +131,9 @@ apiVersion: v1
data:
custom_field: |
LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUFNd0FBQUF0emMyZ3RaVwpReU5UVXhPUUFBQUNEVVJreDk5dWF3MUtkZHJhWmNMcEI1a2ZNcld3dlV6MmZQT29BckxjcHo5UUFBQUpDK2owK1N2bzlQCmtnQUFBQXR6YzJndFpXUXlOVFV4T1FBQUFDRFVSa3g5OXVhdzFLZGRyYVpjTHBCNWtmTXJXd3ZVejJmUE9vQXJMY3B6OVEKQUFBRURjUWdkaDJ6MnIvNmJscTB6aUoxbDZzNklBWDhDKzlRSGZBSDkzMWNITk85UkdUSDMyNXJEVXAxMnRwbHd1a0htUgo4eXRiQzlUUFo4ODZnQ3N0eW5QMUFBQUFEV0p2YkdsaGJrQjFZblZ1ZEhVPQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K
# echo -n 'notakey' | base64
ssh-privatekey: |
bm90YWtleSAtbgo=
kind: Secret
metadata:
name: host-publickey-key-custom-field

View file

@ -158,7 +158,7 @@ func (p *plugin) createUpstream(conn libplugin.ConnMetadata, pipe *piperv1beta1.
var publicKey []byte
var privateKey []byte
for _, k := range []string{"ssh-privatekey", "privatekey", anno["privatekey_field_name"]} {
for _, k := range []string{anno["privatekey_field_name"], "ssh-privatekey", "privatekey"} {
data := secret.Data[k]
if data != nil {
log.Debugf("found private key in secret %v/%v", to.PrivateKeySecret.Name, k)
@ -167,7 +167,7 @@ func (p *plugin) createUpstream(conn libplugin.ConnMetadata, pipe *piperv1beta1.
}
}
for _, k := range []string{"ssh-publickey", "publickey", anno["publickey_field_name"]} {
for _, k := range []string{anno["publickey_field_name"], "ssh-publickey", "publickey"} {
data := secret.Data[k]
if data != nil {
log.Debugf("found publickey key in secret %v/%v", to.PrivateKeySecret.Name, k)
@ -189,7 +189,7 @@ func (p *plugin) createUpstream(conn libplugin.ConnMetadata, pipe *piperv1beta1.
}
anno := pipe.GetAnnotations()
for _, k := range []string{"password", anno["password_field_name"]} {
for _, k := range []string{anno["password_field_name"], "password"} {
data := secret.Data[k]
if data != nil {
log.Debugf("found password in secret %v/%v", to.PasswordSecret.Name, k)