Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
creationTimestamp: null
name: ostest
Expand Down Expand Up @@ -73,7 +75,7 @@ status:
progress:
totalPercentage: 0
-- expected/cluster-deployment.yaml --
apiVersion: v1
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
creationTimestamp: null
Expand All @@ -95,6 +97,8 @@ spec:
name: ostest-pull-secret
status: {}
-- expected/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
creationTimestamp: null
name: openshift-was not built correctly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ metadata:
rendezvousIP: 192.168.111.80

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
annotations:
agent-install.openshift.io/install-config-overrides: '{"platform":{"baremetal":{"hosts":[{"name":"master-0","bmc":{"username":"foo","password":"pwd1","address":"http://172.22.0.10:8000/redfish/v1/Systems/d3fe1eb9-f04c-465d-b5d6-d267f0a0059b","disableCertificateVerification":false},"role":"","bootMACAddress":"00:00:00:aa:bb:01","hardwareProfile":""},{"name":"master-1","bmc":{"username":"foo","password":"pwd2","address":"http://172.22.0.11:8000/redfish/v1/Systems/65bf6806-b634-4494-bccf-032ebdecc65d","disableCertificateVerification":false},"role":"","bootMACAddress":"00:00:00:aa:bb:02","hardwareProfile":""},{"name":"master-2","bmc":{"username":"foo","password":"pwd3","address":"http://172.22.0.12:8000/redfish/v1/Systems/ff67e706-28c4-42f6-b9a2-ce714195300a","disableCertificateVerification":false},"role":"","bootMACAddress":"00:00:00:aa:bb:03","hardwareProfile":""}],"clusterProvisioningIP":"172.22.0.3","provisioningNetwork":"Managed","provisioningNetworkInterface":"enp1s0","provisioningNetworkCIDR":"172.22.0.0/24","provisioningDHCPRange":"172.22.0.10,172.22.0.254"}}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
annotations:
agent-install.openshift.io/install-config-overrides: '{"platform":{"external":{"platformName":"some-cloud-provider"}}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
creationTimestamp: null
name: ostest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
annotations:
agent-install.openshift.io/install-config-overrides: '{"platform":{"vsphere":{"vcenters":[{"server":"vcenter.openshift.com","user":"testUser","password":"testPassword","datacenters":["testDatacenter"]}],"failureDomains":[{"name":"testfailureDomain","region":"testRegion","zone":"testZone","server":"vcenter.openshift.com","topology":{"datacenter":"testDatacenter","computeCluster":"/testDatacenter/host/testComputecluster","networks":["testNetwork"],"datastore":"/testDatacenter/datastore/testDatastore","resourcePool":"/testDatacenter/host/testComputecluster/Resources","folder":"/testDatacenter/vm/testFolder"}}]}}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
creationTimestamp: null
name: ostest
Expand Down Expand Up @@ -74,7 +76,7 @@ status:
progress:
totalPercentage: 0
-- expected/cluster-deployment.yaml --
apiVersion: v1
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
creationTimestamp: null
Expand All @@ -96,6 +98,8 @@ spec:
name: ostest-pull-secret
status: {}
-- expected/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
creationTimestamp: null
name: openshift-was not built correctly
Expand All @@ -104,6 +108,8 @@ spec:
releaseImage: $RELEASE_IMAGE
status: {}
-- expected/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
creationTimestamp: null
name: ostest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ unconfiguredIgnCmp /etc/assisted/manifests/infraenv.yaml expected/infraenv.yaml
unconfiguredIgnCmp /etc/assisted/manifests/pull-secret.yaml expected/pull-secret.yaml

-- cluster-manifests/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
name: ostest
namespace: cluster0
Expand All @@ -43,20 +45,26 @@ stringData:
}

-- cluster-manifests/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
name: cluster0-image-set
namespace: cluster0
spec:
releaseImage: $RELEASE_IMAGE

-- expected/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
name: cluster0-image-set
namespace: cluster0
spec:
releaseImage: $RELEASE_IMAGE

-- expected/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
creationTimestamp: null
name: ostest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ metadata:
rendezvousIP: 192.168.111.20

-- expected/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
creationTimestamp: null
name: openshift-was not built correctly
Expand All @@ -56,6 +58,8 @@ spec:
releaseImage: $RELEASE_IMAGE
status: {}
-- expected/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
creationTimestamp: null
name: ostest
Expand Down Expand Up @@ -96,4 +100,4 @@ stringData:
"auth": "c3VwZXItc2VjcmV0Cg=="
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ unconfiguredIgnContains /etc/assisted/manifests/cluster-image-set.yaml
unconfiguredIgnCmp /etc/assisted/manifests/cluster-image-set.yaml expected/cluster-image-set.yaml

