Documentation ¶
Index ¶
- Constants
- func AssertMultiClusterResourceStatus(assert *assert.Assertions, actualStatus v1alpha1.MultiClusterResourceStatus, ...)
- func DoExpectGetMCRegistrationSecret(cli *mocks.MockClient)
- func DoExpectUpdateState(t *testing.T, cli *mocks.MockClient, statusWriter *mocks.MockStatusWriter, ...)
- func ExpectDeleteAssociatedResource(cli *mocks.MockClient, resource runtime.Object, name types.NamespacedName)
- func NewRequest(namespace string, name string) ctrl.Request
- func ReadContainerizedWorkload(rawWorkload runtime.RawExtension) (v1alpha2.ContainerizedWorkload, error)
- func ReadYaml2Json(filename string) ([]byte, error)
Constants ¶
const UnitTestClusterName = "cluster1"
UnitTestClusterName - cluster name used in unit tests
Variables ¶
This section is empty.
Functions ¶
func AssertMultiClusterResourceStatus ¶
func AssertMultiClusterResourceStatus(assert *assert.Assertions, actualStatus v1alpha1.MultiClusterResourceStatus, expectedState v1alpha1.StateType, expectedConditionType v1alpha1.ConditionType, expectedConditionStatus v1.ConditionStatus)
AssertMultiClusterResourceStatus asserts that the status, conditions and cluster level status on the MultiClusterResourceStatus are as expected
func DoExpectGetMCRegistrationSecret ¶
func DoExpectGetMCRegistrationSecret(cli *mocks.MockClient)
DoExpectGetMCRegistrationSecret adds an expectation to the given MockClient to expect a Get call for the managed cluster registration secret, and populate it with the cluster-name
func DoExpectUpdateState ¶
func DoExpectUpdateState(t *testing.T, cli *mocks.MockClient, statusWriter *mocks.MockStatusWriter, mcAppConfig clusters.MultiClusterResource, expectedState v1alpha1.StateType)
DoExpectUpdateState checks that the status writer was retrieved and an update of the resource's state to the given value was called
func ExpectDeleteAssociatedResource ¶ added in v0.13.0
func ExpectDeleteAssociatedResource(cli *mocks.MockClient, resource runtime.Object, name types.NamespacedName)
ExpectDeleteAssociatedResource adds an expectation to the given MockClient to expect a Get call for the runtime resource and a subsequent request to delete it
func NewRequest ¶
NewRequest creates a new reconciler request for testing namespace - The namespace to use in the request name - The name to use in the request
func ReadContainerizedWorkload ¶
func ReadContainerizedWorkload(rawWorkload runtime.RawExtension) (v1alpha2.ContainerizedWorkload, error)
ReadContainerizedWorkload reads the raw workload (typically from an OAM component) into a ContainerizedWorkload object
func ReadYaml2Json ¶
ReadYaml2Json reads the testdata YAML file at the given path, converts it to JSON and returns a byte slice containing the JSON
Types ¶
This section is empty.