diff --git a/go.mod b/go.mod index 4771479..8134457 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/go-chi/chi/v5 v5.1.0 github.com/oapi-codegen/runtime v1.1.1 github.com/spf13/pflag v1.0.5 - github.com/unikorn-cloud/core v0.1.77 - github.com/unikorn-cloud/identity v0.2.44 - github.com/unikorn-cloud/region v0.1.45 + github.com/unikorn-cloud/core v0.1.85 + github.com/unikorn-cloud/identity v0.2.45 + github.com/unikorn-cloud/region v0.1.46 go.opentelemetry.io/otel/sdk v1.31.0 k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 @@ -18,6 +18,7 @@ require ( ) require ( + github.com/Masterminds/semver/v3 v3.3.0 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -50,7 +51,6 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/masterminds/semver v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect diff --git a/go.sum b/go.sum index 27a2086..367bb7a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= @@ -92,8 +92,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/masterminds/semver v1.5.0 h1:hTxJTTY7tjvnWMrl08O6u3G6BLlKVwxSz01lVac9P8U= -github.com/masterminds/semver v1.5.0/go.mod h1:s7KNT9fnd7edGzwwP7RBX4H0v/CYd5qdOLfkL1V75yg= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -135,12 +133,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/unikorn-cloud/core v0.1.77 h1:DHxIOuS5RAZylzxHF/kUt955TdmE5kJiY/Z2yqC0/e0= -github.com/unikorn-cloud/core v0.1.77/go.mod h1:S9AF4PwTQljImb9w0P2jKjzRe8fLM+rx+ZbxrAHw/yE= -github.com/unikorn-cloud/identity v0.2.44 h1:tXV/qsJ77Dkx8ba8gnBFXHWUgBNsJ2oo/5TjnyhkH7U= -github.com/unikorn-cloud/identity v0.2.44/go.mod h1:JMbS6iTYzt0OVt5AkqZys3WVnpLabGvUl8kGWcxzFZI= -github.com/unikorn-cloud/region v0.1.45 h1:qpUwB+s/SEZNHZqwHTYovtWUVdJB2AKEl06NbiIwnOw= -github.com/unikorn-cloud/region v0.1.45/go.mod h1:QqWLEfB8bNRIUAU7h5JjkQsjyJdTV+2ltDYksRjKMds= +github.com/unikorn-cloud/core v0.1.85 h1:S4B0nr0jhxF8SCsKyCRVwcx8+kJsI8fQVONLJDf9aic= +github.com/unikorn-cloud/core v0.1.85/go.mod h1:wEKzCwAnIyTbo27l++Wl+gK95TAxMsFS3y3jbFB03aw= +github.com/unikorn-cloud/identity v0.2.45 h1:YFmw3uunwdZMuYiimv4lfU6s7iTtYoc22xJqLTrlOVg= +github.com/unikorn-cloud/identity v0.2.45/go.mod h1:WzNNv05ReDMLfWsOtq53uzhX2GU2nXDw76Bdsf3BPnM= +github.com/unikorn-cloud/region v0.1.46 h1:LzyrBRej40YeOMr54zL2emkrqY1ypgOyYG8hDledlCU= +github.com/unikorn-cloud/region v0.1.46/go.mod h1:cofPuJjseRKE95xAqNa23nSL7/+LDXOBxNIHwwODpys= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/pkg/apis/unikorn/v1alpha1/types.go b/pkg/apis/unikorn/v1alpha1/types.go index a762a9f..979c8ff 100644 --- a/pkg/apis/unikorn/v1alpha1/types.go +++ b/pkg/apis/unikorn/v1alpha1/types.go @@ -60,6 +60,8 @@ type ComputeCluster struct { type ComputeClusterSpec struct { // Pause, if true, will inhibit reconciliation. Pause bool `json:"pause,omitempty"` + // Tags are aribrary user data. + Tags unikornv1core.TagList `json:"tags,omitempty"` // Region to provision the cluster in. RegionID string `json:"regionId"` // Network defines the Compute networking. diff --git a/pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go index 32b3f91..6d006e0 100644 --- a/pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go @@ -90,6 +90,11 @@ func (in *ComputeClusterList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ComputeClusterSpec) DeepCopyInto(out *ComputeClusterSpec) { *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(unikornv1alpha1.TagList, len(*in)) + copy(*out, *in) + } if in.Network != nil { in, out := &in.Network, &out.Network *out = new(unikornv1alpha1.NetworkGeneric) diff --git a/pkg/openapi/schema.go b/pkg/openapi/schema.go index 6de3e4d..b3d4081 100644 --- a/pkg/openapi/schema.go +++ b/pkg/openapi/schema.go @@ -19,71 +19,72 @@ import ( // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a2/bOLZ/heBdYO8F5GccJ/GXhafdR7DTabbpzOJOkxvQ0pHNCUVqSSqJG/i/X/Ah",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"KV400vJN6z0IurxCJElMNRfGVGXyGxFZiF141AbBfFgTBPAiMxVPwe+5eOQrlW79T2tjCay8dmq/XaNh", - "Ue9pfllKuC6tis7lcjExhfl6Q8ITrjZpfGPJUepe1XimGjJ1WJ3TNLhFRS+RkszXybW9l51maXLAdWOs", - "91CO5Ju+33FtMoGkzP8MjR/KvWrdi/2Fcm1WNKztgLVekit2UjHv6dltGdee7O2iLptRK233puSXfZtw", - "lWnemhOgcgF3yPotKA+64kqlf9BMobF0VVQVtat77CGzPePmpnh5LJ5qRrCD4vqykPevUl5SiHIhWMDH", - "lm2nbaR7MLtp1WFa3fyf9a3QhkNiRXc+FJZk3B7E/77aa8hgoy6XfacXxEO1DIhHFs5hIjnoRGjI5aUH", - "QsMgFxHOKL90WHq7DoeQC7yY/NcdawGz2nm2uUnnfhEXTJ5X5AnR8F0OujIpP8a59uqT6RCtvlSBbsiz", - "UWXNaxdb4uZrbwChY14AQlvu/2Tk6Uf7Bx4NT6zblX/2AodvOUX5VDAIsV++R7JggGzd5ToFZNcJ4qYo", - "W/R7+f4TmjAR3yuLjzHxGJniO6PTmRMyn6PLq4eBkcPl1cPQ8GlXcaGJayvXTGKNtVWNlwObbbZTF8eV", - "gW9MbzbcEbJvKx7qNYOOcxzhIsl35//VLp7QyAkw5ERrRIYJE1KjBFLKqfZpmaUPaUnSlMbrGivnYhux", - "1Vn0VFGuYequDVWDsEME/MkuCuY3YdDN1Nn992DTzulCWIwPitS18SqEYV79gC+Exfn0XnhWTMAhjSyB", - "u/S+NXQ2nFbt8Nq9YmojTAR8y04zr4FBrEXQ610XElk4pDzgum6E2nBzMAdJtAmxaq40ZIaXQoWbDdUI", - "dS9EHnozwhUlCVWb0oa0VE+J98jDPfi6KOrz7aMouom+Gpnvr/gNdchyLL1K6F/sG3T53p5L2w+iah6+", - "jZqmmS02TbC3oQisWNQH5as8/GSDohF21SexkwKbVtLYzoEU/Qo+gfddu4w80azIyqECKbRoqZgwWKoj", - "EFTcoL25//X135AC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3ZDZx6laaqEez6OPe3Qvn5L9c1SAX/oy6H", + "HW844fOm/zVrZkCYnvkEzqV6JtSeUI0mUmSu2sFTYlOwG15h4Ohu33D8ujxAk2kg7OeIyJhqaXJLTaZ+", + "MJinLvAP1K+DDdZxqVcliHDRMJx6GNnbV2VBV5Pp3s1rB/P21ayx9/SW8o6JDPau5B4olVDFR0FSSKrn", + "1wakzw5swaI5yLaO8kdXfBW8VEdV1hpiINKEr3bKrTmSZ+2LiUd7TlkIsG/eiRTWHv4sGR7hmda5GnU6", + "LjTW83aD7LaQ045DufPQ7zT24wjbKoE5zhBvMHoBTLuvUQ2zr9z4H+UTEda1sjp8DfKBJmAjYT9SrGwN", + "nVZ2bssHat2WGZ0ASuYJgxueEU6mYKLaYEcV+SlrhTLjNFxhZu6LRR9+RH7i0mTYcMNnQFJw1QKqGdQ6", + "2jVs658w4W671+4aFfKKhUf4pN1tn7hUe2Yl2iE57Tz0OvUkSXWemz8BsOgkGzvG78pRHM8dg+AUAgZj", + "zMhe/iUsG9/7MkD9PANBlKpqP7f6K+hxTn/pfawj+bGBYtXSXvkwud/tbjLJal1n07eFiwgP9tn/uk9r", + "7Cm9o54SnOG155wc9Zz17yXsIYOjHrI20r2I8OmRxbJt7L/uc22QGfa2X25tpl7/oZMNAelySWfT73dY", + "UHvapq8dqM5z9WsYhxrskZCOdm4N/PTHwn7MGbpi39nIViGCODwux4uWXsM1MiGtdfOMw5XrHuRKqJ0u", + "5Mrz8arEseFTyt8CmW/Wu9rPhXS2/VbIYs1H9Q/1UW8u6pUu6uKoh6x9sfe7dlFPrVQkhQlL7PPWVIoi", + "t1/yUtuNPYbf6TxXv3q0qAongQj/vX2OSGXCNuHxNk4OtHIH7MV2/q7xO02HGuhrvhp+s+K3QONQK/6d", + "3+q7dwV+BM7GAkUgFPjZFntqbuJlUUChj+Qc/t3RwJuzeXM2v5+QYbH4/wAAAP//4+4Afu9RAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/pkg/provisioners/managers/cluster/provisioner.go b/pkg/provisioners/managers/cluster/provisioner.go index bb5af8c..29c94d4 100644 --- a/pkg/provisioners/managers/cluster/provisioner.go +++ b/pkg/provisioners/managers/cluster/provisioner.go @@ -172,16 +172,16 @@ func (p *Provisioner) deleteIdentity(ctx context.Context, client regionapi.Clien return nil } -func (p *Provisioner) getPhysicalNetwork(ctx context.Context, client regionapi.ClientWithResponsesInterface) (*regionapi.PhysicalNetworkRead, error) { +func (p *Provisioner) getNetwork(ctx context.Context, client regionapi.ClientWithResponsesInterface) (*regionapi.NetworkRead, error) { log := log.FromContext(ctx) - physicalNetworkID, ok := p.cluster.Annotations[coreconstants.PhysicalNetworkAnnotation] + networkID, ok := p.cluster.Annotations[coreconstants.PhysicalNetworkAnnotation] if !ok { //nolint: nilnil return nil, nil } - response, err := client.GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDPhysicalnetworksPhysicalNetworkIDWithResponse(ctx, p.cluster.Labels[coreconstants.OrganizationLabel], p.cluster.Labels[coreconstants.ProjectLabel], p.cluster.Annotations[coreconstants.IdentityAnnotation], physicalNetworkID) + response, err := client.GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksNetworkIDWithResponse(ctx, p.cluster.Labels[coreconstants.OrganizationLabel], p.cluster.Labels[coreconstants.ProjectLabel], p.cluster.Annotations[coreconstants.IdentityAnnotation], networkID) if err != nil { return nil, err } @@ -211,7 +211,7 @@ func (p *Provisioner) identityOptions(ctx context.Context, client regionapi.Clie return nil, err } - physicalNetwork, err := p.getPhysicalNetwork(ctx, client) + network, err := p.getNetwork(ctx, client) if err != nil { return nil, err } @@ -221,8 +221,8 @@ func (p *Provisioner) identityOptions(ctx context.Context, client regionapi.Clie Cloud: *identity.Spec.Openstack.Cloud, ServerGroupID: identity.Spec.Openstack.ServerGroupId, ProviderNetwork: &computeprovisioners.ClusterOpenstackProviderOptions{ - NetworkID: physicalNetwork.Spec.Openstack.NetworkId, - SubnetID: physicalNetwork.Spec.Openstack.SubnetId, + NetworkID: network.Spec.Openstack.NetworkId, + SubnetID: network.Spec.Openstack.SubnetId, }, } diff --git a/pkg/server/handler/cluster/client.go b/pkg/server/handler/cluster/client.go index c04bbb5..edcb8b6 100644 --- a/pkg/server/handler/cluster/client.go +++ b/pkg/server/handler/cluster/client.go @@ -125,8 +125,8 @@ func (c *Client) get(ctx context.Context, namespace, clusterID string) (*unikorn } func (c *Client) createIdentity(ctx context.Context, organizationID, projectID, regionID, clusterID string) (*regionapi.IdentityRead, error) { - tags := regionapi.TagList{ - regionapi.Tag{ + tags := coreapi.TagList{ + coreapi.Tag{ Name: constants.ComputeClusterLabel, Value: clusterID, }, @@ -136,10 +136,10 @@ func (c *Client) createIdentity(ctx context.Context, organizationID, projectID, Metadata: coreapi.ResourceWriteMetadata{ Name: "compute-cluster-" + clusterID, Description: ptr.To("Identity for Compute cluster " + clusterID), + Tags: &tags, }, Spec: regionapi.IdentityWriteSpec{ RegionId: regionID, - Tags: &tags, }, } @@ -155,9 +155,9 @@ func (c *Client) createIdentity(ctx context.Context, organizationID, projectID, return resp.JSON201, nil } -func (c *Client) createPhysicalNetworkOpenstack(ctx context.Context, organizationID, projectID string, cluster *unikornv1.ComputeCluster, identity *regionapi.IdentityRead) (*regionapi.PhysicalNetworkRead, error) { - tags := regionapi.TagList{ - regionapi.Tag{ +func (c *Client) createNetworkOpenstack(ctx context.Context, organizationID, projectID string, cluster *unikornv1.ComputeCluster, identity *regionapi.IdentityRead) (*regionapi.NetworkRead, error) { + tags := coreapi.TagList{ + coreapi.Tag{ Name: constants.ComputeClusterLabel, Value: cluster.Name, }, @@ -169,19 +169,19 @@ func (c *Client) createPhysicalNetworkOpenstack(ctx context.Context, organizatio dnsNameservers[i] = ip.String() } - request := regionapi.PhysicalNetworkWrite{ + request := regionapi.NetworkWrite{ Metadata: coreapi.ResourceWriteMetadata{ Name: "compute-cluster-" + cluster.Name, - Description: ptr.To("Physical network for cluster " + cluster.Name), + Description: ptr.To("PNetwork for cluster " + cluster.Name), + Tags: &tags, }, - Spec: ®ionapi.PhysicalNetworkWriteSpec{ - Tags: &tags, + Spec: ®ionapi.NetworkWriteSpec{ Prefix: cluster.Spec.Network.NodeNetwork.String(), DnsNameservers: dnsNameservers, }, } - resp, err := c.region.PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDPhysicalnetworksWithResponse(ctx, organizationID, projectID, identity.Metadata.Id, request) + resp, err := c.region.PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksWithResponse(ctx, organizationID, projectID, identity.Metadata.Id, request) if err != nil { return nil, errors.OAuth2ServerError("unable to physical network").WithError(err) } @@ -237,12 +237,12 @@ func (c *Client) applyCloudSpecificConfiguration(ctx context.Context, organizati // networks, so play it safe. Please note that the cluster controller will // automatically discover the physical network, so we don't need an annotation. if region.Spec.Features.PhysicalNetworks { - physicalNetwork, err := c.createPhysicalNetworkOpenstack(ctx, organizationID, projectID, cluster, identity) + network, err := c.createNetworkOpenstack(ctx, organizationID, projectID, cluster, identity) if err != nil { return errors.OAuth2ServerError("failed to create physical network").WithError(err) } - cluster.Annotations[constants.PhysicalNetworkAnnotation] = physicalNetwork.Metadata.Id + cluster.Annotations[constants.PhysicalNetworkAnnotation] = network.Metadata.Id } return nil diff --git a/pkg/server/handler/cluster/conversion.go b/pkg/server/handler/cluster/conversion.go index 7452e48..97587dd 100644 --- a/pkg/server/handler/cluster/conversion.go +++ b/pkg/server/handler/cluster/conversion.go @@ -109,7 +109,7 @@ func convert(in *unikornv1.ComputeCluster) *openapi.ComputeClusterRead { } out := &openapi.ComputeClusterRead{ - Metadata: conversion.ProjectScopedResourceReadMetadata(in, provisioningStatus), + Metadata: conversion.ProjectScopedResourceReadMetadata(in, in.Spec.Tags, provisioningStatus), Spec: openapi.ComputeClusterSpec{ RegionId: in.Spec.RegionID, WorkloadPools: convertWorkloadPools(in), @@ -254,6 +254,7 @@ func (g *generator) generate(ctx context.Context, request *openapi.ComputeCluste cluster := &unikornv1.ComputeCluster{ ObjectMeta: conversion.NewObjectMetadata(&request.Metadata, g.namespace, userinfo.Sub).WithOrganization(g.organizationID).WithProject(g.projectID).Get(), Spec: unikornv1.ComputeClusterSpec{ + Tags: conversion.GenerateTagList(request.Metadata.Tags), RegionID: request.Spec.RegionId, Network: g.generateNetwork(), WorkloadPools: computeWorkloadPools,