upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

Refresh license secret and image pull secret on enterprise upgrade #123

Closed hasheddan closed 2 years ago

hasheddan commented 2 years ago

Description of your changes

up enterprise update will now create or update the image pull secret and the license secret using the credentials passed by the user. This is necessary because a new access key is required for any new version of enterprise, and the image pull secret may need new credentials if a different license id is being used.

Signed-off-by: hasheddan georgedanielmangum@gmail.com

Fixes #122

I have:

How has this code been tested

I installed and upgraded to a new version, using a different license ID and token for each operation. All pods came up successfully and I verified that license secret and image pull secret had been updated.

$ up enterprise install <version-1> ...
License ID: <license-id-1>
Token:
$ k get pods -n upbound-enterprise
NAME                                            READY   STATUS            RESTARTS   AGE
api-auth-enterprise-64596bb5b5-4grz5            0/1     Running           0          72s
api-core-enterprise-7f9ff7dc68-52mg4            0/1     PodInitializing   0          72s
api-mysql-68db866775-9t7zs                      1/1     Running           0          72s
api-private-auth-enterprise-5ffd6966cf-hnnzf    1/1     Running           0          72s
api-private-enterprise-6fc76775f7-8s8z9         1/1     Running           0          72s
crossplane-router-enterprise-7575dc578f-swblv   1/1     Running           0          72s
frontend-enterprise-7d5bf56d8-64wfs             1/1     Running           0          72s
nats-0                                          3/3     Running           0          72s
nats-monitoring-db5c9db49-jrsml                 1/1     Running           0          72s
nsc-setup--1-xdg75                              0/1     Completed         0          81s
redis-master-0                                  1/1     Running           0          72s
upbound-graphql-enterprise-6c9f955cc7-ss5nm     1/1     Running           0          72s
$ up enterprise upgrade <version-2> ...
License ID: <license-id-2>
Token:
$ k get pods -n upbound-enterprise
upbound-enterprise   api-auth-enterprise-655b68f9fb-55ddd           1/1     Running     0               12m
upbound-enterprise   api-core-enterprise-847bf87576-wqf7m           1/1     Running     0               12m
upbound-enterprise   api-mysql-68db866775-9t7zs                     1/1     Running     0               15m
upbound-enterprise   api-private-auth-enterprise-7fd4b98848-np7gp   1/1     Running     0               12m
upbound-enterprise   api-private-enterprise-548989db7b-rvbd9        1/1     Running     0               12m
upbound-enterprise   crossplane-router-enterprise-986d56994-rvmlt   1/1     Running     0               12m
upbound-enterprise   frontend-enterprise-5979d88dbc-ksbfj           1/1     Running     0               12m
upbound-enterprise   nats-0                                         3/3     Running     0               15m
upbound-enterprise   nats-monitoring-6d6c5989b-6hzrh                1/1     Running     0               12m
upbound-enterprise   nsc-setup--1-xdg75                             0/1     Completed   0               15m
upbound-enterprise   redis-master-0                                 1/1     Running     0               15m
upbound-enterprise   upbound-graphql-enterprise-5d4d8f75cd-tvhvr    1/1     Running     0               12m