mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-04 12:49:54 -04:00
upgrade: fix broken reference from constellation-os to constellation-version (#939)
* update constellation-os to constellation-version references * update nodeimage to nodeversion in CRD type name Signed-off-by: Fabian Kammel <fk@edgeless.systems> Co-authored-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
4bc191e434
commit
82a0fcbb9d
5 changed files with 12 additions and 12 deletions
|
@ -82,7 +82,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, imageReference, imageVersion str
|
||||||
|
|
||||||
// GetCurrentImage returns the currently used image version of the cluster.
|
// GetCurrentImage returns the currently used image version of the cluster.
|
||||||
func (u *Upgrader) GetCurrentImage(ctx context.Context) (*unstructured.Unstructured, string, error) {
|
func (u *Upgrader) GetCurrentImage(ctx context.Context) (*unstructured.Unstructured, string, error) {
|
||||||
imageStruct, err := u.dynamicInterface.getCurrent(ctx, "constellation-os")
|
imageStruct, err := u.dynamicInterface.getCurrent(ctx, "constellation-version")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ func (u *dynamicClient) getCurrent(ctx context.Context, name string) (*unstructu
|
||||||
return u.client.Resource(schema.GroupVersionResource{
|
return u.client.Resource(schema.GroupVersionResource{
|
||||||
Group: "update.edgeless.systems",
|
Group: "update.edgeless.systems",
|
||||||
Version: "v1alpha1",
|
Version: "v1alpha1",
|
||||||
Resource: "nodeimages",
|
Resource: "nodeversions",
|
||||||
}).Get(ctx, name, metav1.GetOptions{})
|
}).Get(ctx, name, metav1.GetOptions{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ func (u *dynamicClient) update(ctx context.Context, obj *unstructured.Unstructur
|
||||||
return u.client.Resource(schema.GroupVersionResource{
|
return u.client.Resource(schema.GroupVersionResource{
|
||||||
Group: "update.edgeless.systems",
|
Group: "update.edgeless.systems",
|
||||||
Version: "v1alpha1",
|
Version: "v1alpha1",
|
||||||
Resource: "nodeimages",
|
Resource: "nodeversions",
|
||||||
}).Update(ctx, obj, metav1.UpdateOptions{})
|
}).Update(ctx, obj, metav1.UpdateOptions{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ func TestParseCRDs(t *testing.T) {
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"success": {
|
"success": {
|
||||||
data: "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n name: nodeimages.update.edgeless.systems\nspec:\n group: update.edgeless.systems\n names:\n kind: NodeImage\n",
|
data: "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n name: nodeversions.update.edgeless.systems\nspec:\n group: update.edgeless.systems\n names:\n kind: NodeImage\n",
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
"wrong kind": {
|
"wrong kind": {
|
||||||
|
|
|
@ -24,7 +24,7 @@ Example for GCP:
|
||||||
apiVersion: update.edgeless.systems/v1alpha1
|
apiVersion: update.edgeless.systems/v1alpha1
|
||||||
kind: NodeVersion
|
kind: NodeVersion
|
||||||
metadata:
|
metadata:
|
||||||
name: constellation-os
|
name: constellation-version
|
||||||
spec:
|
spec:
|
||||||
image: "projects/constellation-images/global/images/<image-name>"
|
image: "projects/constellation-images/global/images/<image-name>"
|
||||||
```
|
```
|
||||||
|
@ -34,7 +34,7 @@ Example for Azure:
|
||||||
apiVersion: update.edgeless.systems/v1alpha1
|
apiVersion: update.edgeless.systems/v1alpha1
|
||||||
kind: NodeVersion
|
kind: NodeVersion
|
||||||
metadata:
|
metadata:
|
||||||
name: constellation-os
|
name: constellation-version
|
||||||
spec:
|
spec:
|
||||||
image: "/subscriptions/<subscription-id>/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/<image-definition-name>/versions/<image-version>"
|
image: "/subscriptions/<subscription-id>/resourceGroups/CONSTELLATION-IMAGES/providers/Microsoft.Compute/galleries/Constellation/images/<image-definition-name>/versions/<image-version>"
|
||||||
```
|
```
|
||||||
|
@ -70,7 +70,7 @@ kind: ScalingGroup
|
||||||
metadata:
|
metadata:
|
||||||
name: scalinggroup-worker
|
name: scalinggroup-worker
|
||||||
spec:
|
spec:
|
||||||
nodeImage: "constellation-os"
|
nodeImage: "constellation-version"
|
||||||
groupId: "projects/<project-id>/zones/<zone>/instanceGroupManagers/<instance-group-name>"
|
groupId: "projects/<project-id>/zones/<zone>/instanceGroupManagers/<instance-group-name>"
|
||||||
autoscaling: true
|
autoscaling: true
|
||||||
```
|
```
|
||||||
|
@ -83,7 +83,7 @@ kind: ScalingGroup
|
||||||
metadata:
|
metadata:
|
||||||
name: scalinggroup-worker
|
name: scalinggroup-worker
|
||||||
spec:
|
spec:
|
||||||
nodeImage: "constellation-os"
|
nodeImage: "constellation-version"
|
||||||
groupId: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachineScaleSets/<scale-set-name>"
|
groupId: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachineScaleSets/<scale-set-name>"
|
||||||
autoscaling: true
|
autoscaling: true
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: update.edgeless.systems/v1alpha1
|
apiVersion: update.edgeless.systems/v1alpha1
|
||||||
kind: NodeVersion
|
kind: NodeVersion
|
||||||
metadata:
|
metadata:
|
||||||
name: constellation-os-azure
|
name: constellation-version-azure
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
image: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/galleries/<gallery-name>/images/<image-definition-name>/versions/<version>"
|
image: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/galleries/<gallery-name>/images/<image-definition-name>/versions/<version>"
|
||||||
|
@ -9,7 +9,7 @@ spec:
|
||||||
apiVersion: update.edgeless.systems/v1alpha1
|
apiVersion: update.edgeless.systems/v1alpha1
|
||||||
kind: NodeVersion
|
kind: NodeVersion
|
||||||
metadata:
|
metadata:
|
||||||
name: constellation-os-gcp
|
name: constellation-version-gcp
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
image: projects/<project>/global/images/<image-name>
|
image: projects/<project>/global/images/<image-name>
|
||||||
|
|
|
@ -4,7 +4,7 @@ metadata:
|
||||||
name: scalinggroup-worker-azure
|
name: scalinggroup-worker-azure
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
nodeImage: "constellation-os-azure"
|
nodeImage: "constellation-version-azure"
|
||||||
groupId: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachineScaleSets/<scale-set-name>"
|
groupId: "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachineScaleSets/<scale-set-name>"
|
||||||
autoscaling: true
|
autoscaling: true
|
||||||
---
|
---
|
||||||
|
@ -14,6 +14,6 @@ metadata:
|
||||||
name: scalinggroup-worker-gcp
|
name: scalinggroup-worker-gcp
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
nodeImage: "constellation-os-gcp"
|
nodeImage: "constellation-version-gcp"
|
||||||
groupId: "projects/<project>/zones/<zone>/instanceGroupManagers/<instance-group-name>"
|
groupId: "projects/<project>/zones/<zone>/instanceGroupManagers/<instance-group-name>"
|
||||||
autoscaling: true
|
autoscaling: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue