nodeidentity

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package nodeidentity contains types and helper functions for GKE Nodes.

Index

Constants

This section is empty.

Variables

View Source
var CloudComputeInstanceIdentifierOID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 1, 21}

CloudComputeInstanceIdentifierOID is an x509 Extension OID for VM Identity info.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Zone        string `json:"zone"`
	ID          uint64 `json:"id"`
	Name        string `json:"name"`
	ProjectID   uint64 `json:"project_id"`
	ProjectName string `json:"project_name"`
}

Identity uniquely identifies a GCE VM.

func FromAIKCert

func FromAIKCert(cert *x509.Certificate) (Identity, error)

FromAIKCert extracts VM Identity from cloudComputeInstanceIdentifier extension in cert.

func FromMetadata

func FromMetadata() (Identity, error)

FromMetadata builds VM Identity from GCE Metadata using default client.

func (Identity) ToASN1

func (id Identity) ToASN1() ([]byte, error)

ToASN1 serializes Identity to ASN1 format used in CloudComputeInstanceIdentifiedOID x509 extension.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL