Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cmd/libvirt-actuator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func bootstrapCommand() *cobra.Command {
},
}

glog.Infof("Collecting master kubeconfig")
glog.Info("Collecting master kubeconfig")
config, err := f.GetMasterMachineRestConfig(masterMachine, lcw)
if err != nil {
return err
Expand Down Expand Up @@ -399,7 +399,6 @@ func checkFlags(cmd *cobra.Command) error {
func main() {
err := rootCmd.Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error occurred: %v\n", err)
os.Exit(1)
glog.Fatalf("Error occurred: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

}
}
9 changes: 6 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
glog.Fatal(err)
}

glog.Infof("Registering Components.")
glog.Info("Registering Components")

// Setup Scheme for all resources
if err := apis.AddToScheme(mgr.GetScheme()); err != nil {
Expand All @@ -61,10 +61,13 @@ func main() {
glog.Fatal(err)
}

glog.Infof("Starting the Cmd.")
glog.Info("Starting the Cmd")

// Start the Cmd
glog.Fatal(mgr.Start(signals.SetupSignalHandler()))
err = mgr.Start(signals.SetupSignalHandler())
if err != nil {
glog.Fatal(err)
}
}

func initActuator(m manager.Manager) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/libvirt/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (a *Actuator) createVolumeAndDomain(machine *machinev1.Machine, machineProv
// Clean up the created volume if domain creation fails,
// otherwise subsequent runs will fail.
if err := client.DeleteVolume(domainName); err != nil {
glog.Errorf("error cleaning up volume: %v", err)
glog.Errorf("Error cleaning up volume: %v", err)
}

return nil, a.handleMachineError(machine, apierrors.CreateMachine("error creating domain %v", err), createEventAction)
Expand Down Expand Up @@ -373,7 +373,7 @@ func (a *Actuator) applyMachineStatus(
return nil
}

glog.Infof("Machine %s status has changed: %s", machine.Name, diff.ObjectReflectDiff(machine.Status, machineCopy.Status))
glog.Infof("Machine %s status has changed: %q", machine.Name, diff.ObjectReflectDiff(machine.Status, machineCopy.Status))

now := metav1.Now()
machineCopy.Status.LastUpdated = &now
Expand Down
14 changes: 7 additions & 7 deletions pkg/cloud/libvirt/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (client *libvirtClient) CreateDomain(input CreateDomainInput) error {
if input.DomainName == "" {
return fmt.Errorf("Failed to create domain, name is empty")
}
glog.Infof("Create resource libvirt_domain")
glog.Info("Create resource libvirt_domain")

// Get default values from Host
domainDef, err := newDomainDefForConnection(client.connection)
Expand All @@ -165,7 +165,7 @@ func (client *libvirtClient) CreateDomain(input CreateDomainInput) error {
return fmt.Errorf("Failed to init domain definition from machineProviderConfig: %v", err)
}

glog.Infof("setCoreOSIgnition")
glog.Info("Create ignition configuration")
if input.Ignition != nil {
if err := setIgnition(&domainDef, client, input.Ignition, input.KubeClient, input.MachineNamespace, input.IgnitionVolumeName, input.VolumePoolName); err != nil {
return err
Expand All @@ -182,13 +182,13 @@ func (client *libvirtClient) CreateDomain(input CreateDomainInput) error {
return fmt.Errorf("machine does not has a IgnKey nor CloudInit value")
}

glog.Infof("setDisks")
glog.Info("Create volume")
VolumeKey := baseVolumePath + input.VolumeName
if err := setDisks(&domainDef, client.connection, VolumeKey); err != nil {
return fmt.Errorf("Failed to setDisks: %s", err)
}

glog.Infof("setNetworkInterfaces")
glog.Info("Set up network interface")
var waitForLeases []*libvirtxml.DomainInterface
hostName := input.HostName
if hostName == "" {
Expand Down Expand Up @@ -313,12 +313,12 @@ func (client *libvirtClient) DeleteDomain(name string) error {

if err := domain.UndefineFlags(libvirt.DOMAIN_UNDEFINE_NVRAM); err != nil {
if e := err.(libvirt.Error); e.Code == libvirt.ERR_NO_SUPPORT || e.Code == libvirt.ERR_INVALID_ARG {
glog.Infof("libvirt does not support undefine flags: will try again without flags")
glog.Info("libvirt does not support undefine flags: will try again without flags")
if err := domain.Undefine(); err != nil {
return fmt.Errorf("Couldn't undefine libvirt domain: %s", err)
return fmt.Errorf("couldn't undefine libvirt domain: %v", err)
}
} else {
return fmt.Errorf("Couldn't undefine libvirt domain with flags: %s", err)
return fmt.Errorf("couldn't undefine libvirt domain with flags: %v", err)
}
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/cloud/libvirt/client/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func newCloudInitDef() defCloudInit {
// Create the ISO holding all the cloud-init data
// Returns a string with the full path to the ISO file
func (ci *defCloudInit) createISO() (string, error) {
glog.Infof("Creating new ISO")
glog.Info("Creating new ISO")
tmpDir, err := ci.createFiles()
if err != nil {
return "", err
Expand All @@ -132,7 +132,7 @@ func (ci *defCloudInit) createISO() (string, error) {

glog.Infof("About to execute cmd: %+v", cmd)
if err = cmd.Run(); err != nil {
return "", fmt.Errorf("Error while starting the creation of CloudInit's ISO image: %s", err)
return "", fmt.Errorf("error while starting the creation of CloudInit's ISO image: %s", err)
}
glog.Infof("ISO created at %s", isoDestination)

Expand All @@ -143,7 +143,7 @@ func (ci *defCloudInit) createISO() (string, error) {
// Returns a string containing the name of the temporary directory and an error
// object
func (ci *defCloudInit) createFiles() (string, error) {
glog.Infof("Creating ISO contents")
glog.Info("Creating ISO contents")
tmpDir, err := ioutil.TempDir("", "cloudinit")
if err != nil {
return "", fmt.Errorf("Cannot create tmp directory for cloudinit ISO generation: %s",
Expand All @@ -162,7 +162,7 @@ func (ci *defCloudInit) createFiles() (string, error) {
return "", fmt.Errorf("Error while writing network-config to file: %s", err)
}

glog.Infof("ISO contents created")
glog.Info("ISO contents created")

return tmpDir, nil
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/cloud/libvirt/client/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func getHostCapabilities(virConn *libvirt.Connect) (libvirtxml.Caps, error) {

func getGuestForArchType(caps libvirtxml.Caps, arch string, virttype string) (libvirtxml.CapsGuest, error) {
for _, guest := range caps.Guests {
glog.Infof("Checking for %s/%s against %s/%s\n", arch, virttype, guest.Arch.Name, guest.OSType)
glog.Infof("Checking for %s/%s against %s/%s", arch, virttype, guest.Arch.Name, guest.OSType)
if guest.Arch.Name == arch && guest.OSType == virttype {
glog.Infof("Found %d machines in guest for %s/%s", len(guest.Arch.Machines), arch, virttype)
return guest, nil
Expand All @@ -157,7 +157,7 @@ func getGuestForArchType(caps libvirtxml.Caps, arch string, virttype string) (li
}

func getCanonicalMachineName(caps libvirtxml.Caps, arch string, virttype string, targetmachine string) (string, error) {
glog.Infof("getCanonicalMachineName")
glog.Info("Get machine name")
guest, err := getGuestForArchType(caps, arch, virttype)
if err != nil {
return "", err
Expand Down Expand Up @@ -267,18 +267,18 @@ func randomWWN(strlen int) string {

func setDisks(domainDef *libvirtxml.Domain, virConn *libvirt.Connect, volumeKey string) error {
disk := newDefDisk(0)
glog.Infof("LookupStorageVolByKey")
glog.Info("Looking up storage volume by key")
diskVolume, err := virConn.LookupStorageVolByKey(volumeKey)
if err != nil {
return fmt.Errorf("Can't retrieve volume %s", volumeKey)
}
glog.Infof("diskVolume")
glog.Info("Getting disk volume")
diskVolumeFile, err := diskVolume.GetPath()
if err != nil {
return fmt.Errorf("Error retrieving volume file: %s", err)
}

glog.Infof("DomainDiskSource")
glog.Info("Constructing domain disk source")
disk.Source = &libvirtxml.DomainDiskSource{
File: &libvirtxml.DomainDiskSourceFile{
File: diskVolumeFile,
Expand Down Expand Up @@ -347,7 +347,7 @@ func setNetworkInterfaces(domainDef *libvirtxml.Domain,
if networkInterfaceHostname != "" {
hostname = networkInterfaceHostname
}
glog.Infof("Networkaddress %v", networkInterfaceAddress)
glog.Infof("Networkaddress: %v", networkInterfaceAddress)
if networkInterfaceAddress != "" {
_, networkCIDR, err := net.ParseCIDR(networkInterfaceAddress)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/libvirt/client/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func setIgnition(domainDef *libvirtxml.Domain, client *libvirtClient, ignition *providerconfigv1.Ignition, kubeClient kubernetes.Interface, machineNamespace, volumeName, poolName string) error {
glog.Infof("creating ignition file")
glog.Info("Creating ignition file")
ignitionDef := newIgnitionDef()

if ignition.UserDataSecret == "" {
Expand All @@ -38,7 +38,7 @@ func setIgnition(domainDef *libvirtxml.Domain, client *libvirtClient, ignition *
ignitionDef.PoolName = poolName
ignitionDef.Content = string(userDataSecret)

glog.Infof("ignition: %+v", ignitionDef)
glog.Infof("Ignition: %+v", ignitionDef)

ignitionVolumeName, err := ignitionDef.createAndUpload(client)
if err != nil {
Expand Down