Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Nov 12, 2024
1 parent d26a0fb commit 960d824
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (
"github.com/deckhouse/virtualization-controller/pkg/controller/vmrestore"
"github.com/deckhouse/virtualization-controller/pkg/controller/vmsnapshot"
"github.com/deckhouse/virtualization-controller/pkg/logger"
"github.com/deckhouse/virtualization-controller/pkg/version"
"github.com/deckhouse/virtualization/api/client/kubeclient"
virtv2alpha1 "github.com/deckhouse/virtualization/api/core/v1alpha2"
)
Expand Down Expand Up @@ -294,4 +295,5 @@ func main() {
func printVersion(log *slog.Logger) {
log.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
log.Info(fmt.Sprintf("Edition: %s", version.GetEdition()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func compareAffinity(current, desired *v1alpha2.VirtualMachineSpec) []FieldChang
currentValue,
desiredValue,
reflect.DeepEqual(current.Affinity, desired.Affinity),
ActionRestart,
placementAction,
)
}

Expand All @@ -57,7 +57,7 @@ func compareNodeSelector(current, desired *v1alpha2.VirtualMachineSpec) []FieldC
currentValue,
desiredValue,
reflect.DeepEqual(current.NodeSelector, desired.NodeSelector),
ActionRestart,
placementAction,
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build !EE
// +build !EE

package vmchange

const placementAction = ActionRestart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build EE
// +build EE

package vmchange

const placementAction = ActionApplyImmediate
6 changes: 6 additions & 0 deletions images/virtualization-artifact/pkg/version/edition.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build !EE
// +build !EE

package version

const edition = "CE"
6 changes: 6 additions & 0 deletions images/virtualization-artifact/pkg/version/edition_ee.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build EE
// +build EE

package version

const edition = "EE"
5 changes: 5 additions & 0 deletions images/virtualization-artifact/pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package version

func GetEdition() string {
return edition
}
2 changes: 1 addition & 1 deletion images/virtualization-artifact/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ shell:
- export GOOS=linux
- export CGO_ENABLED=0
- export GOARCH=amd64
- go build -v -a -o virtualization-controller ./cmd/virtualization-controller
- go build -tag EE -v -a -o virtualization-controller ./cmd/virtualization-controller
- go build -v -a -o virtualization-api ./cmd/virtualization-api

0 comments on commit 960d824

Please sign in to comment.