Skip to content

Conversation

pdxfixit
Copy link
Contributor

When Zones, Pods, and Clusters are updated, the API response object contains a single instance of that entity;

{
  "zone": {
    "allocationstate": "Disabled",
    [...]
  }
}

Clusters handle this, by calling:

	if resp, err = getRawValue(resp); err != nil {
		return nil, err
	}

But Zones and Pods do not do the same, and they should.

@pdxfixit pdxfixit force-pushed the fix-zone-pod-updates branch from 2ce1b31 to c89eda7 Compare August 21, 2025 23:11
@pdxfixit pdxfixit force-pushed the fix-zone-pod-updates branch from c89eda7 to 92343a6 Compare August 21, 2025 23:38
Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

lgtm. tested locally.

fmt.Printf("%+v", r)

Below is the output of the above command where r is either UpdateZoneResponse or UpdatePodResponse
Zone - before

&{Allocationstate: Allowuserspecifyvrmtu:false Asnrange: Capacity:[] Description: Dhcpprovider: Displaytext: Dns1: Dns2: Domain: Domainid: Domainname: Guestcidraddress: Hasannotations:false Icon:<nil> Id: Internaldns1: Internaldns2: Ip6dns1: Ip6dns2: Ismultiarch:false Isnsxenabled:false JobID: Jobstatus:0 Localstorageenabled:false Name: Networktype: Resourcedetails:map[] Routerprivateinterfacemaxmtu:0 Routerpublicinterfacemaxmtu:0 Securitygroupsenabled:false Tags:[] Type: Zonetoken:}

Zone - after

&{Allocationstate:Enabled Allowuserspecifyvrmtu:false Asnrange: Capacity:[] Description: Dhcpprovider:VirtualRouter Displaytext: Dns1:1.1.1.1 Dns2: Domain: Domainid: Domainname: Guestcidraddress:10.1.1.0/24 Hasannotations:false Icon:<nil> Id:c843ba49-21c3-4616-a3ff-07bb91db3a6b Internaldns1:192.168.1.1 Internaldns2:8.8.8.8 Ip6dns1: Ip6dns2: Ismultiarch:false Isnsxenabled:false JobID: Jobstatus:0 Localstorageenabled:false Name:CS-SIM1 Adv Zone x86 Networktype:Advanced Resourcedetails:map[router.template.kvm:SystemVM Template (KVM)] Routedmodeenabled:false Routerprivateinterfacemaxmtu:1500 Routerpublicinterfacemaxmtu:1500 Securitygroupsenabled:false Tags:[] Type:Core Zonetoken:35c98452-436b-3a13-85db-79b9f07ea73a}

Pod - before

&{Allocationstate: Capacity:[] Endip:[] Forsystemvms:[] Gateway: Hasannotations:false Id: Ipranges:[] JobID: Jobstatus:0 Name: Netmask: Startip:[] Vlanid:[] Zoneid: Zonename:}

Pod - after

&{Allocationstate:Enabled Capacity:[] Endip:[192.168.1.250] Forsystemvms:[0] Gateway:192.168.1.1 Hasannotations:false Id:78d881b3-a107-4170-980c-4ef7462bcf47 Ipranges:[{Cidr: Endip:192.168.1.250 Forsystemvms:0 Gateway: Startip:192.168.1.200 Vlanid:vlan://untagged}] JobID: Jobstatus:0 Name:Sim-Adv-Pod Netmask:255.255.255.0 Startip:[192.168.1.200] Vlanid:[vlan://untagged] Zoneid:c843ba49-21c3-4616-a3ff-07bb91db3a6b Zonename:CS-SIM1 Adv Zone x86}

@vishesh92 vishesh92 merged commit 10ff80d into apache:main Aug 27, 2025
2 checks passed
@pdxfixit pdxfixit deleted the fix-zone-pod-updates branch August 27, 2025 17:14
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