CyberfusionIO / cyberfusion-cluster-api-client

Cyberfusion Core API client
https://core-api.cyberfusion.io
MIT License
5 stars 3 forks source link

Updating Unix User returns rabbitmq parameters required #32

Closed mbardelmeijer closed 1 year ago

mbardelmeijer commented 1 year ago

Describe the bug

When updating a UNIX user for a single attribute (updating PHP version), we're receiving errors about the 4 rabbitmq parameters. These are null for this unix user and should be kept empty.

Reproduction

$result = $api
    ->unixUsers()
    ->update(
        $unixUser->setDefaultPhpVersion('8.2')
    );

Expected behavior

The Unix User to be updated to PHP version 8.2

Actual behavior

Update Cyberfusion\ClusterApi\Models\UnixUser request not possible, missing: rabbitmq_username, rabbitmq_virtual_host_name, rabbitmq_password, rabbitmq_encryption_key

Additional information

I expect this to be that these 4 attributes are null, and thus filtered out via https://github.com/CyberfusionNL/cyberfusion-cluster-api-client/blob/main/src/Endpoints/Endpoint.php#L63. These parameters should be either kept in, or the API should allow these attributes to be missing from the request.

dvdheiden commented 1 year ago

Thank you for reporting this issue. I will take a look at it, but due to the holidays it might take a bit longer then usual.

mbardelmeijer commented 1 year ago

No rush at all! Enjoy the holidays 🎄

WilliamDEdwards commented 1 year ago

Workaround: replace the FPM pool with clusterctl.

Automatically:

clusterctl fpm-pools update-version $name $version

Manually:

clusterctl fpm-pools create $newFpmPoolName $version
clusterctl virtual-hosts update-fpm-pool $domain $newFpmPoolName
clusterctl fpm-pools delete $oldFpmPoolName
dvdheiden commented 1 year ago

Fixed in https://github.com/CyberfusionNL/cyberfusion-cluster-api-client/releases/tag/v1.86.1

dvdheiden commented 1 year ago

Just released 1.86.2 as this also needed a change in the filterFields method.

mbardelmeijer commented 1 year ago

@dvdheiden thanks for the fix! 💪