Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed for Ability to create Container Registry with zone redundancy #38588

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ public boolean isDedicatedDataEndpointsEnabled() {
}

@Override
public ZoneRedundancy zoneRedundancy() {
return this.innerModel().zoneRedundancy();
public boolean isZoneRedundancyEnabled() {
return !Objects.isNull(this.innerModel().zoneRedundancy()) && ZoneRedundancy.ENABLED.equals(this.innerModel().zoneRedundancy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public interface Registry
boolean isDedicatedDataEndpointsEnabled();

/** @return Whether or not zone redundancy is enabled for this container registry */
ZoneRedundancy zoneRedundancy();
boolean isZoneRedundancyEnabled();

/** @return list of host names that will serve data when isDedicatedDataEndpointsEnabled is true */
List<String> dedicatedDataEndpointsHostNames();
Expand Down Expand Up @@ -247,9 +247,12 @@ interface WithDedicatedDataEndpoints {
*/
interface WithZoneRedundancy {
/**
* Enables Zone Redundancy for the container registry.
* Enables zone redundancy for the container registry.
*
* @return the next stage of the definition
* @see <a href="https://learn.microsoft.com/en-us/azure/container-registry/zone-redundancy">
* Enable zone redundancy
* </a>
*/
WithCreate withZoneRedundancy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.azure.core.management.Region;
import com.azure.resourcemanager.containerregistry.models.Registry;
import com.azure.resourcemanager.containerregistry.models.ZoneRedundancy;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

Expand All @@ -29,6 +28,6 @@ public void canCreateContainerRegisterWithZoneRedundancy() {
.withRegistryNameAsAdminUser()
.withZoneRedundancy()
.create();
Assertions.assertEquals(ZoneRedundancy.ENABLED, registry.zoneRedundancy());
Assertions.assertTrue(registry.isZoneRedundancyEnabled());
}
}
Loading