-- cluster-manifests/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
name: ostest
namespace: cluster0
Expand All @@ -40,9 +42,11 @@ stringData:
}

-- expected/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
creationTimestamp: null
name: openshift-was not built correctly
spec:
releaseImage: $RELEASE_IMAGE
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ stderr 'failed to generate asset "InfraEnv Config": missing configuration or man
! exists $WORK/auth/kubeadmin-password

-- cluster-manifests/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
name: cluster0-image-set
namespace: cluster0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ stderr 'failed to generate asset "Agent PullSecret": missing configuration or ma
! exists $WORK/auth/kubeadmin-password

-- cluster-manifests/infraenv.yaml --
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
name: ostest
namespace: cluster0
Expand All @@ -21,6 +23,8 @@ spec:
sshAuthorizedKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDK6UTEydcEKzuNdPaofn8Z2DwgHqdcionLZBiPf/zIRNco++etLsat7Avv7yt04DINQd5zjxIFgG8jblaUB5E5C9ClUcMwb52GO0ay2Y9v1uBv1a4WhI3peKktAzYNk0EBMQlJtXPjRMrC9ylBPh+DsBHMu+KmDnfk7PIwyN4efC8k5kSRuPWoNdme1rz2+umU8FSmaWTHIajrbspf4GQbsntA5kuKEtDbfoNCU97o2KrRnUbeg3a8hwSjfh3u6MhlnGcg5K2Ij+zivEsWGCLKYUtE1ErqwfIzwWmJ6jnV66XCQGHf4Q1iIxqF7s2a1q24cgG2Z/iDXfqXrCIfy4P7b/Ztak3bdT9jfAdVZtdO5/r7I+O5hYhF86ayFlDWzZWP/ByiSb+q4CQbfVgK3BMmiAv2MqLHdhesmD/SmIcoOWUF6rFmRKZVFFpKpt5ATNTgUJ3JRowoXrrDruVXClUGRiCS6Zabd1rZ3VmTchaPJwtzQMdfIWISXj+Ig+C4UK0=

-- cluster-manifests/cluster-image-set.yaml --
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
metadata:
name: cluster0-image-set
namespace: cluster0
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/agent/manifests/agentclusterinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ func (a *AgentClusterInstall) Generate(dependencies asset.Parents) error {
}

