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
62 changes: 62 additions & 0 deletions changelog/fragments/bump-1.22.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
- Upgrade the Kubernetes dependencies from `1.21` to `1.22`.
- Upgrade the controller-gen dependency from `v0.6.2` to `v0.7.0`. More info: https://github.com/kubernetes-sigs/controller-tools/releases
- Upgrade the sigs.k8s.io/controller-runtime dependency from `v0.9.2` to `v0.10.0`. More info: https://github.com/kubernetes-sigs/controller-runtime/releases
- Upgrade the Env Test used from `1.21` to `1.22`.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "change"

# Is this a breaking change?
breaking: false

# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
#
# The generator auto-detects the PR number from the commit
# message in which this file was originally added.
#
# What is the pull request number (without the "#")?
# pull_request_override: 0


# Migration can be defined to automatically add a section to
# the migration guide. This is required for breaking changes.
migration:
header: Upgrade K8s versions to use 1.22 (golang/v3)
body: >
Note that to ensure the backwards compatibility SDK tool will try to downgrade the versions used if you need to still scaffold the v1beta1 for CRDs and Webhooks to publish your solutions into older cluster versions.
However, note that this version is no longer supported on Kubernetes 1.22+, and for sigs.k8s.io/controller-runtime v0.10.0 or controller-gen v0.7.0.

Following are the changes to be addressed in your `Makefile` and `go.mod` file if you are
not using the `v1beta1` K8s APIs which are no longer supported from k8s `1.22` version.

1) Update your `go.mod` file to upgrade the dependencies and run `go mod tidy` to download then

```go
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
sigs.k8s.io/controller-runtime v0.10.0
```

2) Update your Makefile by
- Replacing `ENVTEST_K8S_VERSION = 1.21` with `ENVTEST_K8S_VERSION = 1.22`
- Replacing `$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases` with `$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases`
- Now, you can also remove from the `Makefile` the `CRD_OPTIONS`, see below:

```
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
```

3) Replace your `admissionReviewVersions={v1,v1beta1}` markers with `admissionReviewVersions=v1`
4) Run `make manifest` to re-generate your manifests with latest versions.
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ require (
golang.org/x/tools v0.1.5
gomodules.xyz/jsonpatch/v3 v3.0.1
helm.sh/helm/v3 v3.6.2
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/api v0.22.2
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.22.1
k8s.io/client-go v0.22.2
k8s.io/kubectl v0.21.0
sigs.k8s.io/controller-runtime v0.10.0
sigs.k8s.io/controller-tools v0.6.2
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210803185103-51e4a9aa5055
sigs.k8s.io/controller-tools v0.7.0
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20211001202619-87eb9d55ecdc
sigs.k8s.io/yaml v1.2.0
)

Expand All @@ -53,6 +53,7 @@ replace (
github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0
golang.org/x/text => golang.org/x/text v0.3.3 // Required to fix CVE-2020-14040

)

