Giter VIP home page Giter VIP logo

Comments (4)

mdbooth avatar mdbooth commented on July 26, 2024

@EmilienM Do you remember why we have this in validateRemoteManagedGroups?

func validateRemoteManagedGroups(remoteManagedGroups map[string]string, ruleRemoteManagedGroups []infrav1.ManagedSecurityGroupName) error {
if len(ruleRemoteManagedGroups) == 0 {
return fmt.Errorf("remoteManagedGroups is required")
}
for _, group := range ruleRemoteManagedGroups {
if _, ok := remoteManagedGroups[group.String()]; !ok {
return fmt.Errorf("remoteManagedGroups: %s is not a valid remote managed security group", group)
}
}
return nil
}

I think empty remote managed groups is fine, right? They just need to be valid if specified.

from cluster-api-provider-openstack.

mdbooth avatar mdbooth commented on July 26, 2024

Hmm, we have a test that this produces an error:

{
name: "Valid rule with missing remoteManagedGroups",
rule: infrav1.SecurityGroupRuleSpec{
PortRangeMin: ptr.To(22),
PortRangeMax: ptr.To(22),
Protocol: ptr.To("tcp"),
},
remoteManagedGroups: map[string]string{
"self": "self",
"controlplane": "1",
"worker": "2",
"bastion": "3",
},
wantErr: true,
},

Now I'm worried I'm forgetting something important.

from cluster-api-provider-openstack.

mdbooth avatar mdbooth commented on July 26, 2024

I suspect we've just over-encoded an assumption that there will always be a remote group because the 'upgrade' rules all had one. I suspect we can just remove it, but I'd like to get a second opinion.

from cluster-api-provider-openstack.

EmilienM avatar EmilienM commented on July 26, 2024

/assign EmilienM

from cluster-api-provider-openstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.