agentClusterInstall := &hiveext.AgentClusterInstall{
TypeMeta: metav1.TypeMeta{
Kind: "AgentClusterInstall",
APIVersion: hiveext.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: getAgentClusterInstallName(installConfig),
Namespace: installConfig.ClusterNamespace(),
Expand Down
7 changes: 4 additions & 3 deletions pkg/asset/agent/manifests/clusterdeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"

hiveext "github.com/openshift/assisted-service/api/hiveextension/v1beta1"
hivev1 "github.com/openshift/hive/apis/hive/v1"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
Expand Down Expand Up @@ -57,7 +58,7 @@ func (cd *ClusterDeployment) Generate(dependencies asset.Parents) error {
clusterDeployment := &hivev1.ClusterDeployment{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterDeployment",
APIVersion: "v1",
APIVersion: hivev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: getClusterDeploymentName(installConfig),
Expand All @@ -70,8 +71,8 @@ func (cd *ClusterDeployment) Generate(dependencies asset.Parents) error {
Name: getPullSecretName(installConfig.ClusterName()),
},
ClusterInstallRef: &hivev1.ClusterInstallLocalReference{
Group: "extensions.hive.openshift.io",
Version: "v1beta1",
Group: hiveext.Group,
Version: hiveext.Version,
Kind: "AgentClusterInstall",
Name: getAgentClusterInstallName(installConfig),
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/agent/manifests/clusterdeployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestClusterDeployment_Generate(t *testing.T) {
expectedConfig: &hivev1.ClusterDeployment{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterDeployment",
APIVersion: "v1",
APIVersion: "hive.openshift.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getClusterDeploymentName(getValidOptionalInstallConfig()),
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/agent/manifests/clusterimageset.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (a *ClusterImageSet) Generate(dependencies asset.Parents) error {

func (a *ClusterImageSet) generateManifest(version, releaseImage, clusterNamespace string) error {
clusterImageSet := &hivev1.ClusterImageSet{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterImageSet",
APIVersion: hivev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("openshift-%s", version),
Namespace: clusterNamespace,
Expand Down
12 changes: 12 additions & 0 deletions pkg/asset/agent/manifests/clusterimageset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func TestClusterImageSet_Generate(t *testing.T) {
},
},
expectedConfig: &hivev1.ClusterImageSet{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterImageSet",
APIVersion: "hive.openshift.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "openshift-was not built correctly",
},
Expand Down Expand Up @@ -70,6 +74,10 @@ func TestClusterImageSet_Generate(t *testing.T) {
},
},
expectedConfig: &hivev1.ClusterImageSet{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterImageSet",
APIVersion: "hive.openshift.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "openshift-was not built correctly",
Namespace: getValidOptionalInstallConfig().ClusterNamespace(),
Expand All @@ -92,6 +100,10 @@ func TestClusterImageSet_Generate(t *testing.T) {
&releaseimage.Image{},
},
expectedConfig: &hivev1.ClusterImageSet{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterImageSet",
APIVersion: "hive.openshift.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "openshift-4.16.0",
Namespace: "agent-cluster",
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/agent/manifests/infraenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func (i *InfraEnv) Generate(dependencies asset.Parents) error {

func (i *InfraEnv) generateManifest(clusterName, clusterNamespace, sshKey, additionalTrustBundle string, proxy *types.Proxy, architecture string) error {
infraEnv := &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: aiv1beta1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: clusterName,
Namespace: clusterNamespace,
Expand Down
20 changes: 20 additions & 0 deletions pkg/asset/agent/manifests/infraenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func TestInfraEnv_Generate(t *testing.T) {
getValidAgentConfig(),
},
expectedConfig: &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: "agent-install.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getValidOptionalInstallConfig().ClusterName(),
Namespace: getValidOptionalInstallConfig().ClusterNamespace(),
Expand Down Expand Up @@ -77,6 +81,10 @@ func TestInfraEnv_Generate(t *testing.T) {
getValidAgentConfig(),
},
expectedConfig: &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: "agent-install.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getClusterDeploymentName(getProxyValidOptionalInstallConfig()),
Namespace: getProxyValidOptionalInstallConfig().ClusterNamespace(),
Expand Down Expand Up @@ -106,6 +114,10 @@ func TestInfraEnv_Generate(t *testing.T) {
getValidAgentConfigWithAdditionalNTPSources(),
},
expectedConfig: &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: "agent-install.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getClusterDeploymentName(getProxyValidOptionalInstallConfig()),
Namespace: getProxyValidOptionalInstallConfig().ClusterNamespace(),
Expand Down Expand Up @@ -136,6 +148,10 @@ func TestInfraEnv_Generate(t *testing.T) {
getValidAgentConfig(),
},
expectedConfig: &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: "agent-install.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getClusterDeploymentName(getProxyValidOptionalInstallConfig()),
Namespace: getProxyValidOptionalInstallConfig().ClusterNamespace(),
Expand Down Expand Up @@ -173,6 +189,10 @@ func TestInfraEnv_Generate(t *testing.T) {
&agentconfig.AgentConfig{},
},
expectedConfig: &aiv1beta1.InfraEnv{
TypeMeta: metav1.TypeMeta{
Kind: "InfraEnv",
APIVersion: "agent-install.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "agent-cluster",
Namespace: "agent-ns",
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/agent/manifests/nmstateconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (n *NMStateConfig) Generate(dependencies asset.Parents) error {
nmStateConfig := aiv1beta1.NMStateConfig{
TypeMeta: metav1.TypeMeta{
Kind: "NMStateConfig",
APIVersion: "agent-install.openshift.io/v1beta1",
APIVersion: aiv1beta1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf(getNMStateConfigName(installConfig)+"-%d", i),
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/agent/manifests/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ func getAgentHostsWithBMCConfig() *agentconfig.AgentHosts {

func getGoodACI() *hiveext.AgentClusterInstall {
goodACI := &hiveext.AgentClusterInstall{
TypeMeta: metav1.TypeMeta{
Kind: "AgentClusterInstall",
APIVersion: "extensions.hive.openshift.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getAgentClusterInstallName(getValidOptionalInstallConfig()),
Namespace: getValidOptionalInstallConfig().ClusterNamespace(),
Expand Down