exclude github.com/spf13/viper v1.3.2 // Required to fix CVE-2018-1098
29 changes: 19 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1754,16 +1754,18 @@ k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU=
k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s=
k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg=
k8s.io/api v0.22.1 h1:ISu3tD/jRhYfSW8jI/Q1e+lRxkR7w9UwQEZ7FgslrwY=
k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY=
k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw=
k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8=
k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY=
k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk=
k8s.io/apiextensions-apiserver v0.20.6/go.mod h1:qO8YMqeMmZH+lV21LUNzV41vfpoE9QVAJRA+MNqj0mo=
k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc=
k8s.io/apiextensions-apiserver v0.21.1/go.mod h1:KESQFCGjqVcVsZ9g0xX5bacMjyX5emuWcS2arzdEouA=
k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE=
k8s.io/apiextensions-apiserver v0.22.1 h1:YSJYzlFNFSfUle+yeEXX0lSQyLEoxoPJySRupepb0gE=
k8s.io/apiextensions-apiserver v0.22.1/go.mod h1:HeGmorjtRmRLE+Q8dJu6AYRoZccvCMsghwS8XTUYb2c=
k8s.io/apiextensions-apiserver v0.22.2 h1:zK7qI8Ery7j2CaN23UCFaC1hj7dMiI87n01+nKuewd4=
k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA=
k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA=
k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
Expand All @@ -1772,16 +1774,18 @@ k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP
k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
k8s.io/apimachinery v0.21.2/go.mod h1:CdTY8fU/BlvAbJ2z/8kBwimGki5Zp8/fbVuLY8gJumM=
k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI=
k8s.io/apimachinery v0.22.1 h1:DTARnyzmdHMz7bFWFDDm22AM4pLWTQECMpRTFu2d2OM=
k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk=
k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw=
k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU=
k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q=
k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg=
k8s.io/apiserver v0.21.1/go.mod h1:nLLYZvMWn35glJ4/FZRhzLG/3MPxAaZTgV4FJZdr+tY=
k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU=
k8s.io/apiserver v0.22.1 h1:Ul9Iv8OMB2s45h2tl5XWPpAZo1VPIJ/6N+MESeed7L8=
k8s.io/apiserver v0.22.1/go.mod h1:2mcM6dzSt+XndzVQJX21Gx0/Klo7Aen7i0Ai6tIa400=
k8s.io/apiserver v0.22.2 h1:TdIfZJc6YNhu2WxeAOWq1TvukHF0Sfx0+ln4XK9qnL4=
k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI=
k8s.io/cli-runtime v0.20.6/go.mod h1:JVERW478qcxWrUjJuWQSqyJeiz9QC4T6jmBznHFBC8w=
k8s.io/cli-runtime v0.21.0 h1:/V2Kkxtf6x5NI2z+Sd/mIrq4FQyQ8jzZAUD6N5RnN7Y=
k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo=
Expand All @@ -1791,23 +1795,26 @@ k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0=
k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA=
k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs=
k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU=
k8s.io/client-go v0.22.1 h1:jW0ZSHi8wW260FvcXHkIa0NLxFBQszTlhiAVsU5mopw=
k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk=
k8s.io/client-go v0.22.2 h1:DaSQgs02aCC1QcwUdkKZWOeaVsQjYvWv8ZazcZ6JcHc=
k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U=
k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/code-generator v0.20.6/go.mod h1:i6FmG+QxaLxvJsezvZp0q/gAEzzOz3U53KFibghWToU=
k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo=
k8s.io/code-generator v0.22.1/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o=
k8s.io/code-generator v0.22.2/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o=
k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM=
k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk=
k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM=
k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw=
k8s.io/component-base v0.21.1/go.mod h1:NgzFZ2qu4m1juby4TnrmpR8adRk6ka62YdH5DkIIyKA=
k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ=
k8s.io/component-base v0.22.1 h1:SFqIXsEN3v3Kkr1bS6rstrs1wd45StJqbtgbQ4nRQdo=
k8s.io/component-base v0.22.1/go.mod h1:0D+Bl8rrnsPN9v0dyYvkqFfBeAd4u7n77ze+p8CMiPo=
k8s.io/component-base v0.22.2 h1:vNIvE0AIrLhjX8drH0BgCNJcR4QZxMXcJzBsDplDx9M=
k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug=
k8s.io/component-helpers v0.20.6/go.mod h1:d4rFhZS/wxrZCxRiJJiWf1mVGVeMB5/ey3Yv8/rOp78=
k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
Expand Down Expand Up @@ -1840,8 +1847,9 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176 h1:Mx0aa+SUAcNRQbs5jUzV8lkDlGFU8laZsY9jrcVX5SY=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand All @@ -1857,12 +1865,13 @@ sigs.k8s.io/controller-runtime v0.10.0 h1:HgyZmMpjUOrtkaFtCnfxsR1bGRuFoAczSNbn2M
sigs.k8s.io/controller-runtime v0.10.0/go.mod h1:GCdh6kqV6IY4LK0JLwX0Zm6g233RtVGdb/f0+KSfprg=
sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
sigs.k8s.io/controller-tools v0.6.0/go.mod h1:baRMVPrctU77F+rfAuH2uPqW93k6yQnZA2dhUOr7ihc=
sigs.k8s.io/controller-tools v0.6.2 h1:+Y8L0UsAugDipGRw8lrkPoAi6XqlQVZuf1DQHME3PgU=
sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aeawbt3xTgJ8=
sigs.k8s.io/controller-tools v0.7.0 h1:iZIz1vEcavyEfxjcTLs1WH/MPf4vhPCtTKhoHqV8/G0=
sigs.k8s.io/controller-tools v0.7.0/go.mod h1:bpBAo0VcSDDLuWt47evLhMLPxRPxMDInTEH/YbdeMK0=
sigs.k8s.io/kind v0.10.0/go.mod h1:fb32zUw7ewC47bPwLnwhf47wd/vADtv3c38KP7sjIlo=
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210702145813-742983631190/go.mod h1:pUhjQx9f/+cn1OtSa5zMohY1lgk9s/9Mbcvwj82lrNk=
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210803185103-51e4a9aa5055 h1:3f5m0xp0DEsg+Sdrt1Rld8TCEFOH5GKsoYrEpdOzA+s=
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210803185103-51e4a9aa5055/go.mod h1:pUhjQx9f/+cn1OtSa5zMohY1lgk9s/9Mbcvwj82lrNk=
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20211001202619-87eb9d55ecdc h1:7HqFWk9fT5OfkZvY2CVHVrkRZAgS7n9rqsISG64/958=
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20211001202619-87eb9d55ecdc/go.mod h1:I7A2uB9NFAENStOGkI96dvx9D0uPH2uAiwjSQcyFSkU=
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
sigs.k8s.io/kustomize/api v0.8.5 h1:bfCXGXDAbFbb/Jv5AhMj2BB8a5VAJuuQ5/KU69WtDjQ=
Expand Down
38 changes: 19 additions & 19 deletions hack/generate/samples/internal/ansible/advanced_molecule.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"

