-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package utils | ||
|
||
import mcclientset "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned" | ||
|
||
// OpenshiftFlavor holds metadata about the type of Openshift environment the operator is in. | ||
type OpenshiftFlavor string | ||
|
||
const ( | ||
// Hypershift flavor of openshift: https://github.com/openshift/hypershift | ||
OpenshiftFlavorHypershift OpenshiftFlavor = "hypershift" | ||
OpenshiftFlavorDefault OpenshiftFlavor = "default" | ||
) | ||
|
||
// OpenshiftContext contains metadata and structs utilized to interact with Openshift clusters | ||
type OpenshiftContext struct { | ||
// McClient is a client for MachineConfigs in an Openshift environment | ||
McClient mcclientset.Interface | ||
// OpenshiftFlavor holds metadata about the type of Openshift environment the operator is in. | ||
OpenshiftFlavor OpenshiftFlavor | ||
} | ||
|
||
func (c OpenshiftContext) IsHypershift() bool { | ||
return c.OpenshiftFlavor == OpenshiftFlavorHypershift | ||
} |