Skip to content

Instantly share code, notes, and snippets.

@yahyafakhroji
Created September 25, 2025 08:00
Show Gist options
  • Select an option

  • Save yahyafakhroji/2be462f71dd368b0b00bf65b6dc4bd90 to your computer and use it in GitHub Desktop.

Select an option

Save yahyafakhroji/2be462f71dd368b0b00bf65b6dc4bd90 to your computer and use it in GitHub Desktop.
export type ComMiloapisIamV1Alpha1PolicyBinding = {
/**
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
apiVersion?: string;
/**
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
kind?: string;
/**
* Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*/
metadata?: IoK8sApimachineryPkgApisMetaV1ObjectMeta;
/**
* PolicyBindingSpec defines the desired state of PolicyBinding
*/
spec?: {
/**
* ResourceSelector defines which resources the subjects in the policy binding
* should have the role applied to. Options within this struct are mutually
* exclusive.
*/
resourceSelector: {
/**
* ResourceKind specifies that the policy binding should apply to all resources of a specific kind.
* Mutually exclusive with resourceRef.
*/
resourceKind?: {
/**
* APIGroup is the group for the resource type being referenced. If APIGroup
* is not specified, the specified Kind must be in the core API group.
*/
apiGroup?: string;
/**
* Kind is the type of resource being referenced.
*/
kind: string;
};
/**
* ResourceRef provides a reference to a specific resource instance.
* Mutually exclusive with resourceKind.
*/
resourceRef?: {
/**
* APIGroup is the group for the resource being referenced.
* If APIGroup is not specified, the specified Kind must be in the core API group.
* For any other third-party types, APIGroup is required.
*/
apiGroup?: string;
/**
* Kind is the type of resource being referenced.
*/
kind: string;
/**
* Name is the name of resource being referenced.
*/
name: string;
/**
* Namespace is the namespace of resource being referenced.
* Required for namespace-scoped resources. Omitted for cluster-scoped resources.
*/
namespace?: string;
/**
* UID is the unique identifier of the resource being referenced.
*/
uid: string;
};
};
/**
* RoleRef is a reference to the Role that is being bound.
* This can be a reference to a Role custom resource.
*/
roleRef: {
/**
* Name is the name of resource being referenced
*/
name: string;
/**
* Namespace of the referenced Role. If empty, it is assumed to be in the PolicyBinding's namespace.
*/
namespace?: string;
};
/**
* Subjects holds references to the objects the role applies to.
*/
subjects: Array<{
/**
* Kind of object being referenced. Values defined in Kind constants.
*/
kind: 'User' | 'Group';
/**
* Name of the object being referenced. A special group name of
* "system:authenticated-users" can be used to refer to all authenticated
* users.
*/
name: string;
/**
* Namespace of the referenced object. If DNE, then for an SA it refers to the PolicyBinding resource's namespace.
* For a User or Group, it is ignored.
*/
namespace?: string;
/**
* UID of the referenced object. Optional for system groups (groups with names starting with "system:").
*/
uid?: string;
}>;
};
/**
* PolicyBindingStatus defines the observed state of PolicyBinding
*/
status?: {
/**
* Conditions provide conditions that represent the current status of the PolicyBinding.
*/
conditions?: Array<{
/**
* lastTransitionTime is the last time the condition transitioned from one status to another.
* This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
*/
lastTransitionTime: string;
/**
* message is a human readable message indicating details about the transition.
* This may be an empty string.
*/
message: string;
/**
* observedGeneration represents the .metadata.generation that the condition was set based upon.
* For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
* with respect to the current state of the instance.
*/
observedGeneration?: number;
/**
* reason contains a programmatic identifier indicating the reason for the condition's last transition.
* Producers of specific condition types may define expected values and meanings for this field,
* and whether the values are considered a guaranteed API.
* The value should be a CamelCase string.
* This field may not be empty.
*/
reason: string;
/**
* status of the condition, one of True, False, Unknown.
*/
status: 'True' | 'False' | 'Unknown';
/**
* type of condition in CamelCase or in foo.example.com/CamelCase.
*/
type: string;
}>;
/**
* ObservedGeneration is the most recent generation observed for this PolicyBinding by the controller.
*/
observedGeneration?: number;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment