Documentation
¶
Overview ¶
package state defines the structure of the Constellation state file.
Index ¶
Constants ¶
const (
// Version1 is the first version of the state file.
Version1 = "v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Azure ¶
type Azure struct {
ResourceGroup string `yaml:"resourceGroup"`
SubscriptionID string `yaml:"subscriptionID"`
NetworkSecurityGroupName string `yaml:"networkSecurityGroupName"`
LoadBalancerName string `yaml:"loadBalancerName"`
UserAssignedIdentity string `yaml:"userAssignedIdentity"`
AttestationURL string `yaml:"attestationURL"`
}
Azure describes the infra state related to Azure.
type ClusterValues ¶
type ClusterValues struct {
// ClusterID is the unique identifier of the cluster.
ClusterID string `yaml:"clusterID"`
// OwnerID is the unique identifier of the owner of the cluster.
OwnerID string `yaml:"ownerID"`
// MeasurementSalt is the salt generated during cluster init.
MeasurementSalt []byte `yaml:"measurementSalt"`
}
ClusterValues describe the (Kubernetes) cluster state, set during initialization of the cluster.
type GCP ¶
type GCP struct {
ProjectID string `yaml:"projectID"`
IPCidrNode string `yaml:"ipCidrNode"`
IPCidrPod string `yaml:"ipCidrPod"`
}
GCP describes the infra state related to GCP.
type Infrastructure ¶
type Infrastructure struct {
UID string `yaml:"uid"`
ClusterEndpoint string `yaml:"clusterEndpoint"`
InitSecret []byte `yaml:"initSecret"`
APIServerCertSANs []string `yaml:"apiServerCertSANs"`
// Name is the name of the cluster.
Name string `yaml:"name"`
Azure *Azure `yaml:"azure,omitempty"`
GCP *GCP `yaml:"gcp,omitempty"`
}
Infrastructure describe the state related to the cloud resources of the cluster.
type State ¶
type State struct {
Version string `yaml:"version"`
Infrastructure Infrastructure `yaml:"infrastructure"`
ClusterValues ClusterValues `yaml:"clusterValues"`
}
State describe the entire state to describe a Constellation cluster.
func NewFromIDFile ¶
NewFromIDFile creates a new cluster state file from the given ID file and config.
func ReadFromFile ¶
ReadFromFile reads the state file at the given path and returns the state.
func (*State) Merge ¶
Merge merges the state information from other into the current state. If a field is set in both states, the value of the other state is used.
func (*State) SetClusterValues ¶
func (s *State) SetClusterValues(clusterValues ClusterValues) *State
SetClusterValues sets the cluster values.
func (*State) SetInfrastructure ¶
func (s *State) SetInfrastructure(infrastructure Infrastructure) *State
SetInfrastructure sets the infrastructure state.