-
Notifications
You must be signed in to change notification settings - Fork 79
[OCPCLOUD-1162] Implement bootstrap aws #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: aws-cloud-controller-manager | ||
| namespace: kube-system | ||
| spec: | ||
| priorityClassName: system-cluster-critical | ||
| containers: | ||
| - args: | ||
| - --cloud-provider=aws | ||
| - --use-service-account-credentials=false | ||
| - --controllers=cloud-node # run only cloud-node controller required to bootstrap master nodes | ||
| - --kubeconfig=/etc/kubernetes/secrets/kubeconfig | ||
| - --leader-elect=false | ||
| - -v=2 | ||
| image: gcr.io/k8s-staging-provider-aws/cloud-controller-manager:v1.19.0-alpha.1 | ||
|
Danil-Grigorev marked this conversation as resolved.
|
||
| imagePullPolicy: IfNotPresent | ||
| name: cloud-controller-manager | ||
| volumeMounts: | ||
| - mountPath: /etc/kubernetes/secrets | ||
| name: secrets | ||
| readOnly: true | ||
| hostNetwork: true | ||
| volumes: | ||
| - hostPath: | ||
| path: /etc/kubernetes/bootstrap-secrets | ||
| name: secrets | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,3 +71,66 @@ func TestGetResources(t *testing.T) { | |
| }) | ||
| } | ||
| } | ||
|
|
||
| func TestGetBootstrapResources(t *testing.T) { | ||
| tc := []struct { | ||
| name string | ||
| platform configv1.PlatformType | ||
| expected []client.Object | ||
| }{{ | ||
| name: "AWS resources returned as expected", | ||
| platform: configv1.AWSPlatformType, | ||
| expected: aws.GetBootstrapResources(), | ||
| }, { | ||
| name: "OpenStack resources are empty, as the platform is not yet supported", | ||
| platform: configv1.OpenStackPlatformType, | ||
| }, { | ||
| name: "GCP resources are empty, as the platform is not yet supported", | ||
| platform: configv1.GCPPlatformType, | ||
| }, { | ||
| name: "Azure resources are empty, as the platform is not yet supported", | ||
| platform: configv1.AzurePlatformType, | ||
| }, { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have an entry for azure stack hub as well?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no platform for Azure Stack Hub :( We will have to implement additional logic to separate Azure and Azure Stack Hub similar to https://issues.redhat.com/browse/OCPCLOUD-1187 (well, starting from that, and then read the full infra status in operator as well to get it right).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack, thanks! |
||
| name: "VSphere resources are empty, as the platform is not yet supported", | ||
| platform: configv1.VSpherePlatformType, | ||
| }, { | ||
| name: "OVirt resources are empty, as the platform is not yet supported", | ||
| platform: configv1.OvirtPlatformType, | ||
| }, { | ||
| name: "IBMCloud resources are empty, as the platform is not yet supported", | ||
| platform: configv1.IBMCloudPlatformType, | ||
| }, { | ||
| name: "Libvirt resources are empty", | ||
| platform: configv1.LibvirtPlatformType, | ||
| }, { | ||
| name: "Kubevirt resources are empty", | ||
| platform: configv1.KubevirtPlatformType, | ||
| }, { | ||
| name: "BareMetal resources are empty", | ||
| platform: configv1.BareMetalPlatformType, | ||
| }, { | ||
| name: "None platform resources are empty", | ||
| platform: configv1.NonePlatformType, | ||
| }} | ||
|
|
||
| for _, tc := range tc { | ||
| t.Run(tc.name, func(t *testing.T) { | ||
| resources := GetBootstrapResources(tc.platform) | ||
|
|
||
| assert.Equal(t, len(tc.expected), len(resources)) | ||
| assert.EqualValues(t, tc.expected, resources) | ||
|
|
||
| if len(resources) > 0 { | ||
| // Edit and repeat procedure to ensure modification in place is not present | ||
| for _, resource := range resources { | ||
| resource.SetName("different") | ||
| } | ||
| newResources := GetBootstrapResources(tc.platform) | ||
|
|
||
| assert.Equal(t, len(tc.expected), len(newResources)) | ||
| assert.EqualValues(t, tc.expected, newResources) | ||
| assert.NotEqualValues(t, resources, newResources) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.