Skip to content

Commit

Permalink
MGMT-18292: in order to be able to import openshift installer we need to
Browse files Browse the repository at this point in the history
update assisted service as it requires new hive
  • Loading branch information
tsorya committed Sep 27, 2024
1 parent 30ba9c5 commit a60693a
Show file tree
Hide file tree
Showing 166 changed files with 19,156 additions and 408 deletions.
13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ require (
github.com/openshift/cluster-api-provider-baremetal v0.0.0-20220408122422-7a548effc26e
github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20230308152226-83c0473d4429
github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519
github.com/openshift/hive/apis v0.0.0-20220222213051-def9088fdb5a
github.com/openshift/hive/apis v0.0.0-20231220215202-ad99b9e52d27
github.com/openshift/library-go v0.0.0-20240903143724-7c5c5d305ac1
github.com/openshift/machine-api-provider-gcp v0.0.1-0.20231014045125-6096cc86f3ba
github.com/openshift/machine-api-provider-ibmcloud v0.0.0-20231207164151-6b0b8ea7b16d
Expand Down Expand Up @@ -218,6 +218,7 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down Expand Up @@ -245,7 +246,8 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/openshift/assisted-service v1.0.10-0.20230830164851-6573b5d7021d // indirect
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect
github.com/openshift/machine-api-operator v0.2.1-0.20240722145313-3a817c78946a // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
Expand All @@ -260,6 +262,7 @@ require (
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/thoas/go-funk v0.9.3 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
github.com/zclconf/go-cty v1.11.0 // indirect
Expand Down Expand Up @@ -312,11 +315,11 @@ replace (

replace sigs.k8s.io/cluster-api-provider-ibmcloud => sigs.k8s.io/cluster-api-provider-ibmcloud v0.9.0-alpha.0.0.20240913094112-c6bcd313bce0

replace github.com/openshift/assisted-service/api => github.com/openshift/assisted-service/api v0.0.0-20230831114549-1922eda29cf8
replace github.com/openshift/assisted-service/api => github.com/tsorya/assisted-service/api v0.0.0-20240926132224-e7d6fe26c8ff

replace github.com/openshift/assisted-service/client => github.com/openshift/assisted-service/client v0.0.0-20230831114549-1922eda29cf8
replace github.com/openshift/assisted-service/client => github.com/tsorya/assisted-service/client v0.0.0-20240926132224-e7d6fe26c8ff

replace github.com/openshift/assisted-service/models => github.com/openshift/assisted-service/models v0.0.0-20230831114549-1922eda29cf8
replace github.com/openshift/assisted-service/models => github.com/tsorya/assisted-service/models v0.0.0-20240926132224-e7d6fe26c8ff

// https://issues.redhat.com/browse/OCPBUGS-8119
// https://issues.redhat.com/browse/OCPBUGS-27507
Expand Down
26 changes: 16 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@ github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++
github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc=
github.com/lestrrat-go/jwx v1.2.20/go.mod h1:tLE1XszaFgd7zaS5wHe4NxA+XVhu7xgdRvDpNyi3kNM=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc=
Expand Down Expand Up @@ -767,12 +769,8 @@ github.com/openshift/api v0.0.0-20240904015708-69df64132c91 h1:PfPpMwHR8iAxQuLpQ
github.com/openshift/api v0.0.0-20240904015708-69df64132c91/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
github.com/openshift/assisted-image-service v0.0.0-20240607085136-02df2e56dde6 h1:U6ve+dnHlHhAELoxX+rdFOHVhoaYl0l9qtxwYtsO6C0=
github.com/openshift/assisted-image-service v0.0.0-20240607085136-02df2e56dde6/go.mod h1:o2H5VwQhUD8P6XsK6dRmKpCCJqVvv12KJQZBXmcCXCU=
github.com/openshift/assisted-service/api v0.0.0-20230831114549-1922eda29cf8 h1:+fZLKbycDo4JeLwPGVSAgf2XPaJGLM341l9ZfrrlxG0=
github.com/openshift/assisted-service/api v0.0.0-20230831114549-1922eda29cf8/go.mod h1:PmMnbVno5ocinfELDdKOaatvT5ucJLrau+fjHQNeCiY=
github.com/openshift/assisted-service/client v0.0.0-20230831114549-1922eda29cf8 h1:9NpCGby6O44BlWqWCbd8wcN4QwBebR8McQGrjTwhlzQ=
github.com/openshift/assisted-service/client v0.0.0-20230831114549-1922eda29cf8/go.mod h1:k0S4WqxFuMBJYyinCgHjtWoEnE6/R2OyakW60MUHPYQ=
github.com/openshift/assisted-service/models v0.0.0-20230831114549-1922eda29cf8 h1:lQO/vwmLX4kSmZitusnqdq9KbuW402DWkcmR0CJfgBI=
github.com/openshift/assisted-service/models v0.0.0-20230831114549-1922eda29cf8/go.mod h1:ImkG1jQgM72erhLaZtWqEn0g0Y8AYUOxLR/HgvlPi2Y=
github.com/openshift/assisted-service v1.0.10-0.20230830164851-6573b5d7021d h1:CKw2Y4EdaFsMoqAdr2Tq0nlYTaaXmCRdP0gOu7pN64U=
github.com/openshift/assisted-service v1.0.10-0.20230830164851-6573b5d7021d/go.mod h1:1J9kimemAdpLZVb3yLDEGmzwK0DXZ4/x6POeEog8A+4=
github.com/openshift/baremetal-operator/apis v0.0.0-20231128154154-6736c9b9c6c8 h1:f5nZJ4mB9Rf1epInmKoqDJGdoHyqZwHCiaE/OH4Yx84=
github.com/openshift/baremetal-operator/apis v0.0.0-20231128154154-6736c9b9c6c8/go.mod h1:CvKrrnAcvvtrZIc9y9WaqWmJhK0AJ9sWnh+VP4d7jcM=
github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231128154154-6736c9b9c6c8 h1:38vY9w7dXqB7tI9g1GCUnpahNDyBbp9Yylq+BQ154YE=
Expand All @@ -789,10 +787,10 @@ github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20230308152226-83c047
github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20230308152226-83c0473d4429/go.mod h1:jCWQvdjpxizEfnLAP7NyR3Itt0mMhRHxUScJZdaB2aM=
github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519 h1:foU7/s6DQczTFdZ/8H++pUC2Pzygqdz5ZgqUakksR5w=
github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519/go.mod h1:C7unCUThP8eqT4xQfbvg3oIDn2S9TYtb0wbBoH/SR2U=
github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4=
github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
github.com/openshift/hive/apis v0.0.0-20220222213051-def9088fdb5a h1:E+XPJs/aVvYsrlJzo2ED38ZTR2RTNUlFMmOaFAAdMZg=
github.com/openshift/hive/apis v0.0.0-20220222213051-def9088fdb5a/go.mod h1:E1bgquRiwfugdArdecPbpYIrAdve5kTzMaJb0+8jMXI=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 h1:cHyxR+Y8rAMT6m1jQCaYGRwikqahI0OjjUDhFNf3ySQ=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
github.com/openshift/hive/apis v0.0.0-20231220215202-ad99b9e52d27 h1:9C86viyQl7HE9yg7Gctgx803Oq6DbrCUAberyMVcWDE=
github.com/openshift/hive/apis v0.0.0-20231220215202-ad99b9e52d27/go.mod h1:RRH8lt09SAiPECNdsbh7Gun0lkcRWi1nYKq6tDp5WxQ=
github.com/openshift/library-go v0.0.0-20240903143724-7c5c5d305ac1 h1:qEMLKQXdGlUiK1KC2k6QK8og38eveU2/gcNBnQAwwmk=
github.com/openshift/library-go v0.0.0-20240903143724-7c5c5d305ac1/go.mod h1:/wmao3qtqOQ484HDka9cWP7SIvOQOdzpmhyXkF2YdzE=
github.com/openshift/machine-api-operator v0.2.1-0.20240722145313-3a817c78946a h1:0TwU3J28sQTGy/ZMVSvi3sUolH92BwlIWcf+wCJLWKE=
Expand Down Expand Up @@ -897,7 +895,15 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtse
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/thedevsaddam/retry v0.0.0-20200324223450-9769a859cc6d h1:U8ZUZKRBI+Xgo3QWD/alCQ2vIysyl0Efx8yCJWPdaGQ=
github.com/thedevsaddam/retry v0.0.0-20200324223450-9769a859cc6d/go.mod h1:2rz2mY+1qEXG47loLDkV+ZJHGFwmhax5rOTpP+5aR80=
github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw=
github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tsorya/assisted-service/api v0.0.0-20240926132224-e7d6fe26c8ff h1:6YeftLhZ9J6Eq9m4bZ/xf0/4vbzE7HvUNzh8iBkiADE=
github.com/tsorya/assisted-service/api v0.0.0-20240926132224-e7d6fe26c8ff/go.mod h1:Jhy3+Azp3IkLDCe4ET54nQondYKa+BlHOsurSgZsD4s=
github.com/tsorya/assisted-service/client v0.0.0-20240926132224-e7d6fe26c8ff h1:VniDr/5Bkkyv4sFRD30s7hfXrVKJAFJqJSq/3nWwgPo=
github.com/tsorya/assisted-service/client v0.0.0-20240926132224-e7d6fe26c8ff/go.mod h1:y+GNZgra/iQDYlacSjgscim8ldrSOMtV3jQaSKC3APc=
github.com/tsorya/assisted-service/models v0.0.0-20240926132224-e7d6fe26c8ff h1:vBFEQi+yYKY5gEu93e0p1Bwtlwb1NLvdf69UrdXlGO0=
github.com/tsorya/assisted-service/models v0.0.0-20240926132224-e7d6fe26c8ff/go.mod h1:bx9NsPeBkhn7az/qFHo3hW8wFqFj4BmT3g1R7wR9gcw=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/agent/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"github.com/openshift/installer/pkg/types/vsphere"
)

const (
ExternalPlatformNameOci = "oci"
)

// SupportedInstallerPlatforms lists the supported platforms for agent installer.
func SupportedInstallerPlatforms() []string {
return []string{baremetal.Name, vsphere.Name, none.Name, external.Name}
Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/agent/image/agentartifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"

"github.com/openshift/assisted-image-service/pkg/isoeditor"
"github.com/openshift/assisted-service/models"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
config "github.com/openshift/installer/pkg/asset/agent/agentconfig"
"github.com/openshift/installer/pkg/asset/agent/manifests"
"github.com/openshift/installer/pkg/asset/agent/mirror"
Expand Down Expand Up @@ -76,7 +76,7 @@ func (a *AgentArtifacts) Generate(_ context.Context, dependencies asset.Parents)
}

var agentTuiFiles []string
if agentClusterInstall.GetExternalPlatformName() != string(models.PlatformTypeOci) {
if agentClusterInstall.GetExternalPlatformName() != agent.ExternalPlatformNameOci {
agentTuiFiles, err = a.fetchAgentTuiFiles(agentManifests.ClusterImageSet.Spec.ReleaseImage, agentManifests.GetPullSecretData(), registriesConf.MirrorConfig)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions pkg/asset/agent/image/kargs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/sirupsen/logrus"

hiveext "github.com/openshift/assisted-service/api/hiveextension/v1beta1"
"github.com/openshift/assisted-service/models"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/openshift/installer/pkg/asset/agent/joiner"
"github.com/openshift/installer/pkg/asset/agent/manifests"
"github.com/openshift/installer/pkg/asset/agent/workflow"
Expand Down Expand Up @@ -40,8 +40,8 @@ func (a *Kargs) Generate(_ context.Context, dependencies asset.Parents) error {
case workflow.AgentWorkflowTypeInstall:
a.fips = agentClusterInstall.FIPSEnabled()
// Add kernel args for external oci platform
if agentClusterInstall.GetExternalPlatformName() == string(models.PlatformTypeOci) {
logrus.Debugf("Added kernel args to enable serial console for %s %s platform", hiveext.ExternalPlatformType, string(models.PlatformTypeOci))
if agentClusterInstall.GetExternalPlatformName() == agent.ExternalPlatformNameOci {
logrus.Debugf("Added kernel args to enable serial console for %s %s platform", hiveext.ExternalPlatformType, agent.ExternalPlatformNameOci)
a.consoleArgs = " console=ttyS0"
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/agent/image/kargs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/openshift/assisted-service/api/hiveextension/v1beta1"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/openshift/installer/pkg/asset/agent/joiner"
"github.com/openshift/installer/pkg/asset/agent/manifests"
"github.com/openshift/installer/pkg/asset/agent/workflow"
Expand Down Expand Up @@ -54,7 +55,7 @@ func TestKargs_Generate(t *testing.T) {
},
Spec: v1beta1.AgentClusterInstallSpec{
ExternalPlatformSpec: &v1beta1.ExternalPlatformSpec{
PlatformName: "oci",
PlatformName: agent.ExternalPlatformNameOci,
},
},
},
Expand Down
7 changes: 4 additions & 3 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/assisted-service/models"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/installconfig"
"github.com/openshift/installer/pkg/asset/releaseimage"
Expand Down Expand Up @@ -133,10 +132,12 @@ func (a *OptionalInstallConfig) validatePlatformsByName(installConfig *types.Ins
var allErrs field.ErrorList

if installConfig.Platform.Name() == external.Name {
if installConfig.Platform.External.PlatformName == string(models.PlatformTypeOci) &&
if installConfig.Platform.External.PlatformName == ExternalPlatformNameOci &&
installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
fieldPath := field.NewPath("Platform", "External", "CloudControllerManager")
allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager, fmt.Sprintf("When using external %s platform, %s must be set to %s", string(models.PlatformTypeOci), fieldPath, external.CloudControllerManagerTypeExternal)))
allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
fmt.Sprintf("When using external %s platform, %s must be set to %s",
ExternalPlatformNameOci, fieldPath, external.CloudControllerManagerTypeExternal)))
}
}

Expand Down
7 changes: 3 additions & 4 deletions pkg/asset/agent/manifests/agentclusterinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

configv1 "github.com/openshift/api/config/v1"
hiveext "github.com/openshift/assisted-service/api/hiveextension/v1beta1"
"github.com/openshift/assisted-service/models"
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 @@ -104,7 +103,7 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
installConfigWExternalOCIPlatform := getValidOptionalInstallConfig()
installConfigWExternalOCIPlatform.Config.Platform = types.Platform{
External: &externaltype.Platform{
PlatformName: string(models.PlatformTypeOci),
PlatformName: agent.ExternalPlatformNameOci,
CloudControllerManager: externaltype.CloudControllerManagerTypeExternal,
},
}
Expand All @@ -118,7 +117,7 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
goodExternalOCIPlatformACI.Spec.Networking.UserManagedNetworking = &val
goodExternalOCIPlatformACI.Spec.PlatformType = hiveext.ExternalPlatformType
goodExternalOCIPlatformACI.Spec.ExternalPlatformSpec = &hiveext.ExternalPlatformSpec{
PlatformName: string(models.PlatformTypeOci),
PlatformName: agent.ExternalPlatformNameOci,
}
goodExternalOCIPlatformACI.SetAnnotations(map[string]string{
installConfigOverrides: `{"platform":{"external":{"platformName":"oci","cloudControllerManager":"External"}}}`,
Expand Down Expand Up @@ -405,7 +404,7 @@ spec:
IngressVIP: "192.168.111.4",
PlatformType: hiveext.ExternalPlatformType,
ExternalPlatformSpec: &hiveext.ExternalPlatformSpec{
PlatformName: string(models.PlatformTypeOci),
PlatformName: agent.ExternalPlatformNameOci,
},
ClusterDeploymentRef: corev1.LocalObjectReference{
Name: "ostest",
Expand Down
6 changes: 6 additions & 0 deletions vendor/github.com/lib/pq/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/lib/pq/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions vendor/github.com/lib/pq/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions vendor/github.com/lib/pq/TESTS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a60693a

Please sign in to comment.