Skip to content

Comments

feat(mcp): add option to upgrade mcp configuration version#10

Merged
haarchri merged 2 commits intoupbound:mainfrom
haarchri:feature/mcp-update
Nov 2, 2023
Merged

feat(mcp): add option to upgrade mcp configuration version#10
haarchri merged 2 commits intoupbound:mainfrom
haarchri:feature/mcp-update

Conversation

@haarchri
Copy link
Member

Description of your changes

introduced a new feature in this PR that allows you to update MCP control plane configuration versions in two ways:

  • either by specifying a specific version
  • or by enabling autoUpdate: true.

If you want to control the exact version of the configuration that's running, use the specific version option. Alternatively, if you prefer automatic updates whenever a new configuration is available, you can use the autoUpdate option. Keep in mind that you have the option to utilize crossplane composition revisions, which is preferred when using the autoUpdate feature.

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Create Controlplane:

kubectl apply -f examples/mcp/controlplane.yaml
kind: ControlPlane
metadata:
  name: controlplane-update-test
spec:
  forProvider:
    description: controlplane-update-test
    organizationName: upboundengineering
    configuration: controlplane-update-test
kubectl get controlplane controlplane-update-test -o yaml
apiVersion: mcp.upbound.io/v1alpha1
kind: ControlPlane
metadata:
  annotations:
    crossplane.io/external-create-succeeded: "2023-10-17T14:14:51+02:00"
    crossplane.io/external-name: controlplane-update-test
  creationTimestamp: "2023-10-17T12:14:46Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generation: 7
  name: controlplane-update-test
  resourceVersion: "1377289"
  uid: b27856ea-0818-4741-a3f0-92b62b9f73c6
spec:
  deletionPolicy: Delete
  forProvider:
    configuration: test-upgrade
    description: controlplane-update-test
    organizationName: upboundengineering
    version: v0.0.0+8.e036950 # <-- lateInit

New configuration version available:

NAME                       READY   SYNCED   CONFIGURATION-UP-TO-DATE   EXTERNAL-NAME              ID                                     DEPLOYED-CONFIGURATION   CONFIGURATION-STATUS   AGE
controlplane-update-test   True    True     false                      controlplane-update-test   f1da0281-49a8-41f2-bafb-e7a366f033e0   test-upgrade             ready                  16m
Status:
  At Provider:
    Control Plane:
      Configuration:
        Current Version:           v0.0.0+8.e036950
        Deployed At:               2023-10-17T12:18:07Z
        Desired Version:           v0.0.0+8.e036950
        Id:                        4b335d63-36e8-4206-a89a-ee77a5f8bcbd
        Latest Available Version:  v0.0.0+9.4be63d8 # <— new version

Update Controlplane:

kubectl apply -f examples/mcp/controlplane.yaml
apiVersion: mcp.upbound.io/v1alpha1
kind: ControlPlane
metadata:
  annotations:
    crossplane.io/external-create-succeeded: "2023-10-17T14:14:51+02:00"
    crossplane.io/external-name: controlplane-update-test
  creationTimestamp: "2023-10-17T12:14:46Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generation: 7
  name: controlplane-update-test
  resourceVersion: "1377289"
  uid: b27856ea-0818-4741-a3f0-92b62b9f73c6
spec:
  deletionPolicy: Delete
  forProvider:
    configuration: test-upgrade
    description: controlplane-update-test
    organizationName: upboundengineering
    version: v0.0.0+9.4be63d8 # <-- new version
kubectl get controlplane  controlplane-update-test
NAME                       READY   SYNCED   CONFIGURATION-UP-TO-DATE   EXTERNAL-NAME              ID                                     DEPLOYED-CONFIGURATION   CONFIGURATION-STATUS   AGE
controlplane-update-test   True    True     true                       controlplane-update-test   f1da0281-49a8-41f2-bafb-e7a366f033e0   test-upgrade             ready                  66m

Create Controlplane with autoUpdate:

kubectl apply -f examples/mcp/controlplane.yaml
kind: ControlPlane
metadata:
  name: controlplane-update-test
spec:
  forProvider:
    autoUpdate: true
    description: controlplane-update-test
    organizationName: upboundengineering
    configuration: controlplane-update-test

Signed-off-by: Christopher Haar <christopher.haar@upbound.io>
Copy link
Contributor

@darkmuggle darkmuggle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits, but nothing to block on.

Signed-off-by: Christopher Haar <christopher.haar@upbound.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants