Skip to content

OS Management Hub: package_classification attribute missing from package data sources #2457

@MyoungHaSong

Description

@MyoungHaSong

Terraform Version and Provider Version

Terraform v1.8+
Provider: registry.terraform.io/oracle/oci latest

Affected Resource(s)

  • data.oci_os_management_hub_managed_instance_installed_packages
  • data.oci_os_management_hub_managed_instance_updatable_packages

Terraform Configuration Files

variable "managed_instance_id" {}

data "oci_os_management_hub_managed_instance_installed_packages" "test" {
  managed_instance_id = var.managed_instance_id
}

output "classification" {
  value = try(
      data.oci_os_management_hub_managed_instance_installed_packages.test.installed_package_collection[0].items[0].package_classification,
      "null or empty"
    )
  }

Debug Output

N/A - The issue is a data omission in the provider's response, not a runtime error.

Panic Output

N/A - The provider does not panic.

Expected Behavior

The package_classification attribute should be populated with values like "INSTALLED" or "UPDATABLE".

Actual Behavior

The package_classification attribute is null for all packages.

Steps to Reproduce

  1. Use the above Terraform configuration with a valid managed instance OCID
  2. Run terraform apply
  3. Observe that the classification output shows "null or empty"
  4. Run terraform show and inspect the state - package_classification is null

Important Factoids

This is a known issue left by code generation. The root cause:

  • The OCI Go SDK's PackageSummary interface uses packageClassification only as a JSON discriminator, not as an accessible struct field
  • The provider's generated code attempted to access obj.PackageClassification which doesn't exist, causing a compilation error
  • The code was commented out with // FIXME to resolve the build error
  • The fix pattern already exists in the available_packages data source, which correctly hardcodes the classification value

References

FIXME comments in source code:

  • internal/service/os_management_hub/os_management_hub_managed_instance_installed_packages_data_source.go:274
  • internal/service/os_management_hub/os_management_hub_managed_instance_updatable_packages_data_source.go:308

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-affected-resourcesPlease Provide the affected resource name in description. ex. Affected resource - oci_core_instancebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions