You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When user starts to use secrets encryption, the existing secrets should be encrypted after running oadm migrate storage --include=secrets --confirm. But it doesn't happen and secrets stay persisted in the plain text.
check that the secret persisted in the plain text (the ETCDCTL_API=3 etcdctl --cacert=$PWD/openshift.local.config/master/ca.crt --key=$PWD/openshift.local.config/master/master.etcd-client.key --cert=$PWD/openshift.local.config/master/master.etcd-client.crt --endpoints 'https://127.0.0.1:4001' get /kubernetes.io/secrets/default/foo -w fields | grep Value command should output something like this: "Value" : "k8s\x00\n\f\n\x02v1\x12\x06Secret\x12\x91\x01\nr\n\x03foo\x12\x00\x1a\adefault\"&/api/v1/namespaces/default/secrets/foo*$6689f2de-566f-11e7-8bdd-507b9d2b16b92\x008\x00B\f\b㞩\xca\x05\x10\xfd\xf6\xce\xd1\x03z\x00\x12\x13\n\bpassword\x12\atest123\x1a\x06Opaque\x1a\x00\"\x00")
check that the secret persisted in the encrypted form
Current Result
Step 8: oadm migrate storage outputs summary: total=168 errors=0 ignored=0 unchanged=168 migrated=0
Step 9: the secret persisted in the plain text (output is similar to the Step 7)
Expected Result
Step 8: oadm migrate storage should print summary: total=168 errors=0 ignored=0 unchanged=0 migrated=168
Step 9: the secret should be encrypted and data should starts from the "k8s:enc:aesgcm:v1:key1:" prefix, for example: "Value" : "k8s:enc:aesgcm:v1:key1:n\x14YG(\x008i\xee\u007f\xce\xd0...
Additional Information
IMPORTANT: I've tested with #14836 and #14838 being applied.
Inside of GuaranteedUpdate() we're exiting very early, just before transforming data to storage. At this point origState.stale flag is falsebut it should be true
origState with a wrong stale field has been returned from getStateFromObject function
@smarterclayton@liggitt@simo5 I couldn't provide a fix at this moment because I don't have enough time and I'm not familiar with rest/etcd code for doing an update. Next week I'll be on PTO and if this blocked issue will be fixed by someone else, I wouldn't mind.
The text was updated successfully, but these errors were encountered:
When user starts to use secrets encryption, the existing secrets should be encrypted after running
oadm migrate storage --include=secrets --confirm
. But it doesn't happen and secrets stay persisted in the plain text.Version
Steps To Reproduce
sudo $(which openshift) start --public-master=127.0.0.1
)oc create secret generic foo --from-literal=password=test123
)sudo $(which openshift) start master --public-master=127.0.0.1 --write-config=$PWD/openshift.local.config/master
)sudoedit openshift.local.config/master/master-config.yaml
)sudo $(which openshift) start --public-master=127.0.0.1 --master-config=$PWD/openshift.local.config/master/master-config.yaml --node-config=$PWD/openshift.local.config/<node>/node-config.yaml
)ETCDCTL_API=3 etcdctl --cacert=$PWD/openshift.local.config/master/ca.crt --key=$PWD/openshift.local.config/master/master.etcd-client.key --cert=$PWD/openshift.local.config/master/master.etcd-client.crt --endpoints 'https://127.0.0.1:4001' get /kubernetes.io/secrets/default/foo -w fields | grep Value
command should output something like this:"Value" : "k8s\x00\n\f\n\x02v1\x12\x06Secret\x12\x91\x01\nr\n\x03foo\x12\x00\x1a\adefault\"&/api/v1/namespaces/default/secrets/foo*$6689f2de-566f-11e7-8bdd-507b9d2b16b92\x008\x00B\f\b㞩\xca\x05\x10\xfd\xf6\xce\xd1\x03z\x00\x12\x13\n\bpassword\x12\atest123\x1a\x06Opaque\x1a\x00\"\x00"
)oadm migrate storage --include=secrets --confirm
)Current Result
Step 8:
oadm migrate storage
outputssummary: total=168 errors=0 ignored=0 unchanged=168 migrated=0
Step 9: the secret persisted in the plain text (output is similar to the Step 7)
Expected Result
Step 8:
oadm migrate storage
should printsummary: total=168 errors=0 ignored=0 unchanged=0 migrated=168
Step 9: the secret should be encrypted and data should starts from the "k8s:enc:aesgcm:v1:key1:" prefix, for example:
"Value" : "k8s:enc:aesgcm:v1:key1:n\x14YG(\x008i\xee\u007f\xce\xd0...
Additional Information
IMPORTANT: I've tested with #14836 and #14838 being applied.
My debug observations:
UpdateResource()
the flagwasCreated
isfalse
GuaranteedUpdate()
we're exiting very early, just before transforming data to storage. At this pointorigState.stale
flag isfalse
but it should betrue
origState
with a wrongstale
field has been returned fromgetStateFromObject
function@smarterclayton @liggitt @simo5 I couldn't provide a fix at this moment because I don't have enough time and I'm not familiar with rest/etcd code for doing an update. Next week I'll be on PTO and if this blocked issue will be fixed by someone else, I wouldn't mind.
The text was updated successfully, but these errors were encountered: