-
Notifications
You must be signed in to change notification settings - Fork 99
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
1 parent
2f032d7
commit aad8d9a
Showing
6 changed files
with
72 additions
and
1 deletion.
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
5 changes: 5 additions & 0 deletions
5
test/e2e/data/infrastructure-metal3/cluster-template-md-remediation/kustomization.yaml
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,5 @@ | ||
resources: | ||
- ../bases/ippool | ||
- ../bases/centos-kubeadm-config | ||
- md.yaml | ||
- mhc.yaml |
14 changes: 14 additions & 0 deletions
14
test/e2e/data/infrastructure-metal3/cluster-template-md-remediation/md.yaml
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,14 @@ | ||
--- | ||
apiVersion: cluster.x-k8s.io/${CAPI_VERSION} | ||
kind: MachineDeployment | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} | ||
nodepool: nodepool-0 | ||
name: ${CLUSTER_NAME} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
"e2e.remediation.label": "" |
19 changes: 19 additions & 0 deletions
19
test/e2e/data/infrastructure-metal3/cluster-template-md-remediation/mhc.yaml
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,19 @@ | ||
--- | ||
# MachineHealthCheck object with | ||
# - a selector that targets all the machines with label e2e.remediation.label="" | ||
# - unhealthyConditions triggering remediation after 10s the condition is set | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineHealthCheck | ||
metadata: | ||
name: "${CLUSTER_NAME}-mhc-0" | ||
namespace: ${NAMESPACE} | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
maxUnhealthy: 100% | ||
selector: | ||
matchLabels: | ||
e2e.remediation.label: "" | ||
unhealthyConditions: | ||
- type: e2e.remediation.condition | ||
status: "False" | ||
timeout: 10s |
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,30 @@ | ||
package e2e | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
capi_e2e "sigs.k8s.io/cluster-api/test/e2e" | ||
) | ||
|
||
var _ = Describe("When testing MachineDeployment remediation [healthcheck] [remediation] [features]", func() { | ||
BeforeEach(func() { | ||
osType := strings.ToLower(os.Getenv("OS")) | ||
Expect(osType).ToNot(Equal("")) | ||
validateGlobals(specName) | ||
// We need to override clusterctl apply log folder to avoid getting our credentials exposed. | ||
clusterctlLogFolder = filepath.Join(os.TempDir(), "clusters", bootstrapClusterProxy.GetName()) | ||
}) | ||
capi_e2e.MachineDeploymentRemediationSpec(ctx, func() capi_e2e.MachineDeploymentRemediationSpecInput { | ||
return capi_e2e.MachineDeploymentRemediationSpecInput{ | ||
E2EConfig: e2eConfig, | ||
ClusterctlConfigPath: clusterctlConfigPath, | ||
BootstrapClusterProxy: bootstrapClusterProxy, | ||
ArtifactFolder: artifactFolder, | ||
SkipCleanup: skipCleanup, | ||
} | ||
}) | ||
}) |