Skip to content

Commit

Permalink
Bump machine-config-operator to match library-go
Browse files Browse the repository at this point in the history
We need to align the versions of machine-config-operator and library-go,
since there were underlying changes in library-go that broke in
machine-config-operator. This commit updates the library-go dependency
to match what machine-config-operator expects. The
machine-config-operator API moved to openshift-api, so we need to update
that, too.
  • Loading branch information
rhmdnd committed Jan 14, 2025
1 parent 7d80a00 commit 0a82874
Show file tree
Hide file tree
Showing 1,054 changed files with 177,597 additions and 18,813 deletions.
2 changes: 1 addition & 1 deletion cmd/manager/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"k8s.io/client-go/discovery"

ocpcfgv1 "github.com/openshift/api/config/v1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
Expand Down
5 changes: 3 additions & 2 deletions cmd/manager/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/ComplianceAsCode/compliance-operator/pkg/xccdf"
"github.com/ComplianceAsCode/compliance-operator/version"
ocpapi "github.com/openshift/api"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgapi "github.com/openshift/api/machineconfiguration"
monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
monclientv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -705,6 +705,7 @@ func getDefaultRoles(platform PlatformType) []string {

func generateOperatorServiceMonitor(service *v1.Service, namespace string) *monitoring.ServiceMonitor {
serviceMonitor := GenerateServiceMonitor(service)
m := "metrics." + namespace + ".svc"
for i := range serviceMonitor.Spec.Endpoints {
if serviceMonitor.Spec.Endpoints[i].Port == ctrlMetrics.ControllerMetricsServiceName {
serviceMonitor.Spec.Endpoints[i].Path = ctrlMetrics.HandlerPath
Expand All @@ -720,7 +721,7 @@ func generateOperatorServiceMonitor(service *v1.Service, namespace string) *moni
}
serviceMonitor.Spec.Endpoints[i].TLSConfig = &monitoring.TLSConfig{
SafeTLSConfig: monitoring.SafeTLSConfig{
ServerName: "metrics." + namespace + ".svc",
ServerName: &m,
},
CAFile: serviceMonitorTLSCAFile,
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/manager/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ var _ = Describe("Operator Startup Function tests", func() {
})
})
Context("Service Monitor Creation", func() {
m := "metrics.foobar.svc"
When("Installing to non-controlled namespace", func() {
It("ServiceMonitor is generated with the proper TLSConfig ServerName", func() {
metricService := operatorMetricService("foobar")
sm := generateOperatorServiceMonitor(metricService, "foobar")
controllerMetricServiceFound := false
for _, ep := range sm.Spec.Endpoints {
if ep.Port == metrics.ControllerMetricsServiceName && ep.TLSConfig != nil {
Expect(ep.TLSConfig.ServerName).To(BeEquivalentTo("metrics.foobar.svc"))
Expect(ep.TLSConfig.ServerName).To(BeEquivalentTo(&m))
controllerMetricServiceFound = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/manager/scap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"strings"
"time"

mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcfgcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
"gopkg.in/yaml.v3"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion cmd/manager/scap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
igntypes "github.com/coreos/ignition/v2/config/v3_2/types"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
262 changes: 224 additions & 38 deletions go.mod

Large diffs are not rendered by default.

519 changes: 519 additions & 0 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ComplianceAsCode/compliance-operator/pkg/controller/common"
"github.com/ComplianceAsCode/compliance-operator/pkg/controller/metrics"
"github.com/ComplianceAsCode/compliance-operator/pkg/utils"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
corev1 "k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/go-logr/zapr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgapi "github.com/openshift/api/machineconfiguration"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/go-logr/logr"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/go-logr/zapr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgapi "github.com/openshift/api/machineconfiguration"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/mcfgutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"fmt"

mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/nodeutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"

compliancev1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
"k8s.io/apimachinery/pkg/types"
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/nodeutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/parse_arf_result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"

compv1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcfgcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/remediation_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
igntypes "github.com/coreos/ignition/v2/config/v3_1/types"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgapi "github.com/openshift/api/machineconfiguration"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/remediationutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

compv1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgapi "github.com/openshift/api/machineconfiguration"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/framework/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
ocpapi "github.com/openshift/api"
configv1 "github.com/openshift/api/config/v1"
imagev1 "github.com/openshift/api/image/v1"
mcfgapi "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgapi "github.com/openshift/api/machineconfiguration"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
batchv1 "k8s.io/api/batch/v1"
core "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/serial/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

compsuitectrl "github.com/ComplianceAsCode/compliance-operator/pkg/controller/compliancesuite"
configv1 "github.com/openshift/api/config/v1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
12 changes: 12 additions & 0 deletions vendor/cloud.google.com/go/.gitignore

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

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

150 changes: 150 additions & 0 deletions vendor/cloud.google.com/go/.release-please-manifest-submodules.json

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

3 changes: 3 additions & 0 deletions vendor/cloud.google.com/go/.release-please-manifest.json

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

Loading

0 comments on commit 0a82874

Please sign in to comment.