Skip to content

Commit 46848be

Browse files
Merge pull request openshift#7947 from shiftstack/alongside_capi
NO-JIRA: Minor fixes
2 parents 67c114a + 21664c9 commit 46848be

File tree

8 files changed

+36
-29
lines changed

8 files changed

+36
-29
lines changed

data/data/manifests/openshift/90-okd-sca-pull-disable.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{if .IsOKD -}}
2-
kind: Secret
32
apiVersion: v1
3+
kind: Secret
44
metadata:
55
name: support
66
namespace: openshift-config

data/data/manifests/openshift/cloud-creds-secret.yaml.template

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
kind: Secret
21
apiVersion: v1
3-
metadata:
4-
namespace: kube-system
5-
{{- if .CloudCreds.AWS}}
6-
name: aws-creds
7-
{{- else if .CloudCreds.Azure}}
8-
name: azure-credentials
9-
{{- else if .CloudCreds.GCP}}
10-
name: gcp-credentials
11-
{{- else if .CloudCreds.IBMCloud}}
12-
name: ibmcloud-credentials
13-
{{- else if .CloudCreds.OpenStack}}
14-
name: openstack-credentials
15-
{{- else if .CloudCreds.VSphere}}
16-
name: vsphere-creds
17-
{{- else if .CloudCreds.Ovirt}}
18-
name: ovirt-credentials
19-
{{- end}}
202
data:
213
{{- if .CloudCreds.AWS}}
224
aws_access_key_id: {{.CloudCreds.AWS.Base64encodeAccessKeyID}}
@@ -48,3 +30,21 @@ data:
4830
ovirt_insecure: {{.CloudCreds.Ovirt.Base64encodeInsecure}}
4931
ovirt_ca_bundle: {{.CloudCreds.Ovirt.Base64encodeCABundle}}
5032
{{- end}}
33+
kind: Secret
34+
metadata:
35+
namespace: kube-system
36+
{{- if .CloudCreds.AWS}}
37+
name: aws-creds
38+
{{- else if .CloudCreds.Azure}}
39+
name: azure-credentials
40+
{{- else if .CloudCreds.GCP}}
41+
name: gcp-credentials
42+
{{- else if .CloudCreds.IBMCloud}}
43+
name: ibmcloud-credentials
44+
{{- else if .CloudCreds.OpenStack}}
45+
name: openstack-credentials
46+
{{- else if .CloudCreds.VSphere}}
47+
name: vsphere-creds
48+
{{- else if .CloudCreds.Ovirt}}
49+
name: ovirt-credentials
50+
{{- end}}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
kind: Secret
21
apiVersion: v1
2+
data:
3+
kubeadmin: {{.Base64EncodedKubeadminPwHash}}
4+
kind: Secret
35
metadata:
46
namespace: kube-system
57
name: kubeadmin
6-
data:
7-
kubeadmin: {{.Base64EncodedKubeadminPwHash}}

data/data/manifests/openshift/role-cloud-creds-secret-reader.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
kind: Role
21
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
33
metadata:
44
namespace: kube-system
55
{{- if .CloudCreds.AWS}}

docs/dev/cluster-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The Cluster API system is formed of a set of binaries. The core Cluster API mana
2626
The binaries are built and packaged during the standard installer build process, `hack/build.sh`. Cluster API specific build flow is contained in the `hack/build-cluster-api.sh` script:
2727
- Only enabled if the `OPENSHIFT_INSTALL_CLUSTER_API` environment variable is set.
2828
- Builds (as needed) every binary listed as a Go Module in the `cluster-api` folder.
29-
- Downloads (as needed) the specified version of `envtest` to pacakge `kube-apiserver` and `etcd`.
29+
- Downloads (as needed) the specified version of `envtest` to package `kube-apiserver` and `etcd`.
3030
- Produces a single `cluster-api.zip` file which is then copied in `pkg/clusterapi/mirror`.
3131

3232
To build an `openshift-install` binary with Cluster API bundled:

pkg/asset/machines/clusterapi.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import (
1919
"github.com/openshift/installer/pkg/asset/machines/aws"
2020
"github.com/openshift/installer/pkg/asset/manifests/capiutils"
2121
"github.com/openshift/installer/pkg/asset/rhcos"
22+
awstypes "github.com/openshift/installer/pkg/types/aws"
2223
awsdefaults "github.com/openshift/installer/pkg/types/aws/defaults"
24+
azuretypes "github.com/openshift/installer/pkg/types/azure"
2325
)
2426

2527
// GenerateClusterAPI generates manifests for target cluster.
@@ -30,7 +32,7 @@ func GenerateClusterAPI(ctx context.Context, installConfig *installconfig.Instal
3032
pool := *ic.ControlPlane
3133

3234
switch ic.Platform.Name() {
33-
case "aws":
35+
case awstypes.Name:
3436
subnets := map[string]string{}
3537
if len(ic.Platform.AWS.Subnets) > 0 {
3638
subnetMeta, err := installConfig.AWS.PrivateSubnets(ctx)
@@ -169,7 +171,8 @@ func GenerateClusterAPI(ctx context.Context, installConfig *installconfig.Instal
169171
File: asset.File{Filename: fmt.Sprintf("10_machine_%s.yaml", bootstrapMachine.Name)},
170172
Object: bootstrapMachine,
171173
})
172-
case "azure":
174+
case azuretypes.Name:
175+
// TODO: implement
173176
default:
174177
// TODO: support other platforms
175178
}

pkg/asset/manifests/clusterapi/cluster.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
"github.com/openshift/installer/pkg/asset/openshiftinstall"
2727
"github.com/openshift/installer/pkg/asset/rhcos"
2828
"github.com/openshift/installer/pkg/clusterapi"
29+
awstypes "github.com/openshift/installer/pkg/types/aws"
30+
azuretypes "github.com/openshift/installer/pkg/types/azure"
2931
)
3032

3133
const (
@@ -142,7 +144,7 @@ func (c *Cluster) Generate(dependencies asset.Parents) error {
142144

143145
var out *capiutils.GenerateClusterAssetsOutput
144146
switch platform := installConfig.Config.Platform.Name(); platform {
145-
case "aws":
147+
case awstypes.Name:
146148
// Move this somewhere else.
147149
// if err := aws.PutIAMRoles(clusterID.InfraID, installConfig); err != nil {
148150
// return errors.Wrap(err, "failed to create IAM roles")
@@ -152,11 +154,11 @@ func (c *Cluster) Generate(dependencies asset.Parents) error {
152154
if err != nil {
153155
return errors.Wrap(err, "failed to generate AWS manifests")
154156
}
155-
case "azure":
157+
case azuretypes.Name:
156158
var err error
157159
out, err = azure.GenerateClusterAssets(installConfig, clusterID)
158160
if err != nil {
159-
return errors.Wrap(err, "failed to generate AWS manifests")
161+
return errors.Wrap(err, "failed to generate Azure manifests")
160162
}
161163
default:
162164
return fmt.Errorf("unsupported platform %q", platform)

pkg/clusterapi/system.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ func (c *system) getInfrastructureController(provider *Provider, args []string,
278278
defaultManifestPath := filepath.Join(c.componentDir, fmt.Sprintf("/%s-infrastructure-components.yaml", provider.Name))
279279
if _, err := os.Stat(defaultManifestPath); err == nil {
280280
manifests = append(manifests, defaultManifestPath)
281+
} else {
282+
logrus.Infof("Failed to find manifests for provider %s at %s", provider.Name, defaultManifestPath)
281283
}
282284
return &controller{
283285
Provider: provider,

0 commit comments

Comments
 (0)