Skip to content

Commit

Permalink
feat: Add karpenter.k8s.aws/instance-ami-id label aws#4637 - add Imag…
Browse files Browse the repository at this point in the history
…eID… (aws#559)

Co-authored-by: Jonathan Innis <jonathan.innis.ji@gmail.com>
Co-authored-by: Jonathan Innis <joinnis@amazon.com>
  • Loading branch information
3 people committed Oct 2, 2023
1 parent 080e7b7 commit 48fab60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ spec:
- type
type: object
type: array
imageID:
description: ImageID is an identifier for the image that runs on the
node
type: string
nodeName:
description: NodeName is the name of the corresponding node object
type: string
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/v1beta1/nodeclaim_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type NodeClaimStatus struct {
// ProviderID of the corresponding node object
// +optional
ProviderID string `json:"providerID,omitempty"`
// ImageID is an identifier for the image that runs on the node
// +optional
ImageID string `json:"imageID,omitempty"`
// Capacity is the estimated full capacity of the node
// +optional
Capacity v1.ResourceList `json:"capacity,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/nodeclaim/lifecycle/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func PopulateNodeClaimDetails(nodeClaim, retrieved *v1beta1.NodeClaim) *v1beta1.
)
nodeClaim.Annotations = lo.Assign(nodeClaim.Annotations, retrieved.Annotations)
nodeClaim.Status.ProviderID = retrieved.Status.ProviderID
nodeClaim.Status.ImageID = retrieved.Status.ImageID
nodeClaim.Status.Allocatable = retrieved.Status.Allocatable
nodeClaim.Status.Capacity = retrieved.Status.Capacity
return nodeClaim
Expand Down

0 comments on commit 48fab60

Please sign in to comment.