log "github.com/sirupsen/logrus"
kbtestutils "sigs.k8s.io/kubebuilder/v3/test/e2e/utils"
kbutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"

"github.com/operator-framework/operator-sdk/hack/generate/samples/internal/pkg"
"github.com/operator-framework/operator-sdk/internal/util"
Expand Down Expand Up @@ -98,23 +98,23 @@ func (ma *AdvancedMolecule) Run() {
data:
sentinel: '{{ sentinel }}'
groups: '{{ groups | to_nice_yaml }}'`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
inventoryRoleTask,
"# tasks file for InventoryTest",
inventoryRoleTaskFragment)
pkg.CheckError("replacing inventory task", err)

log.Infof("updating inventorytest sample")
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "config", "samples", "test_v1alpha1_inventorytest.yaml"),
"name: inventorytest-sample",
inventorysampleFragment)
pkg.CheckError("updating inventorytest sample", err)

log.Infof("updating spec of inventorytest sample")
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "config", "samples", "test_v1alpha1_inventorytest.yaml"),
"foo: bar",
"# Add fields here",
"size: 3")
pkg.CheckError("updating spec of inventorytest sample", err)

Expand Down Expand Up @@ -156,7 +156,7 @@ func (ma *AdvancedMolecule) updateConfig() {
- update
- watch
#+kubebuilder:scaffold:rules`
err := util.ReplaceInFile(
err := kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "config", "rbac", "role.yaml"),
"#+kubebuilder:scaffold:rules",
cmRolesFragment)
Expand All @@ -165,7 +165,7 @@ func (ma *AdvancedMolecule) updateConfig() {
log.Infof("adding manager arg")
const ansibleVaultArg = `
- --ansible-args='--vault-password-file /opt/ansible/pwd.yml'`
err = kbtestutils.InsertCode(
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "config", "manager", "manager.yaml"),
"- --leader-election-id=advanced-molecule-operator",
ansibleVaultArg)
Expand All @@ -177,7 +177,7 @@ func (ma *AdvancedMolecule) updateConfig() {
value: "TRUE"
- name: ANSIBLE_INVENTORY
value: /opt/ansible/inventory`
err = kbtestutils.InsertCode(
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "config", "manager", "manager.yaml"),
"value: explicit",
managerEnv)
Expand All @@ -186,14 +186,14 @@ func (ma *AdvancedMolecule) updateConfig() {
log.Infof("adding vaulting args to the proxy auth")
const managerAuthArgs = `
- "--ansible-args='--vault-password-file /opt/ansible/pwd.yml'"`
err = kbtestutils.InsertCode(
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "config", "default", "manager_auth_proxy_patch.yaml"),
"- \"--leader-elect\"",
managerAuthArgs)
pkg.CheckError("adding vaulting args to the proxy auth", err)

log.Infof("adding task to not pull image to the config/testing")
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "config", "testing", "kustomization.yaml"),
"- manager_image.yaml",
"- manager_image.yaml\n- pull_policy/Never.yaml")
Expand Down Expand Up @@ -261,7 +261,7 @@ RUN ansible-galaxy collection build /tmp/fixture_collection/ --output-path /tmp/
RUN echo abc123 > /opt/ansible/pwd.yml \
&& ansible-vault encrypt_string --vault-password-file /opt/ansible/pwd.yml 'thisisatest' --name 'the_secret' > /opt/ansible/vars.yml
`
err = kbtestutils.InsertCode(
err = kbutil.InsertCode(
filepath.Join(ma.ctx.Dir, "Dockerfile"),
"COPY playbooks/ ${HOME}/playbooks/",
dockerfileFragment)
Expand Down Expand Up @@ -291,7 +291,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
data:
msg: The decrypted value is {{the_secret.the_secret}}
`
err := util.ReplaceInFile(
err := kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "argstest.yml"),
originalPlaybookFragment,
argsPlaybook)
Expand All @@ -315,7 +315,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
data:
shouldBeCamel: '{{ camelCaseVar | default("false") }}'
`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "casetest.yml"),
originalPlaybookFragment,
casePlaybook)
Expand All @@ -334,7 +334,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
tasks:
- command: echo hello
- debug: msg='{{ "hello" | test }}'`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "inventorytest.yml"),
"---\n- hosts: localhost\n gather_facts: no\n collections:\n - community.kubernetes\n - operator_sdk.util\n tasks:\n - import_role:\n name: \"inventorytest\"",
inventoryPlaybook)
Expand Down Expand Up @@ -392,7 +392,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
time: 1s
when: configmap.resources|length > 0 and (configmap.resources.0.data.iterations|int) < 5
`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "reconciliationtest.yml"),
originalPlaybookFragment,
reconciliationPlaybook)
Expand All @@ -416,7 +416,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
data:
hello: "world"
`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "selectortest.yml"),
originalPlaybookFragment,
selectorPlaybook)
Expand Down Expand Up @@ -475,7 +475,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
execCommandStderr: '{{ exec_result.stderr.strip() }}'
logs: '{{ log_result.log }}'
`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "subresourcestest.yml"),
originalPlaybookFragment,
subresourcesPlaybook)
Expand Down Expand Up @@ -510,7 +510,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
data:
foo: bar
`
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "playbooks", "clusterannotationtest.yml"),
originalPlaybookFragment,
clusterAnnotationTest)
Expand Down Expand Up @@ -544,7 +544,7 @@ func (ma *AdvancedMolecule) addPlaybooks() {
task := fmt.Sprintf("%s_test.yml", k)
logMsgForKind = fmt.Sprintf("removing FIXME assert from %s", task)
log.Infof(logMsgForKind)
err = util.ReplaceInFile(
err = kbutil.ReplaceInFile(
filepath.Join(ma.ctx.Dir, "molecule", "default", "tasks", task),
fixmeAssert,
"")
Expand Down
Loading